Skip to main content
POST
Attach an MCP server to an agent

Authorizations

Authorization
string
header
required

A long-lived, privileged API key (ek_... prefix), minted once from the dashboard. Intended for trusted server-side use only; never expose it in client-side code. Send as Authorization: Bearer ek_.... Required by every Calls, Batches, Agents, Tools, MCP Servers, Documents, and Realtime route.

Path Parameters

agent_id
string
required
mcp_server_id
string
required

Body

application/json

Body is entirely optional — an empty/absent body means every tool the server exposes is available to this agent (the pre-existing behavior). Calling attach again on an already-attached server updates its tool selection rather than being a no-op, so a dev can change which tools are enabled without detaching and reattaching.

enabled_tools
string[] | null

Response

Successful Response

status
string
required
enabled_tools
string[] | null