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.
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
- docs/architecture.md — exchange, transport, ledger, hop budget.
- docs/protocol.md — the wire protocol: envelope shape, tool schemas, statuses.
- docs/roadmap.md — status and what's deferred (real transports, federation, auth).
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.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。