Skip to main content
TurnCall supports the Model Context Protocol (MCP) for connecting agents to external tool servers. Tools are auto-discovered at call start via tools/list and registered alongside webhook and built-in tools.

Configuration

Add mcp_servers to your agent config:
{
  "mcp_servers": [
    {
      "name": "crm-tools",
      "transport": "http",
      "url": "https://mcp.example.com/mcp",
      "headers": {"Authorization": "Bearer ..."}
    },
    {
      "name": "local-db",
      "transport": "stdio",
      "command": "python",
      "args": ["mcp_server.py", "--stdio"]
    }
  ]
}

Transport Types

TransportConfigNotes
http (default)url + optional headersStreamable HTTP (recommended)
sseurl + optional headersServer-Sent Events
stdiocommand + args + envLocal subprocess

Server Config Fields

FieldRequiredDescription
nameYesUnique server name (lowercase, alphanumeric)
transportNohttp (default), sse, or stdio
urlFor http/sseMCP server URL
headersNoCustom headers (e.g. Authorization)
commandFor stdioExecutable command
argsNoCommand arguments (stdio)
envNoEnvironment variables (stdio)
timeout_secondsNoConnection timeout (default: 10)
tool_filterNoOnly expose these tools (null = all)

How It Works

1

Call starts

TurnCall connects to each configured MCP server.
2

Tool discovery

Calls tools/list on each server to discover available tools.
3

Registration

MCP tools are merged with webhook and built-in tools in the pipeline.
4

Execution

When the LLM calls an MCP tool, TurnCall routes it through the MCP client.
5

Cleanup

MCP sessions are cleaned up when the call ends.

stdio Transport

stdio transport requires MCP_STDIO_ENABLED=true and the command must be listed in MCP_STDIO_ALLOWED_COMMANDS.
{
  "name": "local-tools",
  "transport": "stdio",
  "command": "python",
  "args": ["mcp_server.py", "--stdio"],
  "env": {"DB_URL": "postgresql://..."}
}