
Telnyx
STDIO语音和短信API集成服务器
语音和短信API集成服务器
Official Telnyx Local Model Context Protocol (MCP) Server that enables interaction with powerful telephony, messaging, and AI assistant APIs. This server allows MCP clients like Claude Desktop, Cursor, Windsurf, OpenAI Agents and others to manage phone numbers, send messages, make calls, and create AI assistants.
uvx
(Python package manager), install with curl -LsSf https://astral.sh/uv/install.sh | sh
, brew install uv
or see the uv
repo for additional install methods.{ "mcpServers": { "Telnyx": { "command": "uvx", "args": ["--from", "git+https://github.com/team-telnyx/telnyx-mcp-server.git", "telnyx-mcp-server"], "env": { "TELNYX_API_KEY": "<insert-your-api-key-here>" } } } }
If you're using Windows, you will have to enable "Developer Mode" in Claude Desktop to use the MCP server. Click "Help" in the hamburger menu at the top left and select "Enable Developer Mode".
Get your API key from the Telnyx Portal.
Install uvx
(Python package manager), install with curl -LsSf https://astral.sh/uv/install.sh | sh
, brew install uv
or see the uv
repo for additional install methods.
Clone the Git Repository
Use Git to download the Telnyx MCP Server locally:
git clone https://github.com/team-telnyx/telnyx-mcp-server.git cd telnyx-mcp-server
Configure and Run with uvx
In your Claude config, you can reference the local folder by using the --from
argument. For example:
{ "mcpServers": { "Telnyx": { "command": "uvx", "args": ["--from", "/path/to/telnyx-mcp-server", "telnyx-mcp-server"], "env": { "TELNYX_API_KEY": "<insert-your-api-key-here>" } } } }
This instructs Claude to run the server from the folder you cloned. Replace “/path/to/telnyx-mcp-server” with the actual location of the repository.
resource://sms/conversations
)You can selectively enable or disable specific tools when running the MCP server. This is useful when you only need a subset of the available functionality.
To see all available tools:
uvx --from /path/to/telnyx-mcp-server telnyx-mcp-server --list-tools
You can enable only specific tools using either:
Command-line argument:
uvx --from /path/to/telnyx-mcp-server telnyx-mcp-server --tools "send_message,get_message,list_phone_numbers"
Environment variable:
{ "mcpServers": { "Telnyx": { "command": "uvx", "args": ["--from", "/path/to/telnyx-mcp-server", "telnyx-mcp-server"], "env": { "TELNYX_API_KEY": "<insert-your-api-key-here>", "TELNYX_MCP_TOOLS": "send_message,get_message,list_phone_numbers" } } } }
You can exclude specific tools while enabling all others:
Command-line argument:
uvx --from /path/to/telnyx-mcp-server telnyx-mcp-server --exclude-tools "make_call,send_dtmf"
Environment variable:
{ "mcpServers": { "Telnyx": { "command": "uvx", "args": ["--from", "/path/to/telnyx-mcp-server", "telnyx-mcp-server"], "env": { "TELNYX_API_KEY": "<insert-your-api-key-here>", "TELNYX_MCP_EXCLUDE_TOOLS": "make_call,send_dtmf" } } } }
Try asking Claude:
The MCP server includes a webhook receiver that can handle Telnyx webhooks directly through ngrok. This is useful for receiving call events and other notifications from Telnyx.
To enable the webhook receiver, you can either use the --webhook-enabled
command-line flag or set the WEBHOOK_ENABLED=true
environment variable. If an NGROK_AUTHTOKEN
is also provided (see 'Ngrok Integration' below), the ngrok tunnel will be automatically attempted when the server starts. The command-line flag takes precedence if both are set.
Using Command-Line Flag:
telnyx-mcp-server --webhook-enabled --ngrok-enabled
Using Environment Variable:
Alternatively, set the WEBHOOK_ENABLED=true
environment variable. This is often convenient when configuring via MCP client settings (see 'Webhook Configuration in Claude Desktop' below) or in .env
files.
# Example for your shell export WEBHOOK_ENABLED=true export NGROK_AUTHTOKEN=your_ngrok_token # Also needed for ngrok telnyx-mcp-server
To enable ngrok tunneling:
NGROK_AUTHTOKEN
environment variable or use the --ngrok-authtoken
flag:# Using NGROK_AUTHTOKEN environment variable (recommended) export NGROK_AUTHTOKEN=your_ngrok_token telnyx-mcp-server --webhook-enabled # Or use WEBHOOK_ENABLED=true env var # Or using --ngrok-authtoken command line flag telnyx-mcp-server --webhook-enabled --ngrok-authtoken your_ngrok_token
If NGROK_AUTHTOKEN
is set, the --ngrok-enabled
flag is generally not required when webhooks are active.
When ngrok is enabled, the server will print the public URL that can be used to configure webhooks in the Telnyx Portal.
Important: If ngrok fails to initialize (e.g., due to an invalid authtoken, network issues, or conflicts with another ngrok process), the MCP server will exit on startup. Check the server logs for details (see Troubleshooting section).
The MCP server monitors the parent process (Claude Desktop) and automatically exits when the parent process is gone. This ensures proper cleanup of resources even if Claude Desktop closes unexpectedly.
resource://webhook/info
resource.get_webhook_events
tool.To enable webhooks in Claude Desktop, update your configuration:
{ "mcpServers": { "Telnyx": { "command": "uvx", "args": ["--from", "git+https://github.com/team-telnyx/telnyx-mcp-server.git", "telnyx-mcp-server"], "env": { "TELNYX_API_KEY": "<insert-your-api-key-here>", "NGROK_AUTHTOKEN": "<insert-your-ngrok-token-here>", "WEBHOOK_ENABLED": "true", // Enables webhooks via environment variable // Alternatively, you can use command-line flags in "args" instead of WEBHOOK_ENABLED in env: // e.g., "args": ["--from", "git+https://github.com/team-telnyx/telnyx-mcp-server.git", "telnyx-mcp-server", "--webhook-enabled"], } } } }
Telnyx now offers a remote MCP implementation based on the latest MCP specification. This allows you to access Telnyx's powerful communications APIs through a remotely hosted MCP server. No need to run the server locally. Learn more in the official documentation.
If you want to contribute or run from source:
git clone https://github.com/team-telnyx/telnyx-mcp-server.git cd telnyx-mcp-server
uv venv source .venv/bin/activate uv pip install -e ".[dev]" # Includes development dependencies like ruff
.env
file and add your Telnyx API key:echo "TELNYX_API_KEY=YOUR_API_KEY" > .env
pytest
mcp install src/telnyx_mcp_server/server.py
mcp dev src/telnyx_mcp_server/server.py
This project uses Ruff for linting and formatting Python code. Ruff is a fast Python linter and formatter written in Rust, designed to replace multiple Python code quality tools with a single, unified tool.
Ruff is included in the development dependencies. Install it with:
uv pip install -e ".[dev]"
To check your code for issues:
ruff check .
To automatically fix issues where possible:
ruff check --fix .
To format your code:
ruff format .
For the best development experience, run these commands before committing changes:
# Format code ruff format . # Fix linting issues ruff check --fix . # Run tests pytest
Ruff is configured in the pyproject.toml
file. The configuration includes:
See the [tool.ruff]
section in pyproject.toml
for the complete configuration.
Logs when running with Claude Desktop can be found at:
%APPDATA%\Claude\logs\mcp-server-telnyx.log
~/Library/Logs/Claude/mcp-server-telnyx.log
If you encounter the error "MCP Telnyx: spawn uvx ENOENT", confirm its absolute path by running this command in your terminal:
which uvx
Once you obtain the absolute path (e.g., /usr/local/bin/uvx
), update your configuration to use that path (e.g., "command": "/usr/local/bin/uvx"
). This ensures that the correct executable is referenced.
If the MCP server fails to start, particularly if you have webhooks enabled, it might be due to an issue with ngrok initialization. One common cause is an existing ngrok process running in the background, potentially from a previous server instance that didn't shut down cleanly.
ps aux | grep telnyx-mcp-server
(Linux/macOS) or check Task Manager (Windows) for any lingering telnyx-mcp-server
processes. Since ngrok is managed internally by the server, you typically won't see a separate 'ngrok' process.