Create MCP Server
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.
Usage
import { v0 } from 'v0-sdk'const result = await v0.mcpServers.create({ name: 'My MCP Server', url: 'https://mcp.example.com/sse',})console.log(result)OAuth MCP servers are created disconnected. After creating the server, call Create MCP Server OAuth Authorization URL and redirect the user to the returned provider URL.
API Signature
Request
Body
A human-readable name for the MCP server. Must be between 1 and 100 characters.
The URL of the MCP server endpoint. Must be a valid URL and use HTTPS in production. Maximum 500 characters.
An optional description for the MCP server. Maximum 500 characters.
Whether the MCP server should be enabled. Defaults to true.
Authentication configuration for the MCP server. Defaults to no authentication.
The authentication method. Use 'oauth' for OAuth MCP servers, 'bearer' for token-based auth, or 'custom-headers' for key-value header pairs.
The bearer token. Required when type is 'bearer'. Maximum 1000 characters.
Key-value pairs of custom headers. Required when type is 'custom-headers'. Maximum 10 headers.
OAuth configuration. Required when type is 'oauth'. Tokens are not accepted by this API.
The OAuth authorization endpoint URL.
The OAuth token endpoint URL.
The optional dynamic client registration endpoint URL.
The OAuth client ID.
The optional OAuth client secret. This value is stored securely and is never returned by the API.
OAuth scopes to request during authorization. Defaults to an empty array.
Whether to use PKCE for the authorization code flow. Defaults to true.
Optional issuer identifier for mix-up protection.
Optional RFC 8707 resource indicator. For MCP servers, this is usually the MCP server URL.
Whether the authorization server supports Client ID Metadata Documents.
Whether the server is scoped to the user or a team. Defaults to 'user'.
Response
A unique identifier for the MCP server.
Fixed value identifying this object as an MCP server.
The name of the MCP server.
The URL of the MCP server endpoint.
The description of the MCP server.
Whether the MCP server is currently enabled.
The authentication configuration. Only the type is returned; sensitive values are redacted.
The authentication method used by the server.
Whether the server is scoped to the user or a team.
The ISO 8601 timestamp when the server was created.
The ISO 8601 timestamp when the server was last updated.
Find MCP Servers
Retrieves a list of MCP servers configured for your account. Returns all servers with their connection details, authentication type, and enabled status.
Create MCP Server OAuth Authorization URL
Creates an OAuth authorization URL for an OAuth MCP server. Redirect the user to the returned URL to complete authorization without visiting v0.app.