MCP
Test MCP Connection
Validate an MCP server configuration and list its tools, without assigning it to an agent
POST
Performs the same validation as the Test Connection button in the dashboard’s MCP Servers section: it opens the transport, runs the MCP initialize handshake, and lists the server’s tools. Nothing is created or stored — use it to verify a configuration before assigning it to an agent.
A failed connection is a normal result, not an error: the response is
200 with success: false and a message. Only a malformed request returns 400.Request Body
MCP server endpoint URL.Example:
https://mcp.example.com/sseTransport protocol.Supported values:
sse— Server-Sent Eventshttp— Streamable HTTP
Authentication headers. Accepts either an object (
{ "Authorization": "Bearer ..." }) or an array of key/value pairs ([{ "key": "Authorization", "value": "Bearer ..." }]).Optional MCP initialization options. Accepted and stored for parity with the dashboard; not currently exercised during the handshake.
How It Works
- Validates the request body (
urlis required and must be a valid URL). - Opens the transport — SSE or Streamable HTTP — using any
auth_headersprovided. - Runs the MCP initialize handshake and calls
listTools. - Returns the connection status, tool count, and the tool list (
name+description).
To make a tested connection show as Connected on an agent, simply create or update the agent with the MCP server — the API automatically re-tests each MCP server on save. See Create Agent.
Troubleshooting
message | Cause | Solution |
|---|---|---|
Invalid URL | Malformed url | Provide a full URL including scheme (https://) |
Connection failed | Server unreachable or rejected the handshake | Verify the URL, transport type, and auth headers |
| Auth-related error from server | Missing/invalid credentials | Check auth_headers match what the MCP server expects |
