Skip to content

MCP server

Mayadyn exposes its API to AI agents over the Model Context Protocol. Each tool makes one REST call with the caller’s own bearer token, so authentication, scopes, workspace isolation, idempotency, rate limits and audit apply exactly as for the REST API.

Endpoint https://console.mayadyn.com/mcp (also /mcp/*)
Transport MCP streamable HTTP, stateless, JSON responses (no server-sent event stream)
Auth Authorization: Bearer myd_… (an API token). Session cookies are never accepted
Server name mayadyn (title “Mayadyn”)
Rate limit 3000/min per IP and 600/min per token at /mcp; each tool call also counts against the token’s /v1 budget

Without a Bearer myd_ header the endpoint answers 401 with WWW-Authenticate: Bearer realm="mayadyn" and:

{"code": "unauthenticated", "message": "MCP needs a Mayadyn API token",
"hint": "Create a token in the console (API tokens) and send it as `Authorization: Bearer myd_...`."}

Connect Claude Code:

Terminal window
claude mcp add --transport http mayadyn https://console.mayadyn.com/mcp \
--header "Authorization: Bearer myd_..."

Server instructions sent to the client: list connections → list catalog → create_vm with dry_run=true → create_vm → wait_operation; pass an idempotency_key; follow error hints; delete_vm is irreversible.

A tool’s result is the JSON of the REST response (structured content). An API error is returned as a tool error (isError: true) whose text is the error JSON {"code", "message", "hint"?, "operation_id"?} (see Errors). An internal failure while making the call is {"code": "internal", "message": "..."}. An HTTP error body that is not JSON becomes code http_<status>.

Common inputs for tools that create operations:

Field Type Description
idempotency_key string sent as Idempotency-Key; retrying with the same key returns the same operation. Not sent on dry runs
wait_seconds integer wait up to this many seconds for the operation (max 55, sent as ?wait=)

Scopes are those of the REST endpoint each tool calls.

Tool Input Calls Returns Scope
whoami none GET /v1/me Me (token’s workspace, project, scopes) none
list_catalog none GET /v1/catalog Catalog none
list_connections none GET /v1/connections Connection[] read
connection_setup connection (name or id) GET /v1/connections/{ref}/setup ConnectionSetup (steps for the account owner; the agent cannot run them) read
list_resources provider?, region?, state?, connection? GET /v1/resources Resource[] read
get_resource id (resource id) GET /v1/resources/{id} Resource read
get_operation id GET /v1/operations/{id} Operation read
wait_operation id, timeout_seconds? (default and max 55) GET /v1/operations/{id}?wait= Operation; call again while pending/running read
list_operations status? (pending, running, succeeded, failed), limit? (default 50) GET /v1/operations Operation[], newest first read
list_apps none GET /v1/apps App[] read
get_app app (name or id) GET /v1/apps/{ref} App read
list_releases app GET /v1/apps/{ref}/releases Release[], newest first read
app_logs app GET /v1/apps/{ref}/logs AppLogs (last ~100 lines) read

List tools return the REST items as a JSON array (the {"items": [...]} wrapper is removed).

Tool Input Calls Returns Scope
create_vm connection, name, region?, size?, image?, ssh_public_key?, labels?, dry_run?, idempotency_key?, wait_seconds? POST /v1/vms Operation, or the DryRun plan write
start_vm id, dry_run?, idempotency_key?, wait_seconds? POST /v1/vms/{id}/start Operation, or {"dry_run": true, "allowed": true} write
stop_vm same as start_vm POST /v1/vms/{id}/stop same write
delete_vm same as start_vm DELETE /v1/vms/{id} same destroy
sync_connection connection, idempotency_key?, wait_seconds? POST /v1/connections/{ref}/sync Operation write
Tool Input Calls Returns Scope
create_app connection, name, region?, size?, port? (default 8080) POST /v1/apps App write
deploy_app app, image? or git_url? (+ git_ref? default main, dockerfile?), port?, dry_run?, idempotency_key?, wait_seconds? POST /v1/apps/{ref}/deploy Operation, or {"dry_run": true, "allowed": true} write
rollback_app app, release (number), idempotency_key?, wait_seconds? POST /v1/apps/{ref}/rollback Operation write
set_app_env app, env (object) PUT /v1/apps/{ref}/secrets with {"env": ...} {"saved": true, "applies": "next deploy"} write
delete_app app DELETE /v1/apps/{ref} Operation destroy

Notes:

  • set_app_env replaces the whole environment; registry credentials and the git token are kept. Registry and git token cannot be set through MCP (the person does it in the console or CLI).
  • delete_app takes no idempotency_key, dry_run or wait.
  • sync_connection and rollback_app have no dry_run (the REST sync accepts ?dry_run=true).
  • Tool annotations: read-only tools are marked read-only and idempotent; delete_vm and delete_app are marked destructive; cloud-changing tools are marked open-world.

Connections cannot be created, verified, re-keyed or deleted; members, projects, tokens, audit, workspace settings and SSO are not exposed. Credentials are never readable through Mayadyn.