Deprecated: superseded by mcp_agent_mail_rust, the maintained Rust rewrite. Original Python FastMCP coordination layer for AI coding agents: identities, inboxes, searchable threads, and advisory file leases over FastMCP + Git + SQLite.
# Add to your Claude Code skills
git clone https://github.com/Dicklesworthstone/mcp_agent_mailGuides for using ai agents skills like mcp_agent_mail.
mcp_agent_mail is an open-source ai agents skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by Dicklesworthstone. Deprecated: superseded by mcp_agent_mail_rust, the maintained Rust rewrite. Original Python FastMCP coordination layer for AI coding agents: identities, inboxes, searchable threads, and advisory file leases over FastMCP + Git + SQLite. It has 2,244 GitHub stars.
mcp_agent_mail's catalog security scan is still queued. You can run an instant dependency and prompt-injection check now with the "Scan for vulnerabilities" button above.
Clone the repository with "git clone https://github.com/Dicklesworthstone/mcp_agent_mail" and add it to your Claude Code skills directory (see the Installation section above). mcp_agent_mail ships a SKILL.md manifest, so compatible agents can discover and load it automatically.
mcp_agent_mail is primarily written in Python. It is open-source under Dicklesworthstone on GitHub, so you can review or fork the full source.
Yes. AgentsLLM lists many other AI Agents skills you can browse and compare side by side. Open the AI Agents category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh mcp_agent_mail against similar tools.
No comments yet. Be the first to share your thoughts!
Unlocks once the catalog security scan passes (runs nightly).
The deep catalog scan for this skill is still queued. Run an instant dependency check now instead.
A mail-like coordination layer for coding agents exposed as an HTTP-only FastMCP server. Provides memorable identities, inbox/outbox, file reservation leases, contact policies, searchable message history, and Human Overseer messaging. Backed by Git (human-auditable artifacts) and SQLite (fast queries with FTS5).
Without coordination, multiple agents:
Agent Mail solves this with:
# Quickest way (alias added during install)
am
# Or manually
cd ~/projects/mcp_agent_mail
./scripts/run_server_with_token.sh
Default: http://127.0.0.1:8765
Web UI for humans: http://127.0.0.1:8765/mail
Each working directory (absolute path) is a project. Agents in the same directory share a project namespace. Use the same project_key for agents that need to coordinate.
Agents register with adjective+noun names (GreenCastle, BlueLake). Names are unique per project, memorable, and appear in inboxes, commit logs, and the web UI.
Advisory locks on file paths or globs. Before editing files, reserve them to signal intent. Other agents see the reservation and can choose different work. The optional pre-commit guard blocks commits that conflict with others' exclusive reservations.
Per-agent policies control who can message whom:
| Policy | Behavior |
|---|---|
open |
Accept any message in the project |
auto (default) |
Allow if shared context exists (same thread, overlapping reservations, recent contact) |
contacts_only |
Require explicit contact approval first |
block_all |
Reject all new contacts |
GitHub-Flavored Markdown with threading, importance levels (low, normal, high, urgent), and optional acknowledgment requirements. Images are auto-converted to WebP.
macro_start_session(
human_key="/abs/path/to/project",
program="claude-code",
model="opus-4.5",
task_description="Implementing auth module"
)
Returns: {project, agent, file_reservations, inbox}
This single call: ensures project exists, registers your identity, optionally reserves files, fetches your inbox.
file_reservation_paths(
project_key="/abs/path/to/project",
agent_name="GreenCastle",
paths=["src/auth/**/*.ts", "src/middleware/auth.ts"],
ttl_seconds=3600,
exclusive=true,
reason="bd-123"
)
Returns: {granted: [...], conflicts: [...]}
Conflicts are reported but reservations are still granted. Check conflicts and coordinate if needed.
send_message(
project_key="/abs/path/to/project",
sender_name="GreenCastle",
to=["BlueLake"],
subject="[bd-123] Starting auth refactor",
body_md="Reserving src/auth/**. Will update session handling.",
thread_id="bd-123",
importance="normal",
ack_required=true
)
fetch_inbox(
project_key="/abs/path/to/project",
agent_name="GreenCastle",
limit=20,
urgent_only=false,
include_bodies=true
)
Or use resources for fast reads:
resource://inbox/GreenCastle?project=/abs/path&limit=20&include_bodies=true
release_file_reservations(
project_key="/abs/path/to/project",
agent_name="GreenCastle"
)
Prefer macros for speed and smaller models. Use granular tools when you need fine control.
| Macro | Purpose |
|---|---|
macro_start_session |
Bootstrap: ensure project → register agent → optional file reservations → fetch inbox |
macro_prepare_thread |
Join existing conversation: register → summarize thread → fetch inbox context |
macro_file_reservation_cycle |
Reserve files, do work, optionally auto-release when done |
macro_contact_handshake |
Request contact permission, optionally auto-accept, send welcome message |
When using Beads for task management, keep identifiers aligned:
1. Pick ready work: bd ready --json → choose bd-123
2. Reserve files: file_reservation_paths(..., reason="bd-123")
3. Announce start: send_message(..., thread_id="bd-123", subject="[bd-123] Starting...")
4. Work and update: Reply in thread with progress
5. Complete: bd close bd-123
release_file_reservations(...)
send_message(..., subject="[bd-123] Completed")
Use bd-### as:
thread_id[bd-###]reasonUse bv's robot flags for intelligent task selection:
| Flag | Output | Use Case |
|---|---|---|
bv --robot-insights |
PageRank, critical path, cycles | "What's most impactful?" |
bv --robot-plan |
Parallel tracks, unblocks | "What can run in parallel?" |
bv --robot-priority |
Recommendations with confidence | "What should I work on next?" |
bv --robot-diff --diff-since <ref> |
Changes since commit/date | "What changed?" |
Rule of thumb: Use bd for task operations, use bv for task intelligence.
For frontend/backend or multi-repo projects:
Option A: Shared project_key
Both repos use the same project_key. Agents coordinate automatically.
Option B: Separate projects with contact links
# Backend agent requests contact with frontend agent
request_contact(
project_key="/abs/path/backend",
from_agent="GreenCastle",
to_agent="BlueLake",
to_project="/abs/path/frontend",
reason="API contract coordination"
)
# Frontend agent accepts
respond_contact(
project_key="/abs/path/frontend",
to_agent="BlueLake",
from_agent="GreenCastle",
accept=true
)
Install the guard to block commits that conflict with others' exclusive reservations:
install_precommit_guard(
project_key="/abs/path/to/project",
code_repo_path="/abs/path/to/project"
)
hooks.d/Set AGENT_NAME environment variable so the guard knows who you are.
Bypass in emergencies: AGENT_MAIL_BYPASS=1 git commit ...
| Tool | Purpose |
|---|---|
ensure_project(human_key) |
Create/ensure project exists |
register_agent(project_key, program, model, name?, task_description?) |
Register identity |
whois(project_key, agent_name) |
Get agent profile with recent commits |
create_agent_identity(project_key, program, model) |
Always create new unique agent |
| Tool | Purpose |
|---|---|
send_message(project_key, sender, to, subject, body_md, ...) |
Send message |
reply_message(project_key, message_id, sender, body_md) |
Reply (preserves thread) |
fetch_inbox(project_key, agent, limit?, since_ts?, urgent_only?) |
Get messages |
mark_message_read(project_key, agent, message_id) |
Mark as read |
acknowledge_message(project_key, agent, message_id) |
Acknowledge receipt |
search_messages(project_key, query) |
FTS5 search |
summarize_thread(project_key, thread_id) |
Extract key points and actions |
| Tool | Purpose |
|---|---|
file_reservation_paths(project_key, agent, paths, ttl?, exclusive?) |
Reserve files |
release_file_reservations(project_key, agent, paths?) |
Release reservations |
renew_file_reservations(project_key, agent, extend_seconds?) |
Extend TTL |
force_release_file_reservation(project_key, agent, reservation_id) |
Clear stale reservation |
| Tool | Purpose |
|---|---|
request_contact(project_key, from_agent, to_agent, reason?) |
Request permission to message |
respond_contact(project_key, to_agent, from_agent, accept) |
Accept/deny contact request |
list_contacts(project_key, agent_name) |
List contact links |
set_contact_policy(project_key, agent_name, policy) |
Set open/auto/contacts_only/block_all |
Use resources for quick, non-mutating reads:
resource://inbox/{agent}?project=<path>&limit=20&include_bodies=true
resource://thread/{thread_id}?project=<path>&include_bodies=true
resource://message/{id}?project=<path>
resource://file_reservations/{slug}?active_only=true
resource://project/{slug}
resource://projects
resource://agents/{project_key}
"exact phrase"
prefix*
term1 AND term2
term1 OR term2
subject:login
body:"api key"
(auth OR login) AND NOT admin
Example: search_messages(project_key, '"auth module" AND error NOT legacy')
Browse at http://127.0.0.1:8765/mail:
Send direct messages to agents with automatic preamble:
high importanceExport projects to portable, read-only bundles for auditors, stakeholders, or archives:
# Interactive wizard (recommended)
uv run python -m mcp_agent_mail.cli share wizard
# Manual export
uv run python -m mcp_agent_mail.cli share export --output ./bundle
# With signing
uv run python -m mcp_agent_mail.cli share export \
--output ./bundle \
--signing-key ./keys/signing.key
# Preview locally
uv run python -m mcp_agent_mail.cli share preview ./bundle
standard (removes secrets) or strict (redacts bodies)# Save current state
uv run python -m mcp_agent_mail.cli archive save --label nightly
# List restore points
uv run python -m mcp_agent_mail.cli archive list --json
# Restore after disaster
uv run python -m mcp_agent_mail.cli archive restore <file>.zip --force
# Run diagnostics
uv run python -m mcp_agent_mail.cli doctor check
# Preview repairs
uv run python -m mcp_agent_mail.cli doctor repair --dry-run
# Apply repairs (creates backup first)
uv run python -m mcp_agent_mail.cli doctor repair
Checks: stale locks, database integrity, orphaned records, FTS sync, expired reservations.
| Error | Fix |
|---|---|
| "sender_name not registered" | Call register_agent or macro_start_session first |
| "FILE_RESERVATION_CONFLICT" | Wait for expiry, coordinate, or use non-exclusive |
| "CONTACT_BLOCKED" | Use request_contact and wait for approval |
| Empty inbox | Check since_ts, urgent_only, verify agent name matches exactly |
# One-liner (recommended)
curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/mcp_agent_mail/main/scripts/install.sh?$(date +%s)" | bash -s -- --yes
# Custom port
curl -fsSL ... | bash -s -- --port 9000 --yes
# Change port after installation
uv run python -m mcp_agent_mail.cli config set-port 9000
| Variable | Default | Description |
|---|---|---|
STORAGE_ROOT |
~/.mcp_agent_mail_git_mailbox_repo |
Root for repos and SQLite DB |
HTTP_PORT |
8765 |
Server port |
HTTP_BEARER_TOKEN |
— | Static bearer token for auth |
LLM_ENABLED |
true |
Enable LLM for summaries/discovery |
CONTACT_ENFORCEMENT_ENABLED |
true |
Enforce contact policy (when false, explicit cross-project sends skip the approved-link requirement; block_all still honored) |
docker build -t mcp-agent-mail .
docker run --rm -p 8765:8765 \
-e HTTP_HOST=0.0.0.0 \
-v agent_mail_data:/data \
mcp-agent-mail
| Tool | Integration |
|---|---|
| NTM | Agent panes coordinate via mail, dashboard shows inbox |
| BV | Task IDs become thread IDs, robot flags inform task selection |
| CASS | Search mail threads across sessions |
| CM | Extract procedural memory from mail archives |
| DCG | Mail notifies agents of blocked commands |
| RU | Coordinate multi-repo updates via cross-project mail |
Superseded by mcp_agent_mail_rust. This Python version is no longer maintained; use the Rust version for new installs.

"It's like gmail for your coding agents!"
A mail-like coordination layer for coding agents, exposed as an HTTP-only FastMCP server. It gives agents memorable identities, an inbox/outbox, searchable message history, and voluntary file reservation "leases" to avoid stepping on each other.
Think of it as asynchronous email + directory + change-intent signaling for your agents, backed by Git (for human-auditable artifacts) and SQLite (for indexing and queries).
Status: Maintenance mode. This Python implementation is superseded by the Rust rewrite and is no longer actively developed; new installs should use mcp_agent_mail_rust. The original design is captured in detail in docs/planning/project_idea_and_guide.md (start with the original prompt at the top of that file).
Modern projects often run multiple coding agents at once (backend, frontend, scripts, infra). Without a shared coordination fabric, agents:
This project provides a lightweight, interoperable layer so agents can:
It's designed for: FastMCP clients and CLI tools (Claude Code, Codex, Gemini CLI, Factory Droid, etc.) coordinating across one or more codebases.
If a blank repo feels daunting, follow the field-tested workflow we documented in docs/planning/project_idea_and_guide.md (“Appendix: From Blank Repo to Coordinated Swarm”):
AGENTS.md, add any tech-specific best-practice guides, and let Codex scaffold the repo plus Beads tasks straight from the plan.AGENTS.md, the plan document, and the Beads backlog before touching code.Watch the full 23-minute walkthrough (https://youtu.be/68VVcqMEDrs?si=pCm6AiJAndtZ6u7q) to see the loop in action.
One disciplined hour of GPT-5 Codex—when it isn’t waiting on human prompts—often produces 10–20 “human hours” of work because the agents reason and type at machine speed. Agent Mail multiplies that advantage in two layers:
Result: you invest 1–2 hours of human supervision, but dozens of agent-hours execute in parallel with clear audit trails and conflict-avoidance baked in.
curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/mcp_agent_mail/main/scripts/install.sh?$(date +%s)" | bash -s -- --yes
What this does:
scripts/ (including run_server_with_token.sh)am shell alias to your .zshrc or .bashrc for quick server startup (just type am in a new terminal!)br), a Rust reimplementation of the Beads task tracker, and creates a bd shell alias pointing to br for backwards compatibility. This replaces any existing bd (Go) installation. Pass --skip-beads to opt out. See beads_rust for details on CLI differences.bv TUI for interactive task browsing and AI-friendly robot commands (pass --skip-bv to opt out)Prefer a specific location or options? Add flags like --dir <path>, --project-dir <path>, --no-start, --start-only, --port <number>, or --token <hex>.
Already have Beads or Beads Viewer installed? Append --skip-beads and/or --skip-bv to bypass automatic installation.
The installer automatically replaces bd (the original Go-based Beads CLI) with br (Beads Rust):
br is the actively maintained version. Beads Rust is a complete reimplementation with ongoing development, while the original Go version is no longer actively maintained.
Existing bd users get automatic aliasing. The installer creates a shell alias so that bd commands continue to work by redirecting to br. Your existing workflows and muscle memory are preserved.
A migration skill is installed for agents. AI coding agents receive a bd-br-migration skill that helps them adapt to any CLI differences between the two implementations.
Same data format, compatible workflows. Both implementations use the same .beads/issues.jsonl format, so your existing Beads data remains fully compatible.
To opt out of this replacement, pass --skip-beads to the installer. See the beads_rust repository for detailed documentation on CLI differences.
After installation, you can start the MCP Agent Mail server from anywhere by simply typing:
am
That's it! The am alias (added to your .zshrc or .bashrc during installation) automatically:
uv run to handle the virtual environment).env and starts the HTTP serverNote: If you just ran the installer, open a new terminal or run source ~/.zshrc (or source ~/.bashrc) to load the alias.
Port conflicts? Use --port to specify a different port (default: 8765):
Install with custom port:
curl -fsSL "https://raw.githubusercontent.com/Dicklesworthstone/mcp_agent_mail/main/scripts/install.sh?$(date +%s)" | bash -s -- --port 9000 --yes
Or use the CLI command after installation: uv run python -m mcp_agent_mail.cli config set-port 9000
### If you want to do it yourself
Clone the repo, set up and install with uv in a python 3.14 venv (install uv if you don't have it already), and then run `scripts/automatically_detect_all_installed_coding_agents_and_install_mcp_agent_mail_in_all.sh`. This will automatically set things up for your various installed coding agent tools and start the MCP server on port 8765. If you want to run the MCP server again in the future, simply run `scripts/run_server_with_token.sh`:
Install uv (if you don't have it already):
```bash
curl -LsSf https://astral.sh/uv/install.sh | sh
export PATH="$HOME/.local/bin:$PATH"
# Clone the repo
git clone https://github.com/Dicklesworthstone/mcp_agent_mail
cd mcp_agent_mail
# Create a Python 3.14 virtual environment and install dependencies
# Note: If you have an older uv version, run `uv self update` first
uv python install 3.14
uv venv -p 3.14
source .venv/bin/activate
uv sync
# Detect installed coding agents, integrate, and start the MCP server on port 8765
scripts/automatically_detect_all_installed_coding_agents_and_install_mcp_agent_mail_in_all.sh
# Later, to run the MCP server again with the same token
scripts/run_server_with_token.sh
# Now, simply launch Codex-CLI or Claude Code or other agent tools in other consoles; they should have the mail tool available. See below for a ready-made chunk of text you can add to the end of your existing AGENTS.md or CLAUDE.md files to help your agents better utilize the new tools.
# Change port after installation
uv run python -m mcp_agent_mail.cli config set-port 9000
## MCP Agent Mail: coordination for multi-agent workflows
What it is
- A mail-like layer that lets coding agents coordinate asynchronously via MCP tools and resources.
- Provides ide