Pbx MCP logo

Pbx MCP

Inspect and control Asterisk and FreeSWITCH through MCP tools for status, calls, registrations, dialplans, and guarded call actions.

Install Pbx MCP

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "pbx-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "pbx-mcp"
      ],
      "env": {
        "ASTERISK_AMI_HOST": "YOUR_VALUE_HERE",
        "ASTERISK_AMI_PORT": "YOUR_VALUE_HERE",
        "ASTERISK_AMI_USERNAME": "YOUR_VALUE_HERE",
        "ASTERISK_AMI_PASSWORD": "YOUR_VALUE_HERE",
        "ASTERISK_AMI_TLS": "YOUR_VALUE_HERE",
        "FREESWITCH_ESL_HOST": "YOUR_VALUE_HERE",
        "FREESWITCH_ESL_PORT": "YOUR_VALUE_HERE",
        "FREESWITCH_ESL_PASSWORD": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 12 tools correctly (3d ago).

Overview

The pbx-mcp MCP server connects AI assistants to Asterisk through AMI and FreeSWITCH through ESL. It exposes tools for inspecting switch health, channels, endpoints, registrations, SIP profiles, dialplans, and command output, with optional call origination and hangup actions. Read-only operation is the default, while write tools appear only when explicitly enabled. Use it when an agent needs live PBX diagnostics or controlled call management rather than static configuration advice.

Use cases

  • Inspect active calls and channel state
  • Check offline Asterisk endpoints
  • Diagnose FreeSWITCH gateway registration
  • Review an Asterisk dialplan context
  • Preview or perform controlled call hangups

Key features

  • Asterisk AMI connectivity
  • FreeSWITCH ESL connectivity
  • Live channel and endpoint inspection
  • SIP registration and gateway status
  • Read-only command safety controls
  • Optional originate and hangup actions

Tools12

What Pbx MCP lets your agent do. Expand a tool for its parameters.

Verified live~1.3k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked Today

Recent health check succeeded.

9/9 checks healthy over the last 46d

What it can do

From the 12 tools this server returned when we ran it; 12 declare their own safety hints.

Makes network requests · 12Read-only tools · 12
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceNot published
Package age77 days
Maintainers1

Observed 2026-10-25 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 2d ago via OSV.dev · pbx-mcp (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars19Stargazers on the source repository.
npm downloads612Package downloads in the last 30 days.
Last commit2d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed12Callable tools this server registers over MCP.

How Pbx MCP works

What pbx-mcp MCP server does

The pbx-mcp MCP server gives an MCP-compatible assistant a common tool interface for two telephony platforms: Asterisk and FreeSWITCH. It connects to Asterisk using the Asterisk Manager Interface (AMI) and to FreeSWITCH using the Event Socket Layer (ESL). Configure either platform independently, or configure both in the same process.

For Asterisk, the available operations report software and call statistics, list active channels, inspect PJSIP endpoints or older chan_sip peers, and retrieve a complete dialplan context or a specific extension. An Asterisk CLI tool also accepts approved inspection commands. For FreeSWITCH, the tools report switch and session statistics, list live call legs, inspect Sofia registrations, and show SIP profiles and gateway registration state. Its API tool is similarly restricted to approved command prefixes.

Both platforms provide a preview operation for hangups. These previews identify the live channels or call legs that match a requested hangup without changing the PBX.

How it works

The server communicates with the configured PBX over AMI or ESL and returns live results through MCP. Optional substring filters can narrow Asterisk channel results and FreeSWITCH channel results. Asterisk hangups target a channel name; FreeSWITCH hangups use a channel UUID. Originate and hangup operations are write actions rather than diagnostic queries.

Read-only mode is the starting state. The four write tools—origination and hangup for each platform—are not registered unless PBX_MCP_ALLOW_WRITE=true. Command tools use allow-listed inspection prefixes, and shell metacharacters are rejected before commands are sent. AMI action fields are also checked against header injection.

Setup and configuration

Install with npm install -g pbx-mcp or run it with npx -y pbx-mcp. Node.js 18 or later is required. The server communicates over stdio, so it can be launched from an MCP client configuration or run in the provided container image with stdin attached. The container does not expose a listening port; the PBX must be reachable from inside the container.

Set ASTERISK_AMI_HOST to enable Asterisk support, along with the AMI username and password. The default AMI port is 5038, and AMI TLS can be enabled with ASTERISK_AMI_TLS=true. The AMI account needs read access to system, call, and command classes plus write access to command; originate permission is needed if call origination will be enabled.

Set FREESWITCH_ESL_HOST to enable FreeSWITCH support. ESL uses port 8021 by default and the documented default password is ClueCon, unless the switch configuration changes it. PBX_MCP_TIMEOUT_MS controls the per-command timeout and defaults to 10,000 milliseconds.

Tools and capabilities

The pbx-mcp MCP server provides these capability groups:

  • Asterisk status, channels, endpoints, dialplan, CLI inspection, hangup previews, origination, and hangup.
  • FreeSWITCH status, channels, registrations, Sofia status, API inspection, hangup previews, origination, and hangup.
  • Optional channel filtering for live-call listings.
  • Explicit write-mode gating for actions that can place or terminate calls.

Limitations and notes

The server depends on network access to the PBX and valid AMI or ESL credentials. It does not listen on a network port when used through stdio. Enabling write mode allows real call-control operations, including origination over a live trunk, so it should be enabled only with suitable credentials and operational safeguards. CLI and API access remains subject to their configured safety allow lists.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Pbx MCP

pbx-mcp is an MCP server that connects AI assistants to Asterisk over AMI and FreeSWITCH over ESL. Its main tools inspect status, channels, endpoints, registrations, SIP profiles, and dialplans, run guarded CLI or API queries, preview hangups, and optionally originate or terminate calls.

Install it with npm or run it through npx. Use `npm install -g pbx-mcp` for a global installation, or configure an MCP client to run `npx -y pbx-mcp`. Node.js 18 or newer is required.

Set `ASTERISK_AMI_HOST`, `ASTERISK_AMI_USERNAME`, and `ASTERISK_AMI_PASSWORD`. The default AMI port is 5038; set `ASTERISK_AMI_PORT` to change it and `ASTERISK_AMI_TLS=true` when AMI TLS is enabled. The AMI user needs the documented read and command permissions.

Set `PBX_MCP_ALLOW_WRITE=true` to register the originate and hangup tools. Without that variable, the server remains read-only and those tools do not appear in the MCP tool list. Preview tools remain available without write mode.

Yes, pbx-mcp works with Claude Desktop through its stdio MCP configuration. Add a server entry that runs `npx -y pbx-mcp` and provide the relevant Asterisk or FreeSWITCH environment variables. The same stdio configuration pattern works with other compatible MCP clients.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewPbx MCP AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/pbx-mcp?style=directory)](https://allmcps.com/mcp/pbx-mcp)
HTML Embed
<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>