DorkOS
ApiAgentsAgentidMcp servers

Add a managed MCP server to an agent

POST
/api/agents/{agentId}/mcp-servers

Add an MCP server to an agent and enable it. This introduces a command (stdio) or remote endpoint (http/sse) that will run in the agent’s environment, so a person approves it first at a card showing the exact command/args/url. Rejects the reserved name "dorkos" and any name the agent already uses.

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

Response Body

application/json

curl -X POST "https://example.com/api/agents/{agentId}/mcp-servers" \  -H "Content-Type: application/json" \  -d '{    "agentId": "string",    "name": "string",    "connection": {      "transport": "stdio",      "command": "string"    }  }'
[  {    "name": "string",    "enabled": false,    "connection": {      "transport": "stdio",      "command": "string",      "args": [],      "env": {}    },    "addedAt": "2019-08-24T14:15:22Z",    "addedBy": "string"  }]