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

# Create MCP Server

> Creates and registers a new MCP server configuration

## Request Body

<ParamField body="projectId" type="string" required>
  Project ID to associate the server with
</ParamField>

<ParamField body="name" type="string" required>
  Server name (minimum 1 character)
</ParamField>

<ParamField body="transportType" type="string" required>
  Transport protocol type. Must be one of: `stdio`, `http`, or `sse`
</ParamField>

<ParamField body="description" type="string">
  Server description
</ParamField>

<ParamField body="url" type="string">
  Server URL for HTTP/SSE transport
</ParamField>

<ParamField body="connectionType" type="string" default="proxy">
  Connection type: `direct` or `proxy`
</ParamField>

<ParamField body="command" type="string">
  Command to execute for stdio transport
</ParamField>

<ParamField body="args" type="string">
  Command arguments
</ParamField>

<ParamField body="env" type="object">
  Environment variables as key-value pairs
</ParamField>

<ParamField body="customHeaders" type="array">
  Custom HTTP headers

  <Expandable title="Header Object">
    <ParamField body="key" type="string">
      Header key
    </ParamField>

    <ParamField body="value" type="string">
      Header value
    </ParamField>
  </Expandable>
</ParamField>

<ParamField body="oauthClientId" type="string">
  OAuth client ID
</ParamField>

<ParamField body="oauthClientSecret" type="string">
  OAuth client secret
</ParamField>

<ParamField body="oauthScope" type="string">
  OAuth scope
</ParamField>

<ParamField body="proxyUrl" type="string">
  Proxy server URL
</ParamField>

<ParamField body="proxyAuthToken" type="string">
  Proxy authentication token
</ParamField>

<ParamField body="proxyAuthHeader" type="string" default="Authorization">
  Proxy authentication header name
</ParamField>

<ParamField body="requestTimeout" type="number">
  Request timeout in milliseconds
</ParamField>

<ParamField body="maxTotalTimeout" type="number">
  Maximum total timeout in milliseconds
</ParamField>

## Response

<ResponseField name="success" type="boolean">
  Whether the server was created successfully
</ResponseField>

<ResponseField name="message" type="string">
  Success message or error details
</ResponseField>

<ResponseField name="serverId" type="string">
  Unique identifier for the created server
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl -X POST https://api.example.com/api/mcp/servers \
    -H "Authorization: Bearer YOUR_API_KEY" \
    -H "Content-Type: application/json" \
    -d '{
      "projectId": "proj_123",
      "name": "My MCP Server",
      "description": "Production MCP server",
      "transportType": "http",
      "url": "https://mcp-server.example.com",
      "connectionType": "proxy"
    }'
  ```

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.example.com/api/mcp/servers', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      projectId: 'proj_123',
      name: 'My MCP Server',
      description: 'Production MCP server',
      transportType: 'http',
      url: 'https://mcp-server.example.com',
      connectionType: 'proxy'
    })
  });

  const data = await response.json();
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      'https://api.example.com/api/mcp/servers',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'projectId': 'proj_123',
          'name': 'My MCP Server',
          'description': 'Production MCP server',
          'transportType': 'http',
          'url': 'https://mcp-server.example.com',
          'connectionType': 'proxy'
      }
  )

  data = response.json()
  ```
</RequestExample>

<ResponseExample>
  ```json Success Response theme={null}
  {
    "success": true,
    "message": "MCP server created successfully",
    "serverId": "mcp_abc123"
  }
  ```

  ```json Validation Error theme={null}
  {
    "success": false,
    "message": "Invalid server configuration"
  }
  ```
</ResponseExample>
