Ana içeriğe geç

Connect Mcp

POST 

/v1/agents/:agent_id/mcp/connect

Test connection to an MCP server and discover available tools.

This endpoint:

  1. Validates the MCP server endpoint
  2. Establishes a test connection
  3. Fetches the list of available tools
  4. Returns connection status and tools

Note: This does NOT save the configuration. Use PATCH /agents/{id} with mcp_config to persist the configuration.

Example Request:

{
"endpoint": "https://my-mcp-server.com/sse",
"transport_type": "sse",
"auth_header": "Bearer xxx"
}

Example Response:

{
"connected": true,
"status": "connected",
"latency_ms": 42,
"tools": [
{
"name": "weather_lookup",
"description": "Get current weather",
"inputSchema": {"type": "object", "properties": {...}}
}
]
}

Request

Responses

Successful Response