agent-mailbox
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@agent-mailbox Check my mailbox for any pending messages and summarize them."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
agent-mailbox
Give every local AI agent its own mailbox.
One MCP server. Register once, message any agent on this machine. No cron. No polling daemons. No shared markdown files. No cloud.
📖 Docs: English · 中文 · 日本語 · Español — Architecture diagram · 中文版

uvx --from git+https://github.com/polaris-smart/agent-mailbox agent-mailbox # stdio transport, ready for any MCP host
uvx --from git+https://github.com/polaris-smart/agent-mailbox agent-mailbox --http 8642 # or expose it over HTTP for remote agentsThe problem
Your coding agent, your ops agent, your review agent — all running on the same machine, all perfectly capable — cannot talk to each other. So you end up being the messenger: copying conclusions from one terminal, pasting instructions into another, relaying status updates by hand.
File-based workarounds (a shared markdown "log", a dropped-notes/ folder) decay into an unreadable transcript. Cron-and-scan workarounds burn tokens on empty polls. Cloud relays put your workflow data behind someone else's API.
Related MCP server: mcp-communication-network
The fix
A mailbox that is just another tool:
Tool | What it does |
| Claim your mailbox. Idempotent. |
| Deliver to one agent, a list, or |
| Fetch pending messages — they auto-ack on read. |
| Reply inside a thread, auto-routed to the sender. |
| Browse by status ( |
| Mark handled; done messages archive automatically. |
| One call, every registered agent. |
| Who's registered, where the mail root is. |
Messages are plain JSON with a tiny lifecycle: pending → acked → done. A message that arrives while the recipient is offline simply waits — mail, like mail should.
Quick start
Hermes (~/.hermes/config.yaml):
mcp:
servers:
agent-mailbox:
command: uvx
args: ["--from", "git+https://github.com/polaris-smart/agent-mailbox", "agent-mailbox"]Claude Code (~/.claude/settings.json):
{ "mcpServers": { "agent-mailbox": { "command": "uvx", "args": ["--from", "git+https://github.com/polaris-smart/agent-mailbox", "agent-mailbox"] } } }Any MCP client (stdio):
uvx --from git+https://github.com/polaris-smart/agent-mailbox agent-mailboxRemote agents (e.g. an agent on another server):
uvx --from git+https://github.com/polaris-smart/agent-mailbox agent-mailbox --http 8642 # on the mail host{ "mcpServers": { "agent-mailbox": { "url": "http://your-host:8642/mcp" } } }Waiting for mail (no polling)
Agents don't need to poll. mailbox_wait blocks (long-poll) until a message
arrives — call it as the last action of a turn and the next message wakes your
agent immediately:
{ "tool": "mailbox_wait", "arguments": { "timeout_seconds": 25 } }For humans and dashboards, a companion watcher prints every new message as a JSON line and can fire macOS notifications for chosen agents:
uvx --from git+https://github.com/polaris-smart/agent-mailbox agent-mailbox-watch --notify boss # macOS notification center
agent-mailbox-watch --once # single scan (cron-friendly)Design
Local-first — plain JSON files under
~/.agent-mail/. No SMTP, no IMAP, no domain, no cloud relay, no network by default.Register-once addressing —
mailbox_register("WB")is all it takes; every registered agent is immediately addressable by everyone.Zero external dependencies — only
mcp. The store is one Python file withflock-guarded atomic writes; multiple MCP host processes share one mail root safely.Human-readable — every message is a small JSON file you can
cat. The boss can read the inbox directly.Honors existing identities — set
AGENT_MAIL_IDin each agent's environment and its tools become self-addressed.
When you outgrow it
Local mailboxes solve same-machine and trusted-LAN coordination. The message lifecycle (pending → acked → done) is designed to carry over unchanged when an agent's threads need to reach other machines and organizations over real email infrastructure.
Security notes
Mail root lives in your home directory; messages never leave the machine unless you opt into HTTP transport on a trusted network.
Agent ids are strictly validated (
[A-Za-z0-9_-], ≤64 chars) — no path traversal.The store is append-oriented with atomic writes and file locks; a crashed writer cannot corrupt the registry.
For tamper-evidence, signed receipts (ed25519) are on the roadmap.
Roadmap
v0.1.0 (current) — same-machine agent mailboxes over stdio MCP. Zero infrastructure. Includes long-poll
mailbox_waitand a companion watcher — no polling daemons needed.v0.2.0 — federation: streamable HTTP transport for agents on other machines (Tailscale/LAN friendly).
v0.3.0 — signed receipts (ed25519) for tamper-evident delivery.
v1.0.0 — cross-organization bridge: local threads reach agents on other machines and organizations over standard email infrastructure, with the same mailbox lifecycle.
Sister project: dsh-devices manages your devices; agent-mailbox manages the conversation between the agents on them.
Development
git clone https://github.com/polaris-smart/agent-mailbox && cd agent-mailbox
pip install -e ".[dev]"
pytestLicense
MIT — see LICENSE.
Available Tools
9 toolsmailbox_broadcastC
Broadcast to every registered agent (including boss).
Inputs: body (required), subject (required), from_id.
mailbox_checkB
Fetch your pending messages (they become acked). Call at session start.
Inputs: mark, agent_id.
mailbox_doneC
Mark a message as handled. Done messages can be archived.
Inputs: msg_id (required), agent_id.
mailbox_listC
List messages in your mailbox, optionally filtered by status.
Inputs: status, agent_id.
mailbox_registerC
Register this agent and claim its mailbox. Idempotent — safe to call again.
Inputs: agent_id (required), owner, description.
mailbox_replyB
Reply to a message thread. Routes to the original sender automatically.
Inputs: body (required), msg_id (required), agent_id.
mailbox_sendB
Send a message to one agent, a list of agents, or "all" for broadcast.
Inputs: to (required), body (required), subject (required), from_id, +2 more.
mailbox_waitC
Block until a new message arrives (long-poll, up to timeout). Returns immediately if pending messages exist. Import 'time' is at module top.
Inputs: agent_id, timeout_seconds.
mailbox_whoamiA
List all registered agents and the mail root location.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
mailbox_send with 'all' overlaps significantly with mailbox_broadcast, creating redundant paths for the same action. mailbox_check and mailbox_list both involve fetching messages, though check ack semantics and list filtering differentiate them. Overall boundaries are mostly clear but these overlaps introduce real selection ambiguity.
All tools share a consistent mailbox_ prefix and snake_case style, with most names following a verb form like check, register, send, reply, list, and wait. The non-verb names 'done' and 'whoami' deviate slightly, and send/broadcast are near-synonyms, but the overall pattern is coherent and predictable.
Nine tools is well-scoped for a mailbox domain, covering registration, sending, receiving, replying, listing, waiting, and completion. Each tool earns its place and the count does not feel bloated or thin.
The tool set covers the core mailbox lifecycle: register, send, receive, reply, list, wait, and mark handled, so typical agent communication flows are supported. Missing explicit archive/delete operations and unread/read state controls are minor gaps that agents can work around.
Related MCP Connectors
Messaging and inboxes for AI agents: register, send signed messages, check your inbox, find agents.
Durable addresses and crash-safe FIFO mailboxes so AI agents message each other, free.
Async message queue for AI agents. Self-provision queues, push/poll messages, no signup.
End-to-end encrypted messaging and work coordination for autonomous AI agents.
Related MCP Servers
- FlicenseCqualityDmaintenanceA lightweight messaging system that enables real-time communication between different AI agents through a shared, file-based message queue. It provides tools for sending, checking, and broadcasting messages to facilitate coordination across isolated project namespaces.81-
- FlicenseNot gradedqualityCmaintenanceGlobal mailbox and address book for AI agents, enabling asynchronous messaging across machines without requiring simultaneous online presence.-
- AlicenseAqualityBmaintenanceEnables local AI coding agents to message each other on one machine using a durable SQLite mailbox and live-ask tools.93MIT
- AlicenseAqualityCmaintenanceEnables AI agents to send and receive structured, cryptographically-verifiable messages, with tools for inbox management, task delegation, and agent discovery.12118 npmMIT