Agent Mail logo

Agent Mail

Community
Dicklesworthstone
agent-mail

MCP Agent Mail for multi-agent coordination. Use when agents need file locks, messaging, inboxes, or conflict prevention. Handles macro_start_session, file_reservation_paths, send_message, threading, pre-commit guards.

Overview

PublisherDicklesworthstone
Repositoryagent_flywheel_clawdbot_skills_and_integrations
Skill nameagent-mail
Stars
73
Forks
16
Bundled files
9
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 9 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by Dicklesworthstone on GitHub. Read the source before you install it.

Installation

Install the Agent Mail AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
    https://github.com/Dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations/tree/main/skills/agent-mail
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/Dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations.git /tmp/agent_flywheel_clawdbot_skills_and_integrations
mkdir -p .claude/skills
cp -r /tmp/agent_flywheel_clawdbot_skills_and_integrations/skills/agent-mail .claude/skills/agent-mail
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Agent Mail in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Agent Mail on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Agent Mail is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Using MCP Agent Mail

Core Insight: Without coordination, multiple agents overwrite each other's work. Agent Mail provides identities, messaging, and file reservations to prevent conflicts.

When to Use What

SituationAction
Starting any agent sessionmacro_start_session
About to edit filesfile_reservation_paths → edit → release_file_reservations
Need to tell another agent somethingsend_message with thread_id
Picking up someone else's workmacro_prepare_thread
Can't message an agentrequest_contact → wait for approval
Server seems brokenUse health_check() first; CLI-only: doctor check --verbose → doctor repair --yes

THE EXACT PROMPT — Session Bootstrap

Call this at the start of every agent session:

macro_start_session(
  human_key="/abs/path/to/project",
  program="claude-code",
  model="YOUR_MODEL",
  task_description="Working on auth module"
)

Returns: {project, agent, file_reservations, inbox}

This single call: ensures project exists → registers your identity → fetches inbox.


Core Operations

TaskTool
Bootstrap sessionmacro_start_session(human_key, program, model, task_description)
Send messagesend_message(project_key, sender_name, to, subject, body_md)
Reply in threadreply_message(project_key, message_id, sender_name, body_md)
Check inboxfetch_inbox(project_key, agent_name, limit=20)
Reserve filesfile_reservation_paths(project_key, agent_name, paths, ttl_seconds)
Release filesrelease_file_reservations(project_key, agent_name)
Search messagessearch_messages(project_key, "query")

The Four Macros

MacroWhen to Use
macro_start_sessionBootstrap: project → agent → inbox
macro_prepare_threadJoin existing thread with summary
macro_file_reservation_cycleReserve → work → auto-release
macro_contact_handshakeCross-agent contact setup

Fast Resource Reads (No Tool Call Required)

NeedResource
List agentsresource://agents/{project_key}
Inboxresource://inbox/{agent}?project=/abs/path&limit=20
Threadresource://thread/{thread_id}?project=/abs/path&include_bodies=true
Ack-requiredresource://views/ack-required/{agent}?project=/abs/path

File Reservations

Reserve Before Editing

file_reservation_paths(
  project_key="/abs/path/project",
  agent_name="GreenCastle",
  paths=["src/auth/**/*.ts"],
  ttl_seconds=3600,
  exclusive=true,
  reason="bd-123"
)

Returns: {granted: [...], conflicts: [...]}

Conflict Resolution

If conflicts exist:

  1. Wait — TTL will expire
  2. Coordinate — Message the holder
  3. Share — Use exclusive=false

Release When Done

release_file_reservations(project_key="/abs/path/project", agent_name="GreenCastle")

Beads Integration

Use bead IDs as your threading anchor:

1. Pick work:        br ready --json → choose bd-123
2. Reserve files:    file_reservation_paths(..., reason="bd-123")
3. Announce:         send_message(..., thread_id="bd-123", subject="[bd-123] Starting...")
4. Work:             Reply in thread with progress
5. Complete:         br close bd-123, release_file_reservations(...), final message

Bead ID (often bd-###) goes in: thread_id, subject prefix, reservation reason, commit message


Quick Troubleshooting

ErrorFix
"sender_name not registered"Call macro_start_session first
"FILE_RESERVATION_CONFLICT"Wait, coordinate, or use exclusive=false
"CONTACT_BLOCKED"Use request_contact, wait for approval
Empty inboxCheck since_ts, urgent_only, agent name spelling
Server unreachableUse health_check() or resource://config/environment to confirm MCP server is up; if CLI-only, check curl http://127.0.0.1:8765/health
Guard blocks commitSet AGENT_NAME env var; bypass: AGENT_MAIL_BYPASS=1 git commit

Doctor Diagnostics (CLI-only, optional)

bash
# Quick health check (CLI daemon)
curl http://127.0.0.1:8765/health

# Full diagnostics (CLI)
uv run python -m mcp_agent_mail.cli doctor check --verbose

# Preview repairs (dry run, CLI)
uv run python -m mcp_agent_mail.cli doctor repair --dry-run

# Apply repairs (CLI)
uv run python -m mcp_agent_mail.cli doctor repair --yes

Agent Identity

Agents get adjective+noun names: GreenCastle, BlueLake, RedBear.

Best practice: Omit name parameter to auto-generate valid names.

register_agent(
  project_key="/abs/path/project",
  program="claude-code",
  model="YOUR_MODEL",
  task_description="Auth refactor"
)  # name auto-generated

Human Overseer

Send urgent messages to agents from the web UI at http://127.0.0.1:8765/mail:

  1. Click "Human Overseer" mode
  2. Compose with importance: urgent
  3. Select target agents

Agents see urgent messages via fetch_inbox(..., urgent_only=true).


Pre-Commit Guard

install_precommit_guard(project_key="/abs/path", code_repo_path="/abs/path")
  • Set AGENT_NAME env var so guard knows who you are
  • Bypass emergency: AGENT_MAIL_BYPASS=1 git commit -m "fix"
  • Warning mode: AGENT_MAIL_GUARD_MODE=warn

Search Syntax (FTS5)

"exact phrase"
prefix*
term1 AND term2
term1 OR term2
(auth OR login) AND NOT admin

References

TopicReference
All MCP toolsTOOLS.md
Workflow patternsWORKFLOWS.md
MCP resourcesRESOURCES.md
Cross-project setupCROSS-PROJECT.md
Doctor & recoveryRECOVERY.md
InstallationINSTALL.md
Fix MCP configFIX-MCP-CONFIG.md
Product bus, build slots, internalsADVANCED.md

Validation

bash
# Server health
curl http://127.0.0.1:8765/health
# → {"status": "healthy"}

# Start server if needed
am

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Agent Mail AI skill do?

MCP Agent Mail for multi-agent coordination. Use when agents need file locks, messaging, inboxes, or conflict prevention. Handles macro_start_session, file_reservation_paths, send_message, threading, pre-commit guards.

Why use Agent Mail on TypingMind?

Because you install it once and use it with any model. Agent Mail is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Agent Mail in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/Dicklesworthstone/agent_flywheel_clawdbot_skills_and_integrations/tree/main/skills/agent-mail. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Agent Mail?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Agent Mail?

As many as you like. As long as a model supports skills, you can use Agent Mail with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Agent Mail AI skill free?

It is published on GitHub by Dicklesworthstone. Check the repository for licensing terms. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇