# Delete an MCP server instance and associated connected accounts

**Documentation:** /reference/api-reference/mcp/deleteMcpServersByServerIdInstancesByInstanceId

Removes a user instance from the MCP server and deletes all connected accounts for that user that are associated with the auth configurations of this specific MCP server. Connected accounts for other auth configurations are not affected.

---

## DELETE `/api/v3/mcp/servers/{serverId}/instances/{instanceId}`

**Endpoint:** `https://backend.composio.dev/api/v3/mcp/servers/{serverId}/instances/{instanceId}`

**Summary:** Delete an MCP server instance and associated connected accounts

Removes a user instance from the MCP server and deletes all connected accounts for that user that are associated with the auth configurations of this specific MCP server. Connected accounts for other auth configurations are not affected.

### Authentication

**ApiKeyAuth** - API Key in `header` header `x-api-key` OR **UserApiKeyAuth** - API Key in `header` header `x-user-api-key`

### Path Parameters

- `serverId` (string) *(required)*: The ID of the MCP server
- `instanceId` (string) *(required)*: The instance ID (user ID) to delete

### Responses

#### 200 - Successfully deleted MCP server instance and associated connected accounts.

**Response Schema:**

- `message` (string) *(required)*
- `deleted_connected_accounts` (number) *(required)*

**Example Response:**

```json
{
  "message": "string",
  "deleted_connected_accounts": 1
}
```

#### 400 - Bad request. The request parameters may be invalid.

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 401 - Unauthorized. Authentication is required or the provided credentials are invalid.

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 404 - MCP server or instance not found.

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

#### 500 - Internal server error. An unexpected error occurred while processing the request.

**Response Schema:**

- `error` (object) *(required)*
  - `message` (string) *(required)*
  - `code` (number) *(required)*
  - `slug` (string) *(required)*
  - `status` (number) *(required)*
  - `request_id` (string)
  - `suggested_fix` (string)
  - `errors` (array<string>)

### Example cURL Request

```bash
curl -X DELETE "https://backend.composio.dev/api/v3/mcp/servers/string/instances/string" \
  -H "x-api-key: YOUR_API_KEY"
```