---
title: "Detach an agent MCP server"
method: DELETE
path: "/agents/{agent_id}/mcp-servers/{server_id}"
tags: ["Agents"]
---

# Detach an agent MCP server

`DELETE /agents/{agent_id}/mcp-servers/{server_id}`

Detach an MCP server (connector) from an agent. This is idempotent — detaching a server that isn't attached returns `detached: false` rather than an error.

## Path parameters

- `agent_id` string, required
- `server_id` string, required

## Response `200`

The detach result.

- object
  - `agent_id` string
  - `server_id` string
  - `detached` boolean — `true` if the server was attached and is now removed; `false` if it was not attached.

## Other responses

- `401` — Unauthorized — missing or invalid API key.
- `403` — Forbidden — the caller does not have update access to this agent.
- `404` — Agent not found.
- `500` — Internal server error.

---

[API](https://skmtc.dev/gumloop/apis/public-api.md) · [All operations](https://skmtc.dev/gumloop/apis/public-api/llms.txt) · [OpenAPI document](https://skmtc-service-production.skmtc.workers.dev/v1/apis/gumloop/public-api/revisions/115f2d6ce387/schema)
