> ## 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.

# Validate MCP Server

> Validates an MCP server configuration and checks server health before creation

## Request Body

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

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

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

<ParamField body="args" type="string">
  Command arguments for stdio transport
</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="connectionType" type="string" default="proxy">
  Connection type. Must be either `direct` or `proxy`
</ParamField>

<ParamField body="proxyUrl" type="string">
  Proxy URL if using proxy connection
</ParamField>

## Response

<ResponseField name="valid" type="boolean">
  Whether the server configuration is valid
</ResponseField>

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

<ResponseField name="status" type="string">
  Validation status: `ok`, `error`, or `timeout`
</ResponseField>

<ResponseField name="capabilities" type="object">
  Server capabilities if validation successful
</ResponseField>

<ResponseField name="serverInfo" type="object">
  Server implementation details
</ResponseField>

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

  ```javascript JavaScript theme={null}
  const response = await fetch('https://api.example.com/api/mcp/validate', {
    method: 'POST',
    headers: {
      'Authorization': 'Bearer YOUR_API_KEY',
      'Content-Type': 'application/json'
    },
    body: JSON.stringify({
      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/validate',
      headers={
          'Authorization': 'Bearer YOUR_API_KEY',
          'Content-Type': 'application/json'
      },
      json={
          'transportType': 'http',
          'url': 'https://mcp-server.example.com',
          'connectionType': 'proxy'
      }
  )

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

<ResponseExample>
  ```json Success Response theme={null}
  {
    "valid": true,
    "message": "Server validation successful",
    "status": "ok",
    "capabilities": {
      "tools": true,
      "resources": true,
      "prompts": true
    },
    "serverInfo": {
      "name": "Example MCP Server",
      "version": "1.0.0"
    }
  }
  ```

  ```json Error Response theme={null}
  {
    "valid": false,
    "message": "Connection timeout",
    "status": "timeout"
  }
  ```
</ResponseExample>
