Now inviting automation leaders: publish your playbook as a skill, under your own name. Publish yours →
Automation Skills
All skills/Agent builder/Mcp-and-vaults
Reference · Agent builder

Mcp-and-vaults

Part of Agent builder. Install the skill and your agent reads this page when it needs the depth.

MCP Servers and Vault Credentials

MCP config is split across two steps:

  1. Agent declares which MCP servers exist (names + URLs only, no secrets).
  2. Session supplies auth via vault credentials referenced by vault_ids.

Declare MCP Servers on the Agent

Each entry:

Field Required Description
type yes Must be "url"
name yes Unique within the agent. 1-255 chars. Used as mcp_server_name in tools and on session events.
url yes Up to 2048 chars. Remote MCP endpoint, streamable HTTP transport.
"mcp_servers": [
  { "type": "url", "name": "github", "url": "https://api.githubcopilot.com/mcp/" },
  { "type": "url", "name": "slack",  "url": "https://mcp.slack.com/mcp" }
]

Limits:

Create a Vault

{ "display_name": "${vault_display_name}" }

Response: { "id": "vault_…", … }.

Add Credential. POST /v1/vaults/${vault_id}/credentials

Credentials match MCP servers by exact mcp_server_url. If no credential URL matches, the connection is attempted unauthenticated.

static_bearer

For MCPs that accept a static API key as a bearer token.

{
  "display_name": "${cred_display_name}",
  "auth": {
    "type": "static_bearer",
    "mcp_server_url": "${mcp_url}",
    "token": "${bearer_token}"
  }
}

mcp_oauth

For MCPs that use OAuth (Slack, Fireflies, Notion, Circle, etc.).

{
  "display_name": "${cred_display_name}",
  "auth": {
    "type": "mcp_oauth",
    "mcp_server_url": "${mcp_url}",
    "access_token": "${access_token}",
    "expires_at": "${iso8601_expiry}",
    "refresh": {
      "refresh_token": "${refresh_token}",
      "client_id": "${client_id}",
      "token_endpoint": "${token_endpoint}",
      "token_endpoint_auth": { "type": "none" }
    }
  }
}

Drop the refresh block if the user doesn't have refresh-token info.

Bind Vaults at Session Creation

{
  "agent": "${agent_id}",
  "environment_id": "${env_id}",
  "vault_ids": ["${vault_id}"]
}

Multiple vaults can be passed if credentials are split across them.

Connection and Authentication Failures

Session creation does not validate MCP connectivity. Failures surface as session.error events:

Error type Meaning
mcp_connection_failed_error Server unreachable. Network error, timeout, or non-auth HTTP failure.
mcp_authentication_failed_error Server reachable but rejected the credential.

Each event includes the affected mcp_server_name and a retry_status. Connection retries on the next session.status_idle to session.status_running transition.

The user's app can:

MCP Tool Output Handling

Output > 100K tokens auto-saves to the sandbox; the model gets a truncated preview and the file path and reads the rest via read.

Supported MCP Servers

stdio-only MCPs are not supported by Managed Agents directly. They must be wrapped in an HTTP-transport adapter or tunneled.

Publish your skill

Copy this prompt into Claude Code, Codex or any agent. It walks you through your first skill in about 20 minutes, with you as the author.

Click to copy.