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

# Create MCP Server

> Register a new MCP server for use with agents in your organization



## OpenAPI

````yaml openapi.json post /mcp-servers
openapi: 3.1.0
info:
  title: Ag.dev API
  description: Public API for Ag.dev
  version: 0.1.0
servers:
  - url: https://api.ag.dev/v0.1
security: []
tags:
  - name: Agents
    description: Agent management and configuration
  - name: Runs
    description: Agent run execution and monitoring
  - name: Versioning
    description: Agent versioning, revisions, and publishing
  - name: MCP Servers
    description: MCP server management and tool discovery
  - name: Settings
    description: Organization settings and API keys
  - name: Users
    description: User information and authentication
  - name: Drives
    description: Drive management and file operations
  - name: Webhooks
    description: Webhook health checks
paths:
  /mcp-servers:
    post:
      tags:
        - MCP Servers
      summary: Create MCP Server
      description: Register a new MCP server for use with agents in your organization
      requestBody:
        required: true
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/CreateMcpServerRequest'
      responses:
        '201':
          description: MCP server created successfully
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/McpServer'
        '400':
          description: Invalid request data
        '401':
          description: Authentication required
        '409':
          description: MCP server with this alias already exists
      security:
        - ApiKeyAuth: []
components:
  schemas:
    CreateMcpServerRequest:
      type: object
      properties:
        name:
          type: string
          description: Human-readable name for the MCP server
        url:
          type: string
          format: uri
          description: URL of the MCP server
        type:
          type: string
          enum:
            - sse
            - streamableHttp
          description: Type of MCP server connection
      required:
        - name
        - url
        - type
    McpServer:
      type: object
      properties:
        id:
          type: string
          description: MCP server ID
        organizationId:
          type: string
          description: Organization ID
        name:
          type: string
          description: Human-readable name for the MCP server
        url:
          type: string
          format: uri
          description: URL of the MCP server
        type:
          type: string
          enum:
            - sse
            - streamableHttp
          description: Type of MCP server connection
        createdAt:
          type: string
          format: date-time
          description: Creation timestamp
        updatedAt:
          type: string
          format: date-time
          description: Last update timestamp
      required:
        - id
        - organizationId
        - name
        - url
        - type
        - createdAt
        - updatedAt
  securitySchemes:
    ApiKeyAuth:
      type: apiKey
      in: header
      name: X-API-Key
      description: 'Provide either X-API-Key: <key> or Authorization: Bearer <key>'

````