MCP server connection¶
The MCP connection type configures access to MCP (Model Context Protocol) servers. Three transport types are supported: Streamable HTTP, SSE, and stdio.
Default Connection IDs¶
The MCPHook uses mcp_default by default.
Configuring the Connection¶
- Transport (Extra field)
The transport type:
http(default),sse, orstdio.http: Streamable HTTP, the recommended transport for remote servers.sse: Server-Sent Events, deprecated in favor of Streamable HTTP.stdio: Run the MCP server as a subprocess communicating over stdin/stdout.
- Host
The server URL. Required for
httpandssetransports.Examples:
http://localhost:3001/mcp,https://mcp.example.com/v1- Auth Token (Password field)
Optional authentication token for the MCP server. Sent as a static
Authorization: Bearer <token>header on HTTP/SSE transports. For short-lived or minted tokens, pass atoken_providertoMCPToolsetinstead (see MCP servers: MCPToolset).- Command (Extra field)
The command to run for
stdiotransport. Required when transport isstdio.Examples:
uvx,python,node- Arguments (Extra field)
JSON array of arguments for the stdio command.
Examples:
["mcp-run-python"],["-m", "my_mcp_server"]- Environment (Extra field)
JSON object of environment variables for the
stdiosubprocess. Ignored forhttp/sse. For a secret that lives in a different connection or is minted fresh per call, pass anenv_providertoMCPToolsetinstead of storing it here (see MCP servers: MCPToolset).Examples:
{"MY_SERVER_MODE": "readonly"}- Timeout (Extra field)
Connection init timeout in seconds for the
stdiotransport. Ignored forhttp/sse. Default:10.Examples:
30
Examples¶
HTTP transport (remote MCP server)
{
"conn_type": "mcp",
"host": "http://localhost:3001/mcp"
}
SSE transport
{
"conn_type": "mcp",
"host": "http://localhost:3001/sse",
"extra": "{\"transport\": \"sse\"}"
}
Stdio transport (subprocess)
{
"conn_type": "mcp",
"extra": "{\"transport\": \"stdio\", \"command\": \"uvx\", \"args\": [\"mcp-run-python\"]}"
}
Stdio with custom timeout
{
"conn_type": "mcp",
"extra": "{\"transport\": \"stdio\", \"command\": \"python\", \"args\": [\"-m\", \"my_server\"], \"timeout\": 30}"
}
Stdio with subprocess environment variables
{
"conn_type": "mcp",
"extra": "{\"transport\": \"stdio\", \"command\": \"my-mcp-server\", \"args\": [], \"env\": {\"SERVER_MODE\": \"readonly\"}}"
}