PBXMCP

PBXMCP

Enables LLM agents to communicate with each other by placing and answering calls via a telephone exchange, with routing, hop budget, and call recording.

Category
Visit Server

README

PBXMCP

A telephone exchange (PBX) for LLM agents, exposed as an MCP server.

Each system gets an area code and each agent an extension. Agents place calls to each other with dial and reply with answer_call; the exchange routes the call, enforces a hop budget so call chains can't loop forever, and records every call in a ledger.

PBXMCP owns the protocol, routing, hop accounting, and MCP surface. The actual "ring the callee" step is host-specific — a kernel that pushes a turn to an agent's stdin, a message queue, an HTTP webhook — so delivery goes through a pluggable transport. A working in-memory loopback transport ships for tests and demos; a real host implements the same small contract.

Why

An agent normally can't talk to another agent. If a host can push a message to an agent (deliver it as that agent's next turn), then one agent calling another is just: route the call, deliver it as a turn, and carry a correlation id so the reply finds its way back. PBXMCP is that routing-and-correlation layer, packaged as an MCP server so any MCP-speaking agent can dial.

The receiver never has to "listen" on an open connection — it is rung by the host when it is ready for its next turn — so there is no socket to hold open and no per-call timeout on the callee's side.

Quickstart

pip install -e ".[server]"          # server extra pulls in fastmcp
python -m pbxmcp serve              # stdio MCP server
python -m pbxmcp serve --transport http --port 7420

Point an MCP client at it and call dial:

{"from_extension": "alice", "to_extension": "212-bob", "body": "status?"}

dial returns immediately with a run_id and a status (delivered / unknown_target / ttl_exceeded / failed). The reply arrives later as a separate turn on the caller; recognize it with the telephone envelope and answer with answer_call(reply_to_run_id, body).

Use it as a library

The exchange works with no MCP dependency at all:

from pbxmcp import Exchange, RoutingConfig, CallLedger, LoopbackTransport

transport = LoopbackTransport()
transport.register("alice", "bob")
exchange = Exchange(RoutingConfig(), transport, CallLedger())

call = exchange.dial(from_extension="alice", to_extension="bob", body="ping")
# bob's inbox now holds the call envelope:
env = transport.inbox("bob")[0]
exchange.answer(from_extension="bob", reply_to_run_id=call.run_id, body="pong")
# alice's inbox now holds the reply.

Tools

Tool Purpose
dial(from_extension, to_extension, body, to_area?, ttl_hops?) Place a call. Fire-and-forget; returns a run_id.
answer_call(from_extension, reply_to_run_id, body, status?) Reply to a call you received.
list_calls() Every call the exchange has recorded.
directory() The area-code map and dialing defaults.

Docs

Status

V0.1 — the core (routing, hop budget, ledger, envelope) is implemented and tested; the MCP server binds it via fastmcp; the loopback transport proves the mechanism end to end. Production delivery needs a host transport adapter (see the roadmap). 33 tests, no network required for the core suite.

License

MIT. See LICENSE.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured