Skip to content

AI agents (MCP)

AI agents such as Claude can run machines and ship apps through Mayadyn’s MCP (Model Context Protocol) endpoint. Each tool call is an ordinary API call made with the agent’s token, so scopes, workspace isolation, idempotency and the audit log apply to agents exactly as to people.

URL https://console.mayadyn.com/mcp
Transport Streamable HTTP
Authentication Header Authorization: Bearer myd_… (an API token)

Only a bearer token is accepted; console cookies are not. A request without a token gets unauthenticated: “MCP needs a Mayadyn API token”.

The API tokens page shows the endpoint after you create a token.

  1. Create a token for the agent in API tokens (see choose safe scopes). Name it after the agent, e.g. claude code.

  2. Add the MCP server to your agent with the URL and the header.

    For Claude Code:

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

    Other MCP clients that support streamable HTTP and custom headers take the same URL and header.

  3. Ask the agent something read-only first, e.g. “what is running where?”. It should call list_connections and list_resources.

Mayadyn has an agent skill: the workflow and safety rules for agents using Mayadyn. It tells the agent to check connections, dry run first, use idempotency keys, wait on operations, and never delete what the user did not name. Install it in your agent’s skills folder alongside the MCP server. The MCP server also sends a short version of the workflow to the agent when it connects.

Tool What it does Scope
whoami The workspace, project and scopes of the token in use. any
list_catalog Providers, regions (with city), unified sizes and images. none
list_connections The workspace’s cloud connections and their health. read
connection_setup For a keyless connection, the trust steps the account owner runs in their cloud. The agent shows them; it cannot run them. read
list_resources Machines across all connections; filter by provider, region, state, connection. read
get_resource One machine by id, including IPs and SSH user. read
create_vm Create a machine; dry_run to check first. Returns an operation. write
start_vm Start a stopped machine. Returns an operation. write
stop_vm Stop a running machine; its disk is kept. Returns an operation. write
delete_vm Delete a machine and its boot disk. Irreversible. Returns an operation. destroy
sync_connection Refresh one connection’s inventory from its cloud. Returns an operation. write
get_operation An operation’s status, result or error (code and hint). read
wait_operation Wait up to timeout_seconds (default and max 55) for an operation, then return it. Call again while it is still pending or running. read
list_operations Recent operations, newest first; filter by status; limit default 50. read
list_apps Apps, their status and live release. read
get_app One app: URL, status, live release, host health. read
create_app Create an app (connection, name, region, size, port default 8080). Nothing runs until deploy_app. write
deploy_app Deploy an image, or a git_url (with git_ref, dockerfile) built on the host. Returns an operation. write
list_releases An app’s releases, newest first: live, failed, superseded. read
rollback_app Deploy an earlier release again. Returns an operation. write
app_logs The container’s recent output (about the last 100 lines) and the host’s state. read
set_app_env Replace the app’s environment variables. Stored encrypted, never shown again; applied on the next deploy. write
delete_app Delete an app: its host machine, URL and data. Irreversible. destroy

Tools that change things accept idempotency_key (except create_app, set_app_env and delete_app) and wait_seconds (up to 55) where they return an operation. create_vm, start_vm, stop_vm, delete_vm and deploy_app accept dry_run.

Agents cannot connect cloud accounts, manage members or tokens, set registry credentials or git tokens, or read any credential. People do those in the console or CLI.

A failed tool call returns the API error as JSON: code, message and usually hint. Agents should follow the hint. See Troubleshooting.

Agent’s job Scopes
Answer questions about what runs where read
Create, start and stop machines; deploy apps read, write
Also clean up machines and apps read, write, destroy
  • Avoid admin for agents. No MCP tool needs it.
  • Give destroy only when you want the agent to delete things. Deletes are irreversible.
  • Limit the token to a project to keep the agent away from other work.
  • Set an expiry, and revoke the token when the agent no longer needs it.
  • write lets the agent deploy code, and deployed code can read the app’s environment variables. Grant it only to agents you trust with those secrets.
  • Everything the agent does appears in the audit log as the token’s owner, via token.