Remove an MCP server from an agent

View as Markdown
Takes the server away from the agent. This is the switch to stop an agent using a server's tools (there is no per-tool "disabled"). The server stays in the workspace registry and on any other agents; delete it with `DELETE /api/mcp-servers/{mcpServerId}` to remove it everywhere. **Side effects.** Removes the assignment and pushes the agent's remaining MCP server list to the voice engine. If that push fails, the assignment is restored and the error returned, so the agent never keeps a server Jelliu reports as removed. Writes an `agent.mcp.detach` audit entry. **Idempotency.** Idempotent: answers `204` even when the server was not assigned or the agent does not exist (the agent's list is re-pushed either way). **Webhook events.** `audit.log_recorded` for the audit entry, if you subscribe to it. See [Webhooks](/webhooks). **Access** - **Required scope:** `write`. Any workspace role. - **Rate limit:** General API — 120 (Starter), 200 (Growth), 300 (Business) or 600 (Enterprise) requests/min per workspace. See [Rate limits](/rate-limits). - **Plan:** Available on every plan.

Authentication

AuthorizationBearer
Workspace API key: `jl_` followed by 64 lowercase hex characters, created by the workspace owner in the dashboard (**Settings → API Keys**) and sent as `Authorization: Bearer jl_...`. The plaintext is shown once, at creation; Jelliu stores only a SHA-256 hash. A workspace can hold up to 25 active keys. | Scope | GET / HEAD | POST / PUT / PATCH / DELETE | Admin-only routes | | --- | --- | --- | --- | | `read` | Yes | No | No | | `write` | Yes | Yes | No | | `full` | Yes | Yes | Yes | Operations restricted to admins or owners reject keys without the `full` scope with `403`, and say so in their description. No key, whatever its scope, can mint or revoke API keys or rotate a webhook secret — that requires a signed-in owner session. A revoked key stops authenticating within about 10 seconds. See [Authentication](/authentication).

Path parameters

agentIdstringRequiredformat: "uuid"

UUID of the agent. It must belong to the authenticated workspace; an id from another workspace answers 404, exactly like an unknown one. Returned as id by GET /api/agents.

mcpServerIdstringRequiredformat: "uuid"

UUID of the MCP server registration. It must belong to the authenticated workspace; an id from another workspace answers 404, exactly like an unknown one. Returned as id by GET /api/mcp-servers.

Response

Removed (or was not assigned). No body.

Errors

400
Bad Request Error
401
Unauthorized Error
403
Forbidden Error
429
Too Many Requests Error
502
Bad Gateway Error