# Update MCP server configuration

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

Updates the configuration of an existing Model Control Protocol (MCP) server. You can modify the server name, associated applications, and enabled tools. Only the fields included in the request will be updated.

---

## PATCH `/api/v3/mcp/{id}`

**Endpoint:** `https://backend.composio.dev/api/v3/mcp/{id}`

**Summary:** Update MCP server configuration

Updates the configuration of an existing Model Control Protocol (MCP) server. You can modify the server name, associated applications, and enabled tools. Only the fields included in the request will be updated.

### Authentication

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

### Path Parameters

- `id` (string) *(required)*: The ID of the MCP server

### Request Body

**Schema:**

- `name` (string): Human-readable name to identify this MCP server instance (4-30 characters, alphanumeric, spaces, and hyphens only)
- `toolkits` (array<string>): List of toolkit slugs this server should be configured to work with.
- `allowed_tools` (array<string>): List of action identifiers that should be enabled for this server
- `managed_auth_via_composio` (boolean): Whether the MCP server is managed by Composio
- `auth_config_ids` (array<string>): List of auth config IDs to use for this MCP server.

**Example:**

```json
{
  "name": "string",
  "toolkits": [
    "string"
  ],
  "allowed_tools": [
    "string"
  ],
  "managed_auth_via_composio": true,
  "auth_config_ids": [
    "string"
  ]
}
```

### Responses

#### 200 - Successfully updated MCP server. Returns the complete updated server configuration including connection details, authentication settings, and available tools.

**Response Schema:**

- `id` (string) *(required)*: UUID of the MCP server instance
- `name` (string) *(required)*: User-defined descriptive name for this MCP server
- `auth_config_ids` (array<string>) *(required)*: ID references to the auth configurations used by this server
- `allowed_tools` (array<string>) *(required)*: Array of tool slugs that this MCP server is allowed to use
- `mcp_url` (string) *(required)*: [DEPRECATED] Please use the URL with user_id or connected_account_id query param
- `toolkits` (array<string>) *(required)*: Array of toolkit slugs that this MCP server is allowed to use
- `toolkit_icons` (object) *(required)*: Object mapping each toolkit slug to its icon/logo URL for display purposes
  - `[key: string]` (string)
- `commands` (object) *(required)*: Set of command line instructions for connecting various clients to this MCP server
  - `cursor` (string) *(required)*: Command line instruction for Cursor client setup
  - `claude` (string) *(required)*: Command line instruction for Claude client setup
  - `windsurf` (string) *(required)*: Command line instruction for Windsurf client setup
- `updated_at` (string) *(required)*: Date and time when this server configuration was last modified
- `created_at` (string) *(required)*: Date and time when this server was initially created
- `server_instance_count` (number) *(required)*: Total count of active user instances connected to this server
- `managed_auth_via_composio` (boolean) *(required)*: Whether the MCP server is managed by Composio
- `deleted` (boolean) *(required)*: Whether the MCP server is deleted

**Example Response:**

```json
{
  "id": "string",
  "name": "string",
  "auth_config_ids": [
    "string"
  ],
  "allowed_tools": [
    "string"
  ],
  "mcp_url": "string",
  "toolkits": [
    "string"
  ],
  "toolkit_icons": {
    "key": "string"
  },
  "commands": {
    "cursor": "string",
    "claude": "string",
    "windsurf": "string"
  },
  "updated_at": "string",
  "created_at": "string",
  "server_instance_count": 1,
  "managed_auth_via_composio": true,
  "deleted": true
}
```

#### 400 - Bad request. The request parameters may be invalid or in an incorrect format.

**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>)

#### 403 - Forbidden. The authenticated user does not have permission to update this MCP server.

**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 not found. No server with the specified ID exists or it has been deleted.

**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 PATCH "https://backend.composio.dev/api/v3/mcp/string" \
  -H "x-api-key: YOUR_API_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "name": "string",
    "toolkits": [
      "string"
    ],
    "allowed_tools": [
      "string"
    ],
    "managed_auth_via_composio": true,
    "auth_config_ids": [
      "string"
    ]
  }'
```