ama-mcp
An MCP server that coordinates multiple Claude Code sessions through kitty terminal remote control to enable a manager-worker delegation workflow. It supports task dependency tracking, inter-agent communication, and automated status monitoring across multiple terminal windows.
README
ama-mcp
MCP server that coordinates multiple Claude Code sessions through a shared state file and kitty terminal notifications.
Agents register at startup. A manager delegates tasks, workers receive them via MCP tools, and kitty sends a nudge ("doorbell") so agents know to check. All message content flows through the state file — kitty never carries the actual message, just the notification.
Requirements
- kitty terminal with
allow_remote_control socket-onlyandlisten_onconfigured - Claude Code CLI
- Node.js 18+
kitty config
# ~/.config/kitty/kitty.conf
allow_remote_control socket-only
listen_on unix:/tmp/kitty-sock-{kitty_pid}
Setup
npm install
Add to your Claude Code MCP config (~/.claude/settings.json):
{
"mcpServers": {
"agent-manager": {
"command": "node",
"args": ["/path/to/ama-mcp/index.mjs"]
}
}
}
Tools
All agents
| Tool | Description |
|---|---|
register(manager?, session_id?, name?) |
Register this agent. All agents call at session start. |
chat(message, to?) |
Send a message + kick recipient. Omit to for manager. |
wait_for_task(timeout?) |
Block until a task or message arrives. |
my_task() |
Show own task and read unread messages. |
task_done(agent?) |
Mark own task done, or another's (manager only). |
task_list() |
List active tasks and registered agents. |
Manager-only
| Tool | Description |
|---|---|
delegate(agent, description, message, after?, friendly_name?) |
Assign a tracked task + kick agent. |
name_agent(agent, friendly_name) |
Set a friendly name for an agent (e.g. "sims guy"). |
spawn(cwd?, win?) |
Launch a fresh claude agent in a new kitty tab. |
respawn(agent, win?) |
Resume a dead agent session in an idle kitty tab. |
unregister_manager(to?) |
Step down or hand off manager role. |
task_check(win) |
Read agent's kitty terminal (escape hatch). |
How it works
- Open several kitty windows, each running
claude. - Every agent calls
register()at startup. - One agent calls
register(manager=true)— becomes the manager, starts keepalive watcher. - Manager uses
delegate()to assign tasks — state file records the task, kitty kicks the agent. - Agent sees the kick, calls
wait_for_task()ormy_task()to get the task. - Agent works, uses
chat()to report back (kicks the manager). - Agent finishes, calls
task_done().
Task dependencies
delegate(agent=3, description="analyze results", message="...", after="w5-m1abc")
Task stays blocked until w5-m1abc is done, then activates and kicks the agent.
Notifications (📬)
Every kick sends ESC + 📬 + Enter to the agent's kitty window. The ESC interrupts blocking calls (wait_for_task). The 📬 appears as user input — when the agent sees it, it calls my_task() to read actual messages from the state file. No message content ever goes through the terminal.
Keepalive watcher
Background process (auto-started by register(manager=true)) polls every 45 seconds and kicks the manager when agents need attention. 5-minute cooldown between kicks.
State
Task and message state persists in ~/.claude/agent-tasks.json. Survives context compaction and session restarts. Agent registry tracks who's online and where to kick them.
Configuration
Add this to your CLAUDE.md (global or per-project) so every agent knows how to participate:
## Agent Manager
All sessions have the `agent-manager` MCP server. Call `register()` at session start. If you see **📬** as input, call `my_task()` — it means you have a new task or message.
If you're delegated a task but you're mid-work on something unrelated, push back via `chat()` — the manager can reassign.
Manager reference (optional)
managing-agents.md has detailed guidance for the manager session — tool usage, behavioral guidelines, intervention patterns. Symlink it and reference from your CLAUDE.md:
ln -s /path/to/ama-mcp/managing-agents.md ~/.claude/reference/managing-agents.md
- **managing-agents.md** — meta sessions, inter-agent communication, agent-manager MCP tools
Provenance
This was written almost entirely by Claude (Opus), with human direction on design and behavior. The code, docs, and commit messages are AI-generated. The human has not read the code.
License
MIT
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。