> ## Documentation Index
> Fetch the complete documentation index at: https://docs.nedzo.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Add an MCP server

> Add an MCP server to a workspace, so voice agents can use its tools.

> [!NOTE]
>
> This endpoint is for the VIP plan only. Other plans get a `403`. See [Plan access](https://docs.nedzo.ai/api-reference/introduction.md#plan-access).

An MCP server gives a voice agent more tools. A workspace can have up to 10. After you add one, [test it](https://docs.nedzo.ai/api-reference/agents/mcp-servers/test.md) and [give it to a voice agent](https://docs.nedzo.ai/api-reference/agents/mcp-servers/set-for-agent.md). Returns `201`.

## Body

**workspaceId** `string` *required*

The workspace. Required.

**name** `string` *required*

The server's name, up to 255 characters. Each name is used once per workspace.

**url** `string` *required*

The server URL, up to 2,048 characters. It must be a public `https` address. Each URL is used once per workspace.

**authType** `string`

`bearer` or `api_key`.

**authValue** `string`

The secret for `authType`, up to 4,096 characters. Required when you send `authType`.

**headers** `object`

Extra headers to send. Up to 10 headers, each value up to 1,024 characters. You can't set `Host`, `Content-Length`, `Transfer-Encoding`, `Connection`, `Authorization` or `Content-Type`. Use `authType` and `authValue` for auth.

> [!WARNING]
>
> `authValue` and header values are write only. We never send them back. A response shows `hasAuth` and the header names.

```bash cURL theme={null}
curl -X POST "https://api.nedzo.ai/v1/mcp-servers" \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "workspaceId": "789e4567-e89b-12d3-a456-426614174000",
      "name": "Inventory",
      "url": "https://mcp.example.com/mcp",
      "authType": "bearer",
      "authValue": "YOUR_SERVER_TOKEN"
    }'
```

```json 201 theme={null}
{
  "id": "9b2f6c1a-3e4d-4a5b-8c7d-0e1f2a3b4c5d",
  "workspaceId": "789e4567-e89b-12d3-a456-426614174000",
  "name": "Inventory",
  "url": "https://mcp.example.com/mcp",
  "authType": "bearer",
  "hasAuth": true,
  "headerNames": [],
  "toolCount": 0,
  "lastConnectedAt": null,
  "createdAt": "2026-10-11T09:00:00Z",
  "updatedAt": "2026-10-11T09:00:00Z"
}
```

## Errors

| Status | When |
| - | - |
| `400` | A field is wrong, the URL is not a public `https` address, or the workspace already has 10 servers. |
| `400` | `authType` is sent without `authValue`. The `detail` is `Invalid request body`, and the `errors` entry for `authValue` has the message `authValue is required when authType is set`. |
| `400` | More than 10 headers, or a header you can't set. The `detail` is `Invalid request body`, and the `errors` entry for `headers` has the message `Maximum 10 custom headers allowed` or `Blocked header name detected`. |
| `400` | `An MCP server with this name already exists in your workspace`, or the same with `URL`. |
| `400` | `workspaceId is required`: `workspaceId` is missing. |
| `404` | The workspace is not in your API key's scope. |


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.