Inspect and control Asterisk (AMI) and FreeSWITCH (ESL) PBX servers from your AI assistant.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent β or use 1-click editor setup below.
We haven't yet run this listing's install command through our automated sandbox check. This isn't a red flag β we're steadily working through the catalog.
π‘ Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
An MCP server that lets an AI assistant inspect and control Asterisk and FreeSWITCH.
Ask "which extensions are offline right now?" or "why is my SIP trunk not registering?" and get a real answer from the live switch, not a guess.
Developed by Tahir Almas at ICT Innovations, the team behind ICTCore, ICTContact, ICTDialer, ICTFax and ICTPBX. The AMI and ESL clients in this repo are the same protocol groundwork those products run on.
Debugging a PBX means memorising two very different command sets. Asterisk speaks AMI and a CLI with hundreds of verbs. FreeSWITCH speaks ESL with its own vocabulary. If you run both, you're context switching all day.
pbx-mcp puts a single, well described tool surface in front of both, so your assistant can go from "calls are failing" to sofia status gateway without you spelling out each step.
New here? The user guide walks through PBX setup, client config, worked examples and troubleshooting. This README is the quick reference.
Twelve read-only tools, six per engine, each one described well enough that the model picks the right one without being told. This is the server running under the MCP Inspector:

The four write tools, asterisk_originate, asterisk_hangup, freeswitch_originate and freeswitch_hangup, stay hidden until you set PBX_MCP_ALLOW_WRITE=true.
Or run it straight from npx, which is what most MCP client configs do:
You need Node 18 or newer.
There's a prebuilt image if you'd rather not put Node on the machine that talks to your PBX.
The same image is on Docker Hub as ictinnovations/pbx-mcp if that registry is an easier pull for you.
Three things to know:
-i is not optional. The server speaks MCP over stdio, so without stdin attached the container starts and then sits there saying nothing, which looks exactly like a broken server.host.docker.internal on Mac and Windows, or add --network host on Linux.The image runs as a non-root user and, like every other way of running this, starts read only.
Everything comes from environment variables. Set the Asterisk block, the FreeSWITCH block, or both. The server only registers tools for what you've actually configured, so an Asterisk-only shop never sees a FreeSWITCH tool.
| Variable | Default | Notes |
|---|---|---|
ASTERISK_AMI_HOST | (required to enable) | Hostname or IP of the Asterisk box |
ASTERISK_AMI_PORT | 5038 | AMI port from manager.conf |
ASTERISK_AMI_USERNAME | AMI user | |
ASTERISK_AMI_PASSWORD | AMI secret | |
ASTERISK_AMI_TLS | false | Set true if tlsenable=yes |
Your manager.conf user needs at least read = system,call,command and write = command. Add originate only if you plan to turn on write mode.
| Variable | Default | Notes |
|---|---|---|
FREESWITCH_ESL_HOST | (required to enable) | Hostname or IP of the switch |
FREESWITCH_ESL_PORT | 8021 | Inbound ESL port |
FREESWITCH_ESL_PASSWORD | ClueCon | From event_socket.conf.xml |
| Variable | Default | Notes |
|---|---|---|
PBX_MCP_ALLOW_WRITE | false | Unlocks call control. Read the safety section first |
PBX_MCP_TIMEOUT_MS | 10000 | Per command timeout |
Add this to claude_desktop_config.json:
The same shape works for any MCP client that speaks stdio. There's a copy in examples/claude_desktop_config.json.
To run the container instead of npx, keep the env block and point command at Docker:
Each -e NAME with no value forwards that variable from env into the container, which keeps the secrets out of the argument list.
| Tool | What it does |
|---|---|
asterisk_status | Version, uptime, active calls and calls processed |
asterisk_channels | Every live channel with caller ID, state, bridge, duration and dialplan position. Optional substring filter |
asterisk_endpoints | PJSIP endpoints with device state and contact count. Falls back to chan_sip peers on older installs |
asterisk_dialplan | Dumps a context, or one extension inside a context |
asterisk_cli | Any CLI command, subject to the safety policy below |
asterisk_hangup_preview | Shows which live channels a hangup would drop, without dropping them |
asterisk_originate | Places a call. Write mode only |
asterisk_hangup | Kills a channel by name. Write mode only |
| Tool | What it does |
|---|---|
freeswitch_status | Version, uptime, current and maximum sessions |
freeswitch_channels | Every live call leg from show channels. Optional substring filter that keeps the header row |
freeswitch_registrations | Registered users on a Sofia profile, with contact URI, user agent and expiry |
freeswitch_sofia_status | Every SIP profile and gateway, including whether trunks are registered upstream |
freeswitch_api | Any API command, subject to the safety policy below |
freeswitch_hangup_preview | Shows which live legs a hangup would drop, without dropping them |
freeswitch_originate | Places a call. Write mode only |
freeswitch_hangup | uuid_kill on a channel UUID. Write mode only |
A PBX is not a scratch pad. Reloading a profile drops registrations, and an originate spends real money on a live trunk. So the default posture is read-only and the guards are layered:
Read-only by default. asterisk_cli accepts an allow list of inspection prefixes (core show, pjsip show, dialplan show, queue show and friends). freeswitch_api accepts the same kind of list (status, show, sofia status, db list and friends), matched on the start of the command so the subcommand counts.
The FreeSWITCH list allows subcommands, it does not deny scary words. sofia status reads, sofia profile internal restart isn't on the list, so it's refused. This used to work the other way around, scanning each word against a list of state changing verbs, and that only ever catches the words somebody thought of. conference 3001 kick all walked straight through it. Reported by Electrical-Place-458 on r/mcp.
Write tools aren't registered at all in read-only mode. asterisk_originate and the other three never appear in tools/list unless you set PBX_MCP_ALLOW_WRITE=true. A model can't call a tool it can't see.
The hangup preview tools are always available. asterisk_hangup_preview and freeswitch_hangup_preview show which live channels a hangup would drop without touching them, so you can see the blast radius before setting the write flag, or catch a typo in a channel name before running the real thing. They're read-only by contract but exercise the same matching the write path uses.
Shell metacharacters are rejected on both transports before a command is sent.
AMI header injection is blocked. Every field that lands in an AMI action is checked for carriage returns and newlines, so a caller ID string can't smuggle in an extra header.
Output is clamped to 20,000 characters. One show channels on a busy switch won't flood the context window.
Even with all that, give the AMI user the narrowest permission set that answers your questions, and put the PBX behind a firewall rather than on the public internet.
The AMI and ESL clients have no third party dependencies. Both protocols are just framed text over TCP, and hand rolling them keeps the install small and the behaviour predictable. The only runtime dependencies are the MCP SDK and Zod.
If you want to talk to a PBX from your own Node code and don't need MCP at all, the two clients underneath this server are published separately. Same protocol work, no MCP SDK, no Zod, nothing:
No reviews yet β be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/pbx-mcp)<a href="https://allmcps.com/mcp/pbx-mcp"><img src="https://allmcps.com/api/badge/pbx-mcp?style=directory" alt="Pbx MCP on AllMCPs" /></a>