---
title: Create MCP Server
description: Registers a new MCP server with your account. Supports OAuth, bearer token, custom headers, or no authentication. The server URL must use HTTPS in production.
docs_index: /docs/llms.txt
lastUpdated: 2026-10-07
product: v0 API
type: reference
prerequisites:
  - /docs/api/v1/quickstart
related:
  - /docs/api/v1/guides/oauth-mcp-servers
  - /docs/api/v1/reference/mcp-servers/create-oauth-authorization-url
---

> For an index of all documentation, see [/docs/llms.txt](/docs/llms.txt).

#### `POST/v1/mcp-servers`

## Usage

```typescript
import { v0 } from 'v0-sdk'

const result = await v0.mcpServers.create({
  name: 'My MCP Server',
  url: 'https://mcp.example.com/sse',
})

console.log(result)
```

```bash
curl -X POST https://api.v0.dev/v1/mcp-servers   -H "Authorization: Bearer $V0_API_KEY"   -H "Content-Type: application/json"   -d '{
    "name": "My MCP Server",
    "url": "https://mcp.example.com/sse"
  }'
```

```typescript
import { v0 } from 'v0-sdk'

const result = await v0.mcpServers.create({
  name: 'Authenticated MCP Server',
  url: 'https://mcp.example.com/sse',
  description: 'Server with bearer token auth',
  auth: {
    type: 'bearer',
    token: 'your-secret-token',
  },
})

console.log(result)
```

```bash
curl -X POST https://api.v0.dev/v1/mcp-servers   -H "Authorization: Bearer $V0_API_KEY"   -H "Content-Type: application/json"   -d '{
    "name": "Authenticated MCP Server",
    "url": "https://mcp.example.com/sse",
    "description": "Server with bearer token auth",
    "auth": {
      "type": "bearer",
      "token": "your-secret-token"
    }
  }'
```

```typescript
import { v0 } from 'v0-sdk'

const result = await v0.mcpServers.create({
  name: 'Custom Auth MCP Server',
  url: 'https://mcp.example.com/sse',
  auth: {
    type: 'custom-headers',
    headers: {
      'X-API-Key': 'your-api-key',
      'X-Org-Id': 'org_123',
    },
  },
})

console.log(result)
```

```bash
curl -X POST https://api.v0.dev/v1/mcp-servers   -H "Authorization: Bearer $V0_API_KEY"   -H "Content-Type: application/json"   -d '{
    "name": "Custom Auth MCP Server",
    "url": "https://mcp.example.com/sse",
    "auth": {
      "type": "custom-headers",
      "headers": {
        "X-API-Key": "your-api-key",
        "X-Org-Id": "org_123"
      }
    }
  }'
```

```typescript
import { v0 } from 'v0-sdk'

const result = await v0.mcpServers.create({
  name: 'OAuth MCP Server',
  url: 'https://mcp.example.com/mcp',
  description: 'Server with OAuth authentication',
  auth: {
    type: 'oauth',
    config: {
      authorizationUrl: 'https://auth.example.com/oauth/authorize',
      tokenUrl: 'https://auth.example.com/oauth/token',
      clientId: 'your-client-id',
      scopes: ['read'],
      usePKCE: true,
      resource: 'https://mcp.example.com/mcp',
    },
  },
})

console.log(result)
```

```bash
curl -X POST https://api.v0.dev/v1/mcp-servers   -H "Authorization: Bearer $V0_API_KEY"   -H "Content-Type: application/json"   -d '{
    "name": "OAuth MCP Server",
    "url": "https://mcp.example.com/mcp",
    "description": "Server with OAuth authentication",
    "auth": {
      "type": "oauth",
      "config": {
        "authorizationUrl": "https://auth.example.com/oauth/authorize",
        "tokenUrl": "https://auth.example.com/oauth/token",
        "clientId": "your-client-id",
        "scopes": ["read"],
        "usePKCE": true,
        "resource": "https://mcp.example.com/mcp"
      }
    }
  }'
```

OAuth MCP servers are created disconnected. After creating the server, call [Create MCP Server OAuth Authorization URL](/docs/api/v1/reference/mcp-servers/create-oauth-authorization-url) and redirect the user to the returned provider URL.

## API Signature

### Request

#### Body

- `name: string` A human-readable name for the MCP server. Must be between 1 and 100 characters.
- `url: string` The URL of the MCP server endpoint. Must be a valid URL and use HTTPS in production. Maximum 500 characters.
- `description?: string` An optional description for the MCP server. Maximum 500 characters.
- `enabled?: boolean` Whether the MCP server should be enabled. Defaults to true.
- `auth?: object` Authentication configuration for the MCP server. Defaults to no authentication.
  - `type: 'none' | 'bearer' | 'custom-headers' | 'oauth'` The authentication method. Use 'oauth' for OAuth MCP servers, 'bearer' for token-based auth, or 'custom-headers' for key-value header pairs.
  - `token?: string` The bearer token. Required when type is 'bearer'. Maximum 1000 characters.
  - `headers?: Record<string, string>` Key-value pairs of custom headers. Required when type is 'custom-headers'. Maximum 10 headers.
  - `config?: object` OAuth configuration. Required when type is 'oauth'. Tokens are not accepted by this API.
    - `authorizationUrl: string` The OAuth authorization endpoint URL.
    - `tokenUrl: string` The OAuth token endpoint URL.
    - `registrationUrl?: string` The optional dynamic client registration endpoint URL.
    - `clientId: string` The OAuth client ID.
    - `clientSecret?: string` The optional OAuth client secret. This value is stored securely and is never returned by the API.
    - `scopes?: string[]` OAuth scopes to request during authorization. Defaults to an empty array.
    - `usePKCE?: boolean` Whether to use PKCE for the authorization code flow. Defaults to true.
    - `issuer?: string` Optional issuer identifier for mix-up protection.
    - `resource?: string` Optional RFC 8707 resource indicator. For MCP servers, this is usually the MCP server URL.
    - `clientIdMetadataDocumentSupported?: boolean` Whether the authorization server supports Client ID Metadata Documents.
- `scope?: 'user' | 'team'` Whether the server is scoped to the user or a team. Defaults to 'user'.

### Response

- `id: string` A unique identifier for the MCP server.
- `object: 'mcp_server'` Fixed value identifying this object as an MCP server.
- `name: string` The name of the MCP server.
- `url: string` The URL of the MCP server endpoint.
- `description?: string` The description of the MCP server.
- `enabled: boolean` Whether the MCP server is currently enabled.
- `auth: object` The authentication configuration. Only the type is returned; sensitive values are redacted.
  - `type: 'none' | 'bearer' | 'custom-headers' | 'oauth'` The authentication method used by the server.
- `scope: 'user' | 'team'` Whether the server is scoped to the user or a team.
- `createdAt: string` The ISO 8601 timestamp when the server was created.
- `updatedAt?: string` The ISO 8601 timestamp when the server was last updated.

---

For a semantic overview of all documentation, see [/docs/sitemap.md](/docs/sitemap.md)

For an index of all available documentation, see [/docs/llms.txt](/docs/llms.txt)

For agent-facing discovery, including API and MCP surfaces, see [/docs/agents.md](/docs/agents.md)