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
}
{
"detail": "Connection timeout: Unable to connect to https://mcp.example.com"
}
Tools API
验证 MCP 服务器
验证 MCP 服务器连接并获取工具和提示词列表
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
}
{
"detail": "Connection timeout: Unable to connect to https://mcp.example.com"
}
测试 MCP 服务器连接是否可用,返回该服务器提供的工具列表和 Prompts 列表。用于前端添加 MCP 工具前的连接验证。
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
}
{
"detail": "Connection timeout: Unable to connect to https://mcp.example.com"
}