Connect Mcp
POST/v1/agents/:agent_id/mcp/connect
Test connection to an MCP server and discover available tools.
This endpoint:
- Validates the MCP server endpoint
- Establishes a test connection
- Fetches the list of available tools
- 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
- 200
- 422
Successful Response
Validation Error