MCP server that implements Claude Code's agent teams protocol.
opencode-claude-teams.mov
Claude Code has a built-in agent teams feature that lets multiple Claude Code instances coordinate as a team -- shared task lists, inter-agent messaging, and tmux-based spawning. But the protocol is internal, tightly coupled to Claude Code's own tooling.
This MCP server reimplements that protocol as a standalone MCP server, making it available to any MCP client: Claude Code, OpenCode, or anything else that speaks MCP.
The implementation is based on a deep dive into Claude Code's internals and experimentation with the feature. It may not perfectly match every aspect of Claude Code's native implementation. PRs are welcome.
Add to your project's .mcp.json (Claude Code):
{
"mcpServers": {
"claude-teams": {
"command": "uvx",
"args": ["--from", "git+https://github.com/cs50victor/claude-code-teams-mcp", "claude-teams"]
}
}
}Or add to ~/.config/opencode/opencode.json (OpenCode):
{
"mcp": {
"claude-teams": {
"type": "local",
"command": ["uvx", "--from", "git+https://github.com/cs50victor/claude-code-teams-mcp", "claude-teams"],
"enabled": true
}
}
}- Python 3.12+
- tmux
- At least one coding agent CLI on PATH:
- Claude Code (
claude) - OpenCode (
opencode)
- Claude Code (
- For OpenCode teammates:
OPENCODE_SERVER_URLmust be set (for example,http://localhost:4096)
| Tool | Description |
|---|---|
team_create |
Create a new agent team. One team per server session. |
team_delete |
Delete a team and all its data. Fails if teammates are still active. |
spawn_teammate |
Spawn a teammate in tmux (pane by default, window when USE_TMUX_WINDOWS is set). |
send_message |
Send direct messages, broadcasts, shutdown/plan approval responses. |
read_inbox |
Read messages from an agent's inbox. |
poll_inbox |
Long-poll an inbox for new messages (up to 30s). |
read_config |
Read team configuration and member list. |
task_create |
Create a new task with auto-incrementing ID. |
task_update |
Update task status, owner, dependencies, or metadata. |
task_list |
List all tasks for a team. |
task_get |
Get full details of a specific task. |
force_kill_teammate |
Forcibly kill a teammate's tmux pane/window and clean up. |
process_shutdown_approved |
Remove a teammate after graceful shutdown approval. |
- Spawning: Teammates launch in tmux via
tmux split-window(default) ortmux new-windowwhenUSE_TMUX_WINDOWSis set. Backend can be Claude (claude) or OpenCode (opencode). Each gets a unique agent ID (name@team) and color. - Messaging: JSON-based inboxes under
~/.claude/teams/<team>/inboxes/. File locking (fcntl) prevents corruption from concurrent reads/writes. - Tasks: JSON task files under
~/.claude/tasks/<team>/. Tasks have status tracking, ownership, and dependency management (blocks/blockedBy). - Concurrency safety: Atomic writes via
tempfile+os.replacefor config.fcntlfile locks for inbox operations.
~/.claude/
├── teams/<team-name>/
│ ├── config.json # team config + member list
│ └── inboxes/
│ ├── team-lead.json # lead agent inbox
│ ├── worker-1.json # teammate inboxes
│ └── .lock
└── tasks/<team-name>/
├── 1.json # task files (auto-incrementing IDs)
├── 2.json
└── .lock