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

# 验证 MCP 服务器

> 验证 MCP 服务器连接并获取工具和提示词列表

测试 MCP 服务器连接是否可用，返回该服务器提供的工具列表和 Prompts 列表。用于前端添加 MCP 工具前的连接验证。

<ParamField header="Authorization" type="string" required>
  Bearer JWT Token
</ParamField>

<ParamField body="name" type="string" required>
  MCP 服务器名称（唯一标识）
</ParamField>

<ParamField body="base_url" type="string" required>
  MCP 服务器 URL
</ParamField>

<ParamField body="transport_type" type="string" default="streamable_http">
  传输类型（`streamable_http` | `sse` | `stdio`）
</ParamField>

<ParamField body="api_key" type="string">
  API 密钥（可选，自动添加为 `Authorization: Bearer` header）
</ParamField>

<ParamField body="headers" type="object">
  自定义 HTTP headers（可选）
</ParamField>

<ResponseField name="success" type="boolean">
  连接是否成功
</ResponseField>

<ResponseField name="status" type="string">
  连接状态：`connected`
</ResponseField>

<ResponseField name="tools" type="array">
  工具列表

  <Expandable title="tool">
    <ResponseField name="name" type="string">
      工具名称
    </ResponseField>

    <ResponseField name="description" type="string">
      工具描述
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="tool_count" type="number">
  工具数量
</ResponseField>

<ResponseField name="prompts" type="array">
  Prompts 列表

  <Expandable title="prompt">
    <ResponseField name="name" type="string">
      Prompt 名称
    </ResponseField>

    <ResponseField name="description" type="string">
      Prompt 描述
    </ResponseField>

    <ResponseField name="arguments" type="array">
      Prompt 参数列表
    </ResponseField>
  </Expandable>
</ResponseField>

<ResponseField name="prompt_count" type="number">
  Prompt 数量
</ResponseField>

<RequestExample>
  ```bash cURL theme={null}
  curl --request POST \
    --url https://zeus-api.agentspro.cn/api/tools/mcp/validate \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "name": "tavily",
      "base_url": "https://mcp.tavily.com/mcp",
      "transport_type": "streamable_http",
      "api_key": "tvly-..."
    }'
  ```
</RequestExample>

<ResponseExample>
  ```json 200 theme={null}
  {
    "success": true,
    "status": "connected",
    "tools": [
      { "name": "tavily_search", "description": "Search the web using Tavily" },
      { "name": "tavily_extract", "description": "Extract content from a URL" }
    ],
    "tool_count": 2,
    "prompts": [],
    "prompt_count": 0
  }
  ```

  ```json 408 theme={null}
  {
    "detail": "Connection timeout: Unable to connect to https://mcp.example.com"
  }
  ```
</ResponseExample>
