# Create a new MCP server

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

Creates a new Model Control Protocol (MCP) server instance for the authenticated project. An MCP server provides a connection point for AI assistants to access your applications and services. The server is configured with specific authentication and tool permissions that determine what actions the connected assistants can perform.

---

## POST `/api/v3/mcp/servers`

**Endpoint:** `https://backend.composio.dev/api/v3/mcp/servers`

**Summary:** Create a new MCP server

Creates a new Model Control Protocol (MCP) server instance for the authenticated project. An MCP server provides a connection point for AI assistants to access your applications and services. The server is configured with specific authentication and tool permissions that determine what actions the connected assistants can perform.

### Authentication

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

### Request Body

**Schema:**

- `name` (string) *(required)*: Human-readable name to identify this MCP server instance (4-30 characters, alphanumeric, spaces, and hyphens only)
- `auth_config_ids` (array<string>) *(required)*: ID references to existing authentication configurations
- `no_auth_apps` (array<string>): List of NO_AUTH apps to enable for this MCP server
- `allowed_tools` (array<string>): List of tool slugs that should be allowed for this server. If not provided, all available tools for the authentication configuration will be enabled.
- `managed_auth_via_composio` (boolean): Whether the MCP server is managed by Composio

**Example:**

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

### Responses

#### 201 - MCP server created successfully. Returns the complete server configuration including connection details and command instructions.

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

**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
}
```

#### 400 - Bad request. The request body may be invalid, missing required parameters, or the auth_config_id may not exist.

**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 create MCP servers for this project.

**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 - Not Found. The specified auth_config_id does not exist or is not accessible to the authenticated user.

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