Give every AI agent its own mailbox — one stdio MCP server, zero daemons, one JSON file per message.
- ✓Open-source license (MIT)
- ✓Actively maintained (<30d)
- ✓Clear description
- ✓Topics declared
- ✓Documented (README)
- !Install pipes a remote script into a shell (curl | sh)
claude mcp add agent-mailbox -- uvx --from{
"mcpServers": {
"agent-mailbox": {
"command": "uvx",
"args": ["--from"]
}
}
}Resumen de MCP Servers
# agent-mailbox
[](https://glama.ai/mcp/servers/polaris-smart/agent-mailbox)
[](https://www.npmjs.com/package/agent-mailbox)
[](LICENSE)
**Mailbox + Wake system for agent teams — agents that wake up, route, and collaborate.** One stdio MCP server. One JSON file per message. Plus a built-in task board: cards wake their assignee when they move, and a zero-dependency web kanban for the human.
> **📊 Production-proven**: 1,676 messages across 5 agents (Claude Code, Hermes, Codex-based, webhook wake) in 18 days of daily multi-agent software development — ~93 messages/day, zero data loss.
Other docs: [中文](README.zh-CN.md) · [Español](README.es.md) · [Português](README.pt-BR.md) · [Français](README.fr.md) · [Русский](README.ru.md)
## Why not just use MCP / Slack / raw files?
| Approach | Cross-CLI | Async | Wake-up | Human board | Deps |
|---|---|---|---|---|---|
| **agent-mailbox** | ✅ any MCP host | ✅ inbox persists | ✅ webhook + task cards | ✅ built-in kanban | **0** |
| Raw MCP tools | ❌ per-CLI sessions | ❌ lost on restart | ❌ | ❌ | — |
| Slack/Discord bot | ✅ | ✅ | ✅ | ❌ | API tokens, rate limits, cloud dependency |
| Shared files + conventions | ✅ | ⚠️ ad-hoc | ❌ manual | ❌ | your own locking code |
The gap agent-mailbox fills: **agents on different CLIs, on the same machine, messaging each other asynchronously — with delivery guarantees and a human-visible board — without a single dependency.**
> 🆕 **v0.7.x — the wake-up upgrade**: **sampling wake** — the server pings the recipient's host over its own MCP connection (`sampling/createMessage`) the moment a letter lands, with per-agent wake-policy injection (identity template, forbidden hard constraints, per-agent execution lock — one clone in flight at a time) — plus the **local-command wake adapter** for CLI-only agents (codex et al., argv-only + env-injected + killpg timeout) and a `wake run --adapter` override for shared `wake.json` / per-agent plists. Sampling is an accelerator, never a delivery guarantee: MCP deprecated it on 2026-07-28 (SEP-2577), so v0.7.2 adds a per-agent kill switch (`"sampling": {"enabled": false}` in `wake.json`) while the fallback chain (wake-daemon / webhook / next check) keeps the mail-arrival iron law. 13 MCP tools. Previous: [Wake daemon](#wake-daemon-信必达-mail-arrived--agent-woken)
---
## The problem
Run several AI agents on one machine — Claude Code, Hermes, your own scripts — and they have no way to leave each other messages. Agents overlap, wait on each other, or you end up copy-pasting between their windows like a human switchboard.
## The fix
A mailbox is a directory of plain JSON files:
```
~/.agent-mail/
registry.json agent_id → {owner, description, created_at}
inbox/HS/20260905-….json one file per message
archive/HS/…
tasks.json the task board ({"next
A mailbox is a directory of plain JSON files:
```
~/.agent-mail/
registry.json agent_id → {owner, description, created_at}
inbox/HS/20260905-….json one file per message
archive/HS/…
tasks.json the task board ({"next_id", "tasks": {id: card}})
```
Agents read and write it through a small stdio MCP server. No broker process, no ports, no database, no network by default. Any number of MCP host processes share one mail root safely (file-lock guarded).

## Quick start
**Prerequisites** — one-time: install [uv](https://docs.astral.sh/uv/) (`curl -LsSf https://astral.sh/uv/install.sh | sh` on macOS/Linux, or `powershell -c "irm https://astral.sh/uv/install.ps1 | iex"` on Windows). `uvx` runs everything else; nothing else to install.
### 1 · Register the server with your MCP host
Claude Code:
```bash
claude mcp add agent-mailbox -- uvx --from git+https://github.com/polaris-smart/agent-mailbox agent-mailbox
```
Any MCP host (generic JSON):
```json
{
"mcpServers": {
"agent-mailbox": {
"command": "uvx",
"args": ["--from", "git+https://github.com/polaris-smart/agent-mailbox", "agent-mailbox"]
}
}
}
```
Tip: set `AGENT_MAIL_ID=HS` (or whichever id) in the agent's environment and every tool becomes self-addressed — no need to pass `agent_id` on each call.
### 2 · Agents register once
```json
{ "tool": "mailbox_register", "arguments": { "agent_id": "HS", "owner": "Hermes", "description": "PM & QA" } }
```
Registration is idempotent. Every registered agent is immediately addressable by everyone — including a human `boss` id you can read yourself.
### 3 · Send, check, reply
```json
{ "tool": "mailbox_send", "arguments": { "to": "HS", "subject": "deploy ready", "body": "v0.1.0 is staged, please verify." } }
{ "tool": "mailbox_check", "arguments": {} }
{ "tool": "mailbox_reply", "arguments": { "msg_id": "20260905-…-hs", "body": "verified, marked done." } }
```
`mailbox_check` fetches pending messages and marks them `acked`. Lifecycle: `pending → acked → done`, then optionally archived. A message is one JSON file you can `cat` — the boss reads the inbox directly.
### 4 · Wait instead of poll
`mailbox_wait` blocks (long-poll) until a message arrives — call it as the last action of a turn:
```json
{ "tool": "mailbox_wait", "arguments": { "timeout_seconds": 25 } }
```
## Task board
Task cards live in `<mail-root>/tasks.json` (plain JSON, same file lock as the mail). The state machine is strict: `todo→doing→review→done`, non-adjacent moves rejected unless `force=True`; `done` is terminal. Creating or moving a card sends the assignee a normal mailbox message (`[task#t-12 → review] …`) — so board motion wakes the owning agent through the existing inbox, no polling, no webhooks. Self-assigned moves stay silent, and `notify=False` opts out.
**Web board (for the human).** `agent-mailbox --web 8643` serves a zero-dependency kanban (stdlib `http.server` + one embedded HTML page, no framework) on `127.0.0.1`. Four lanes mirror the state machine; drag a card between adjacent lanes to move it, or create cards from the form; one toggle switches light/dark themes. Auth is a bearer token — set `AGENT_MAIL_WEB_TOKEN` for a stable one, or a fresh token is printed at boot (open `http://127.0.0.1:8643/?token=…`). The board acts as agent `boss`: every card you create or drag still auto-messages the assignee, so even human drag-and-drop wakes the right agent. The page auto-refreshes every 5 seconds.
## For AI agents (hand this section to your agent)
If you are an AI agent reading this because your user said "install agent-mailbox": do exactly this, no questions needed.
1. Check `uvx --version`; if missing, install uv with the Prerequisites command above for the OS you are running on.
2. Register the MCP server with your host app — use the generic JSON above (step 1) or your host's native mechanism.
3. Pick an identity: any id matching `[A-Za-z0-9_-]` up to 64 chars. Set `AGENT_MAIL_ID=<id>` in your environment, then call `mailbox_register` once (it is idempotent).
4. Verify: call `mailbox_whoami` — you should appear in the registry. You are now addressable by every other agent on this machine.
5. Report your id back to your user so they can send you mail at `~/.agent-mail/inbox/<id>/`.
Read English even if your user speaks another language — the commands are identical everywhere.
## Works with your agent CLI
Anything that speaks MCP stdio can host a mailbox — which is all of them. Register per your CLI's config:
| Agent CLI | How to register |
|-----------|-----------------|
| Claude Code | `claude mcp add agent-mailbox -- uvx --from git+https://github.com/polaris-smart/agent-mailbox agent-mailbox` |
| Gemini CLI | `~/.gemini/settings.json` → `"mcpServers": { … }` (same JSON as Quick start) |
| Qwen Code | same as Gemini CLI (`~/.qwen/settings.json`) |
| Codex CLI | `~/.codex/config.toml` → `[mcp_servers.agent-mailbox]` with `command` / `args` |
| OpenCode | `opencode.json` → `"mcp": { "agent-mailbox": { "type": "local", "command": ["uvx", "--from", "git+https://github.com/polaris-smart/agent-mailbox", "agent-mailbox"] } }` |
| Hermes / Ark CLI / veCLI / OpenClaw / any MCP host | same generic JSON — point `command` at the `uvx` line above |
Then set `AGENT_MAIL_ID` for that CLI's sessions and `mailbox_register` once. Agents on the same machine can now message each other **across different CLIs** — a Claude Code agent and a Gemini CLI agent share the same mail root with zero extra setup.
## Waking a sleeping agent (one config line)
If the receiving agent isn't even running, `mailbox_send` itself can POST every new message to a webhook the moment it lands — no daemon, no polling, no extra process:
```json
// ~/.agent-mail/webhook.json (chmod 600)
{ "url": "http://localhost:8644/webhooks/agent-mailbox", "secret": "…" }
```
Generate the secret yourself once: `openssl rand -hex 32`. Omit it for unsigned posts (fine for local testing; your receiver decides whether to require it).
Your host's webhook handler receives:
```json
{ "event": "agent_mailbox_new_message", "event_type": "agent_mailbox_new_message", "message": { "id": "…", "from": "ZC", "to": "HS", "subject": "…", "body": "…" } }
```
…wakes the agent, and the agent calls `mailbox_check` on arrival. That is the whole integration.
- Signed `X-Hub-Signature-256: sha256=<hmac>` (GitHub scheme — accepted by Hermes gateway and most webhook consumers).
- The signature style is configurable via `AGENT_MAIL_SIGNATURE_STYLE`: `github` (default, `X-Hub-Signature-256: sha256=<hex>`) / `generic` (`X-Webhook-Signature: <hex>`, bare hex) / `slack` (`X-Slack-Signature: v0=<hex>`; this webhook emits no `ts` field, so receivers must NOT verify against the full Slack `v0:ts:body` base string).
- The target is pinned: http/https only, Lo que la gente pregunta sobre agent-mailbox
¿Qué es polaris-smart/agent-mailbox?
+
polaris-smart/agent-mailbox es mcp servers para el ecosistema de Claude AI. Give every AI agent its own mailbox — one stdio MCP server, zero daemons, one JSON file per message. Tiene 2 estrellas en GitHub y su última actualización registrada es del 2026-09-28.
¿Cómo se instala agent-mailbox?
+
Puedes instalar agent-mailbox clonando el repositorio (https://github.com/polaris-smart/agent-mailbox) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.
¿Es seguro usar polaris-smart/agent-mailbox?
+
Nuestro agente de seguridad ha analizado polaris-smart/agent-mailbox y le ha asignado un Trust Score de 87/100 (tier: Trusted). Revisa el desglose completo de comprobaciones superadas y flags en esta página.
¿Quién mantiene polaris-smart/agent-mailbox?
+
polaris-smart/agent-mailbox es mantenido por polaris-smart. La última actividad registrada en GitHub es del 2026-09-28, con 0 issues abiertos.
¿Hay alternativas a agent-mailbox?
+
Sí. En ClaudeWave puedes explorar mcp servers similares en /categories/mcp, ordenados por popularidad o actividad reciente.
Despliega agent-mailbox en tu cloud
Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.
¿Mantienes este repo? Añade un badge a tu README
Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.
[](https://claudewave.com/repo/polaris-smart-agent-mailbox)<a href="https://claudewave.com/repo/polaris-smart-agent-mailbox"><img src="https://claudewave.com/api/badge/polaris-smart-agent-mailbox" alt="Featured on ClaudeWave: polaris-smart/agent-mailbox" width="320" height="64" /></a>Más MCP Servers
Fair-code workflow automation platform with native AI capabilities. Combine visual building with custom code, self-host or cloud, 400+ integrations.
User-friendly AI Interface (Supports Ollama, OpenAI API, ...)
An open-source AI agent that brings the power of Gemini directly into your terminal.
Real-time global intelligence dashboard. AI-powered news aggregation, geopolitical monitoring, and infrastructure tracking in a unified situational awareness interface
🕷️ An adaptive Web Scraping framework that handles everything from a single request to a full-scale crawl! Don't be shy, join here: https://discord.gg/EMgGbDceNQ and follow here for daily tips and tricks: https://x.com/Scrapling_dev
The fastest path to AI-powered full stack observability, even for lean teams.