Connecting a client to the MCP server
Every Rosepetal project can expose an MCP server: 53 tools with which an assistant such as Claude lists datasets, inspects images and metrics, uploads images and annotations, launches trainings and manages users. MCP is the protocol AI assistants use to call external tools.
Endpoint
The server is one route of the Rosepetal API, served by both functions:
https://europe-west1-<projectId>.cloudfunctions.net/api/mcp
https://us-central1-<projectId>.cloudfunctions.net/usapi/mcpA tool call has to finish within the time limit of the function that serves it: 60 seconds on api, one hour on usapi. The first URL is enough for most work. Use the second one for work on datasets with many images: deleting datasets, images or models, renaming, merging or deleting tags, moving or copying images and deleting groups.
| Property | Value |
|---|---|
| Transport | Streamable HTTP |
| Method | POST. GET and other methods are answered with 405 |
| Sessions | None. Every request is independent, and the answer is a single JSON message |
| Server name and version | rosepetal, 0.2.0 |
| Capabilities | Tools. The server offers no resources or prompts |
Token
The server accepts only requests that carry the MCP token of the project:
Authorization: Bearer <MCP token>The token is set when the API of the project is deployed; ask the administrator of your Rosepetal installation for it. A project without a token configured refuses every request. A missing or wrong token is answered with 401 and the JSON-RPC error -32001 Unauthorized.
WARNING
The token gives full access. The server does not act as the person who connects: it works with its own identity, and every holder of the token can do everything the tools can do, including deleting datasets and creating or deleting users. Treat it as an administrator credential, keep it out of shared files and repositories, and have it replaced if it leaks.
Client configuration
Any client that supports MCP over HTTP with a custom header can connect. With Claude Code:
claude mcp add --transport http rosepetal \
https://europe-west1-<projectId>.cloudfunctions.net/api/mcp \
--header "Authorization: Bearer <MCP token>"Or in the .mcp.json of a project, with the token read from an environment variable so that it is not written in the file:
{
"mcpServers": {
"rosepetal": {
"type": "http",
"url": "https://europe-west1-<projectId>.cloudfunctions.net/api/mcp",
"headers": { "Authorization": "Bearer ${ROSEPETAL_MCP_TOKEN}" }
}
}
}Checking the connection
The server can be called by hand with JSON-RPC. The Accept header is required:
URL=https://europe-west1-<projectId>.cloudfunctions.net/api/mcp
curl -s -X POST "$URL" \
-H "Authorization: Bearer $ROSEPETAL_MCP_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'curl -s -X POST "$URL" \
-H "Authorization: Bearer $ROSEPETAL_MCP_TOKEN" \
-H "Content-Type: application/json" \
-H "Accept: application/json, text/event-stream" \
-d '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"dataset_list","arguments":{"limit":3}}}'How tools answer
- Results come back as one text block that holds JSON. Stored timestamps are ISO 8601 strings, some dates come already formatted as
DD/MM/YYYY HH:mm:ss(createdDate,updatedDate), and a reference to another record is its path, such asdataset/rp-obj-bottles/tag/scratch. - Errors come back as a tool result flagged
isError, with the reason as text:dataset rp-obj-bottles not found. The assistant can read it and correct the call. - Destructive tools do nothing unless the call carries
confirm: true. Withconfirm: falsethey answerdestructive operation: pass confirm: true to proceed, and without the parameter the call is rejected as invalid. They are marked destructive in the tool pages. - Lists are summaries. Tools that return many datasets, images or models return a short record of each.
dataset_imagesand the tools that return one record (dataset_get,image_get,image_get_by_name,model_get) take afieldsparameter to get chosen fields of the stored record instead. - Ids of what is created.
dataset_create,dataset_tag_create,dataset_group_create,image_uploadandmodel_trainreturn the new id at the top level of the result, under the name the other tools use:datasetId,tagId,groupId,imageId,modelId. - Answers of the HTTP API.
dataset_operation_create,dataset_group_deleteandmodel_share_linkcall a route of the HTTP API and return its answer insidedata. - Cloud only. Some tools need services that exist only in a cloud project: the training service and the long-running function. On an installation that runs in offline mode they answer
this tool needs cloud services and is not available in offline mode. They are marked cloud only. - No progress reports. A tool call returns when its work is done.
Tools
| Area | Read | Write |
|---|---|---|
| Datasets | dataset_list, dataset_get, dataset_images, dataset_tag_stats, dataset_division_stats, dataset_annotation_counts, dataset_tags, dataset_groups, dataset_random_images, dataset_prompts | dataset_create, dataset_update, dataset_delete, dataset_tag_create, dataset_tag_update, dataset_tag_delete, dataset_tags_combine, dataset_group_create, dataset_group_delete, dataset_operation_create, dataset_convert |
| Images | image_get, image_get_by_name, image_comments | image_set_division, image_set_tag, image_set_labeled, image_groups_update, image_set_comments, image_upload, image_upload_annotations, image_delete |
| Models | model_list, model_get, model_metrics, model_evaluation_images, model_training_log, model_validate_to_train | model_train, model_stop_training, model_share_link, model_delete |
| Project | project_config, project_settings, user_list, user_get, profile_list | settings_update, user_create, user_update, user_delete, profile_update, profile_delete |
The destructive tools are dataset_delete, dataset_tag_delete, dataset_tags_combine, dataset_group_delete, image_delete, model_delete, user_delete and profile_delete.