MCP 智能体邮件通信
mcp-agent-mail
MCP Agent Mail——智能体间消息传递与协调系统。
- License 许可
- MIT
- 最近更新
- 2026-11-14
- Stars
- ★ 6
- Forks
- 0
01 前言 Front Matter
- type
- setup
- scope
- project
- description
- MCP Agent Mail - Inter-Agent Messaging and Coordination System
02 资源文件 4
- 参考文档references/best-practices.md905 B
- 参考文档references/errors.md500 B
- 参考文档references/examples.md995 B
- 参考文档references/implementation.md1.8 KB
03 SKILL.md 正文
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:
- Register agents with unique identities
- Send messages between agents
- Reply to messages with threading
- Fetch inbox messages
- Mark messages as read
- Project-scoped communication
- Message threading and replies
- Agent discovery (whois lookup)
? Prerequisites
- Python 3.8+ installed
- MCP Agent Mail server configured
- Project workspace initialized
?️ MCP Agent Mail Server
Features
- Agent Registration: Create unique agent identities within projects
- Message Passing: Send structured messages between agents
- Threading: Reply to messages with conversation threading
- Inbox Management: Fetch and manage incoming messages
- Project Scoping: Messages are scoped to specific projects
- Agent Discovery: Look up agent profiles and recent activity
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:
- Name: Unique identifier (e.g., "BlueLake", "GreenCastle")
- Program: Agent type (e.g., "codex-cli", "claude-code")
- Model: Underlying model (e.g., "opus-4.1", "gpt5-codex")
- Task: Current focus/responsibility
Projects
Projects are workspaces that scope agent communication:
- Project Key: Unique identifier (e.g., "/abs/path/backend")
- Agents: Registered agents working on the project
- Messages: Project-scoped message history
Messages
Structured communications between agents:
- Subject: Message topic
- Body: Markdown-formatted content
- Recipients: To/CC/BCC lists
- Threading: Reply chains with thread IDs
- Metadata: Sender, timestamp, importance
? 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:
- Coordinator Agent assigns tasks via messages
- Worker Agents fetch inbox for assignments
- Workers send progress updates
- Coordinator aggregates results
Peer Collaboration:
- Agent A sends question/request
- Agent B fetches inbox, sees message
- Agent B replies with answer/result
- Agent A polls for reply
Project Coordination
Example: PR Review Workflow
- PR Agent analyzes pull request
- PR Agent sends findings to Security Agent and Test Agent
- Security Agent reviews security implications
- Test Agent validates test coverage
- Both reply with approvals/concerns
- 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:
- Fetches unread messages from agent inbox
- Classifies messages by importance
- Drafts replies for action-required messages
- Marks messages as read
- Reports summary of processed messages
? Security & Privacy
Access Control:
- Agents can only send messages if registered in project
- Messages are scoped to projects
- No cross-project message access
Data Handling:
- Messages stored in project-local Git repository
- Full audit trail via Git history
- No external API calls
? Message Categories
URGENT: High-priority, time-sensitive communications
- Blocking issues
- Critical decisions needed
- Deadline approaching
ACTION_REQUIRED: Requires response or action
- Review requests
- Questions needing answers
- Task assignments
INFORMATION: Status updates, notifications
- Progress reports
- Completed work notifications
- General updates
?️ Error Handling
Common Issues:
MCP server unavailable:
- Verify server configuration in settings.json
- Check server process is running
- Review server logs
Agent not registered:
- Call
register_agentfirst - Verify project_key matches
Message not found:
- Check message_id is correct
- Verify agent has access to project
? 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
- ensure_project: Initialize project for agent communication
- register_agent: Create agent identity
- send_message: Send message to other agents
- reply_message: Reply to message with threading
- fetch_inbox: Get incoming messages
- whois: Look up agent information
- mark_message_read: Mark message as processed
⚙️ Best Practices
DO:
- Register agents before sending messages
- Use descriptive agent names and task descriptions
- Include clear subjects in messages
- Reply to messages to maintain threading
- Use importance levels appropriately
- Poll inbox regularly for new messages
DON'T:
- Send messages before registering agent
- Use generic/unclear subjects
- Ignore thread context when replying
- Overuse urgent importance
- Forget to mark messages as read
? Success Criteria
Effective agent communication when:
- ✅ Agents registered in project
- ✅ Messages clearly structured
- ✅ Threading maintained for conversations
- ✅ Inbox checked regularly
- ✅ Replies sent in timely manner
- ✅ Message status tracked (read/unread)
04 同仓库更多 Skills
disk-reclaim-playbook
Use Disk Magician to diagnose disk growth or qualify cleanup on macOS or Linux.
claudea-bench
Compare `claudea` and normal `claude` on a fair split of comparable work by default; use `--strict` for duplicate runs of the exact same task.
pr
Alias for the canonical pr-lifecycle PR workflow skill (/pr-workflow, /prw).
whisper
OpenAI's general-purpose speech recognition model. Supports 99 languages, transcription, translation to English, and language identification. Six model sizes from tiny (39M params) to large (1550M params). Use for speech-to-text, podcast transcription, or multilingual audio processing. Best for robust, multilingual ASR.
webapp-testing
Toolkit for interacting with and testing local web applications using Playwright. Supports verifying frontend functionality, debugging UI behavior, capturing browser screenshots, and viewing browser logs.
pr-report
This skill should be used when the user asks for a PR report, PR audit, PR delta analysis, /pr-report, or wants per-PR summary with delta files/lines. Generates a structured report for one or more open PRs covering purpose, files changed, +/− line counts, /code-standards + /thermo review findings, /ponytail simplification opportunities, file-overlap combination candidates, and /green status per pr-green-definition. Output: machine-readable JSONL + human-readable markdown. Read-only by default; can apply simplifications if user opts in.