Mcp agent mail

From jleechanorg/claude-commands · View interactive version

Mcp agent mail is an AI agent skill from the GitHub repository jleechanorg/claude-commands. MCP Agent Mail - Inter-Agent Messaging and Coordination System

How to use this skill

Skill file

MCP Agent Mail - Inter-Agent Messaging and Coordination

This skill provides comprehensive setup and usage documentation for enabling agent-to-agent messaging and coordination via the MCP Agent Mail server.

📋 Overview

Purpose: Enable AI agents to communicate with each other through a message-passing system for coordinated work, project collaboration, and multi-agent workflows.

Core Capabilities:

🚀 Prerequisites

🛠️ MCP Agent Mail Server

Features

Configuration in `.claude/settings.json`

{
  "mcpServers": {
    "mcp-agent-mail": {
      "command": "python3",
      "args": [
        "/path/to/mcp-agent-mail/server.py",
        "--stdio"
      ]
    }
  }
}

🎯 Key Concepts

Agents

Agents are AI workers with unique identities registered in the system:

Projects

Projects are workspaces that scope agent communication:

Messages

Structured communications between agents:

📚 Common Workflows

1. Register an Agent

# Auto-generated name
register_agent(
    project_key="/abs/path/backend",
    program="claude-code",
    model="opus-4.1",
    task_description="Implementing auth system"
)

# Explicit name
register_agent(
    project_key="/abs/path/backend",
    program="codex-cli",
    model="gpt5-codex",
    name="BlueLake",
    task_description="Database migrations"
)

2. Send a Message

send_message(
    project_key="/abs/path/backend",
    sender_name="GreenCastle",
    to=["BlueLake"],
    subject="Auth API design review",
    body_md="Please review the attached API design...",
    importance="high",
    ack_required=True
)

3. Fetch Inbox

# Recent messages
messages = fetch_inbox(
    project_key="/abs/path/backend",
    agent_name="BlueLake",
    limit=20,
    include_bodies=True
)

# Urgent only
urgent = fetch_inbox(
    project_key="/abs/path/backend",
    agent_name="BlueLake",
    urgent_only=True
)

# Since last check
new_messages = fetch_inbox(
    project_key="/abs/path/backend",
    agent_name="BlueLake",
    since_ts="2025-10-23T00:00:00+00:00"
)

4. Reply to Message

reply_message(
    project_key="/abs/path/backend",
    message_id=1234,
    sender_name="BlueLake",
    body_md="I've reviewed the design. Here are my thoughts..."
)

5. Look Up Agent

agent_info = whois(
    project_key="/abs/path/backend",
    agent_name="BlueLake",
    include_recent_commits=True
)

🔄 Integration Patterns

Multi-Agent Workflows

Orchestrated Work:

  1. Coordinator Agent assigns tasks via messages
  2. Worker Agents fetch inbox for assignments
  3. Workers send progress updates
  4. Coordinator aggregates results

Peer Collaboration:

  1. Agent A sends question/request
  2. Agent B fetches inbox, sees message
  3. Agent B replies with answer/result
  4. Agent A polls for reply

Project Coordination

Example: PR Review Workflow

  1. PR Agent analyzes pull request
  2. PR Agent sends findings to Security Agent and Test Agent
  3. Security Agent reviews security implications
  4. Test Agent validates test coverage
  5. Both reply with approvals/concerns
  6. PR Agent aggregates feedback

🎯 `/processmsgs` Command Usage

The /processmsgs command processes agent messages (not emails):

# Process all unread agent messages
/processmsgs

# Process messages from specific sender
/processmsgs sender:BlueLake

# Process urgent messages only
/processmsgs urgent

What it does:

  1. Fetches unread messages from agent inbox
  2. Classifies messages by importance
  3. Drafts replies for action-required messages
  4. Marks messages as read
  5. Reports summary of processed messages

🔐 Security & Privacy

Access Control:

Data Handling:

📊 Message Categories

URGENT: High-priority, time-sensitive communications

ACTION_REQUIRED: Requires response or action

INFORMATION: Status updates, notifications

🛡️ Error Handling

Common Issues:

MCP server unavailable:

Agent not registered:

Message not found:

🎓 Examples

Multi-Agent Code Review

Agent 1 (Reviewer):

send_message(
    project_key="/abs/path/backend",
    sender_name="ReviewBot",
    to=["CodeBot", "SecurityBot"],
    subject="PR #123 Review Request",
    body_md="Please review PR #123 for security and code quality",
    importance="high"
)

Agent 2 (Security):

# Fetch inbox
messages = fetch_inbox(project_key="/abs/path/backend", agent_name="SecurityBot")

# Reply
reply_message(
    project_key="/abs/path/backend",
    message_id=messages[0]['id'],
    sender_name="SecurityBot",
    body_md="✅ No security issues found"
)

Task Coordination

Coordinator:

send_message(
    project_key="/abs/path/backend",
    sender_name="Coordinator",
    to=["WorkerA", "WorkerB"],
    subject="Task Assignment: Database Migration",
    body_md="""
## Tasks
- WorkerA: Create migration scripts
- WorkerB: Test migration on staging
    """
)

Worker:

# Check inbox
tasks = fetch_inbox(project_key="/abs/path/backend", agent_name="WorkerA")

# Complete work and report
reply_message(
    project_key="/abs/path/backend",
    message_id=tasks[0]['id'],
    sender_name="WorkerA",
    body_md="✅ Migration scripts created and tested"
)

🔗 Related Tools

⚙️ Best Practices

DO:

DON'T:

🎯 Success Criteria

Effective agent communication when:

  1. ✅ Agents registered in project
  2. ✅ Messages clearly structured
  3. ✅ Threading maintained for conversations
  4. ✅ Inbox checked regularly
  5. ✅ Replies sent in timely manner
  6. ✅ Message status tracked (read/unread)
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.