defineMcpServer.
Define an MCP server
Each member is passed by handle — the same rich refs an agent accepts:mcp/crm.ts
Deploy
Connect a remote MCP client
Hosted clients that speak HTTP (ChatGPT custom connectors, Claude.ai, Cursor over HTTP) connect to the Streamable HTTP URL and sign in with OAuth — there is no token to paste:Authorization: Bearer if you need them.
Hosted callbacks are allowlisted for ChatGPT, Claude, and Cursor. On the MCP server page, Connected apps lists each live OAuth grant. Revoke a grant to sign that client out; it will need to authorize again.
Connect a coding agent
cargo-ai mcp serves a deployed server to any stdio MCP client, using the credentials the CLI already has — there is no token to copy into client config.
--server, the bridge falls back to CARGO_MCP_SERVER_UUID, or to the workspace’s only MCP server when there is exactly one.
stdout carries the MCP protocol and every log goes to stderr, so nothing else
may write to stdout around the bridge.
MCP or the agent skills?
Both let a coding agent operate Cargo, and they are not interchangeable:
Rule of thumb: more than a handful of records, or anything worth re-running, belongs in the CLI. Never fan an MCP tool out record-by-record over a list — that is what a batch is for, and it is cheaper and observable.
From the CLI
Servers can also be created and edited without the CDK:kind: "tool" or kind: "agent" — an agent can be exposed as a callable MCP tool. update replaces the --actions and --resources arrays wholesale rather than merging, so read the current server first and pass the full array back.
