Skip to main content
MCP server CX Codex

pbx-mcp — Claude Code MCP server: Asterisk and FreeSWITCH

Lets an AI assistant query a live Asterisk or FreeSWITCH PBX: active channels, endpoints, dialplan and trunk registration.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add --env ASTERISK_AMI_HOST=<ASTERISK_AMI_HOST> --env ASTERISK_AMI_PORT=<ASTERISK_AMI_PORT> --env ASTERISK_AMI_USERNAME=<ASTERISK_AMI_USERNAME> --env ASTERISK_AMI_PASSWORD=<ASTERISK_AMI_PASSWORD> --env ASTERISK_AMI_TLS=<ASTERISK_AMI_TLS> --transport stdio pbx-mcp -- npx -y pbx-mcp
Open on GitHub

What pbx-mcp does

pbx-mcp gives your assistant one tool surface instead of two command vocabularies. Asterisk talks AMI, FreeSWITCH talks ESL, and running both used to mean constant switching. Now you can ask which extensions are offline and the model picks the right call on the switch itself.

Twelve tools ship in read-only mode, six per engine. The four call-control tools — asterisk_originate, asterisk_hangup, freeswitch_originate and freeswitch_hangup — stay out of sight until PBX_MCP_ALLOW_WRITE=true is set. Asterisk provisioning is a separate opt-in: six trunk and extension tools appear under PBX_MCP_ALLOW_PROVISION, and trunk creation is refused while PBX_MCP_TRUNK_ALLOW is empty.

Configuration lives in environment variables. Fill in the Asterisk block, the FreeSWITCH block, or both, and the server registers tools only for what you configured. Node 18 or newer is required, and a prebuilt Docker image is available. On the AMI side, a user with read = system,call,command and write = command is enough; add originate only when you plan to enable write mode.

What it helps with

  • see which channels are live and who is calling
  • find out why a SIP trunk will not register
  • dump a dialplan context or a single extension
  • check PJSIP endpoint state and contact count
  • run an arbitrary Asterisk CLI command

Example prompts for the agent

  • List every active channel on Asterisk with caller ID and duration
  • Why is my SIP trunk not registering? Check the gateway status
  • Dump the dialplan for context from-internal

How to install pbx-mcp

Platform CLI

claude mcp add --env ASTERISK_AMI_HOST=<ASTERISK_AMI_HOST> --env ASTERISK_AMI_PORT=<ASTERISK_AMI_PORT> --env ASTERISK_AMI_USERNAME=<ASTERISK_AMI_USERNAME> --env ASTERISK_AMI_PASSWORD=<ASTERISK_AMI_PASSWORD> --env ASTERISK_AMI_TLS=<ASTERISK_AMI_TLS> --transport stdio pbx-mcp -- npx -y pbx-mcp

Replace <…> with your own values. 5 more environment variables are in the server README

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about pbx-mcp

How do I install pbx-mcp in Claude Code?

Run claude mcp add pbx-mcp -e ASTERISK_AMI_PASSWORD=<ASTERISK_AMI_PASSWORD> -e FREESWITCH_ESL_PASSWORD=<FREESWITCH_ESL_PASSWORD> -- npx -y pbx-mcp, replacing the placeholders with your own credentials.

What does pbx-mcp do?

It exposes read tools for Asterisk over AMI and FreeSWITCH over ESL: channels, endpoints, dialplan and status. Call control is unlocked by a separate flag.

What AMI permissions does it need?

At minimum read = system,call,command and write = command. The originate permission matters only if you turn on write mode with PBX_MCP_ALLOW_WRITE.

Similar MCP servers

All MCP servers for DevOps and infrastructure →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor