---
docId: doc_d6f6257e6563473b888c15f051f6fc9d
title: Delete an MCP server
description: "Delete an MCP server and all its tools, keeping its secrets."
api:
  group: herramientas/servidores-mcp
  auth: bearer
  operations:
    - operationId: deleteMcpServer
      method: DELETE
      path: '/v1/tools/mcp/{mcpId}'
      postmanName: Delete an MCP server
---

<script>
  import { Ways, Note } from '$lib/components';
</script>

# Delete an MCP server

Delete the MCP server, its catalog tools, and their connections to agents. Its secrets remain in the workspace.

## Example

<Ways tabs="api,sdk">
<Ways.Way name="api">

```bash
curl -X DELETE https://api.platic.ai/v1/tools/mcp/$MCP_ID \
  -H "Authorization: Bearer $PLATIC_API_KEY"
```

</Ways.Way>
<Ways.Way name="sdk">

```ts
await platic.tools.mcp.delete("mcp_123");
```

</Ways.Way>
</Ways>

## Path parameters

| Parameter | Type | Description | Required |
|-----------|------|-------------|----------|
| `mcpId` | string | Id of the MCP server | ✓ |

## Response

```json
{
  "status": "success",
  "message": "MCP server deleted successfully",
  "data": {
    "mcpId": "QZPHpckDPC58JIVLQA3Z"
  }
}
```

### Response fields

| Field | Type | Description |
|-------|------|-------------|
| `mcpId` | string | Id of the deleted server |

## Errors

| Status | `details.code` | When it happens |
|--------|----------------|-----------------|
| `403` | `FORBIDDEN` | The person behind the token does not have access to Integrations, or does not have access to an agent that uses one of its tools |
| `404` | `NOT_FOUND` | The server does not exist in this workspace |
| `409` | `RESOURCE_CHANGED` | The server changed while it was being deleted. Get it again and retry |
| `409` | `DELETION_IN_PROGRESS` | The deletion is already in progress. Repeat the call to continue it |

<Note type="warning">

This cannot be undone. Agents that used its tools lose them immediately.

</Note>

## Notes

- Secrets are not deleted with the server. If nobody uses them anymore, [delete them](/api-reference/secrets/delete) separately.
- To remove only some tools and keep the server, use [choose MCP tools](/api-reference/mcp-servers/select-tools).
