Skip to main content
PATCH
/
ai-agents
/
agent-builder
/
agents
/
{uid}
/
mcp
/
add
Add MCP Servers to Agent
curl --request PATCH \
  --url https://{appId}.api-{region}.cometchat.io/v3/ai-agents/agent-builder/agents/{uid}/mcp/add \
  --header 'Content-Type: application/json' \
  --header 'apikey: <api-key>' \
  --data '
{
  "mcps": [
    "filesystem",
    "git",
    "postgres"
  ]
}
'
{
  "success": true,
  "data": {
    "uid": "agent-uuid-1234",
    "appId": "my-app-id",
    "name": "Support Agent",
    "icon": "https://example.com/icon.png",
    "isActive": true,
    "description": "A helpful support agent",
    "tools": [
      "gmail",
      "slack"
    ],
    "files": [],
    "websites": [],
    "otherKbIntegrations": [],
    "apiTools": [],
    "mcpServers": [],
    "frontendActions": [],
    "ragVersion": "v2",
    "lastMessageAt": null,
    "instruction": "You are a helpful assistant",
    "formattedInstruction": "You are a helpful assistant",
    "metaData": {},
    "model": "gpt-4o-mini",
    "modelMetaData": {},
    "createdAt": 1700000000000,
    "updatedAt": 1700000000000
  }
}
For the complete error reference, see Error Guide.

Authorizations

apikey
string
header
required

API Key (i.e. Rest API Key from the Dashboard).

Path Parameters

uid
string
required

Unique identifier of the agent

Body

application/json
mcps
string[]
required

Array of MCP server slugs to add or remove

Example:
["filesystem", "git", "postgres"]

Response

200 - application/json

MCP servers successfully added to the agent.

success
boolean
Example:

true

data
object