Test Mcp Server Connectivity

Test Mcp Server Connectivity
Test if the system is able to connect to an MCP server given a configuration.

This endpoint allows you to test if the provided URL and custom headers for an MCP server are valid.

More specifically, the API will attempt to list tools of an MCP server using the provided configuration. This allows you to verify whether the URL and custom headers are correct even before creating the MCP server configuration.

To test the configuration of an existing MCP server, you can instead use the /test-connection/<mcp-server> endpoint.

Request
URI
POST
https://{api_host}/api/v1/control/mcp-servers/test-connection
COPY
Request Body
McpServerTestConnectionRequest of type(s) application/json
Required  

Show optional properties

{
    "url": "string",
    "transport": "string"
}
{
    "verify_tls": "string",
    "url": "string",
    "transport": "string",
    "headers": {
        "headers": "string"
    }
}
string
verify_tls
Optional
Constraints: default: VERIFY_FULL

TLS verification mode used when connecting to the MCP server.

Enumeration: VERIFY_FULL, DISABLE
string As uri As uri
url
Required  
Constraints: minLength: 1

Base URL to access the MCP server.

string
transport
Required  

MCP server communication transport protocol

Enumeration: STREAMABLE_HTTP, SSE
object
headers
Optional

A list of HTTP headers for the MCP server.

Authentication
This operation uses the following authentication methods.
Responses
200

Outcome of validating the connectivity.

Returns McpServerTestConnectionResponse of type(s) application/json
{
    "status": "string",
    "detail": "string"
}
string
status
Required  

MCP server connectivity result.

Enumeration: CONNECTIVITY_RESULT_SUCCESS, CONNECTIVITY_RESULT_CONNECTION_FAILED
string
detail
Optional

Details about the connectivity result, if any.


422

Validation Error

Returns HTTPValidationError of type(s) application/json
{
    "detail": [
        {
            "loc": [
                {}
            ],
            "msg": "string",
            "type": "string",
            "ctx": {}
        }
    ]
}
array of object
detail
Optional

detail


Code Samples
COPY
                    curl -X POST -H 'Authorization: <value>' -H 'Content-Type: application/json' -d '{"url":"string","transport":"string"}' https://{api_host}/api/v1/control/mcp-servers/test-connection