跳转到主要内容
POST
/
api
/
tools
/
mcp
/
validate
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-..."
  }'
{
  "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
}
测试 MCP 服务器连接是否可用,返回该服务器提供的工具列表和 Prompts 列表。用于前端添加 MCP 工具前的连接验证。
Authorization
string
必填
Bearer JWT Token
name
string
必填
MCP 服务器名称(唯一标识)
base_url
string
必填
MCP 服务器 URL
transport_type
string
默认值:"streamable_http"
传输类型(streamable_http | sse | stdio
api_key
string
API 密钥(可选,自动添加为 Authorization: Bearer header)
headers
object
自定义 HTTP headers(可选)
success
boolean
连接是否成功
status
string
连接状态:connected
tools
array
工具列表
tool_count
number
工具数量
prompts
array
Prompts 列表
prompt_count
number
Prompt 数量
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-..."
  }'
{
  "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
}