teammate-mcp
teammate-mcp
Lassen Sie Claude Code und OpenAI Codex sich gegenseitig Fragen über Ihre iTerm-Fenster stellen. Kein Daemon. Keine
.config, die Sie pro Projekt manuell bearbeiten müssen. Öffnen Sie einfach zwei Fenster und sie können miteinander kommunizieren.
┌──────────── iTerm window ─────────────┐
│ claude (left) codex (right) │
│ ─────────────────── ─────────────── │
│ > implement quoter > [teammate-mcp │
│ I'll ask Codex... ASK ... what │
│ ⏺ Codex answered: is 2+2?] │
│ 4 • 4 │
└───────────────────────────────────────┘teammate-mcp ist ein kleiner MCP-Server, der zwei Tools für das CLI bereitstellt, das ihn lädt:
mcp__teammate__ask_codex(question, timeout)— Aufruf von Claudemcp__teammate__ask_claude(question, timeout)— Aufruf von Codex
Der Server verwendet die iTerm2 Python API, um die Frage in das andere Fenster zu übertragen und die Antwort zurückzulesen. Das Zielfenster wird vom laufenden Prozess automatisch erkannt – Sie müssen keine Tabs beschriften oder irgendetwas pro Projekt vorkonfigurieren.
Warum?
Bestehende Multi-Agenten-Systeme lassen sich in zwei Kategorien einteilen:
Schwergewichtig: ein Daemon, Konfigurationsdateien pro Projekt, undurchsichtiger Sitzungsstatus. Großartig, bis um 2 Uhr morgens etwas kaputtgeht und man nicht sieht, warum.
Einzelprozess: Ein Modell, das Unteragenten intern orchestriert, sodass der Benutzer nur das Endergebnis sieht.
teammate-mcp zielt auf eine dritte Option ab: Die beiden Agenten laufen sichtbar
in Ihrem Terminal nebeneinander, Sie können beide Transkripte in Echtzeit lesen,
und die einzige "Infrastruktur" sind ein paar hundert Zeilen Python, die Text
übertragen und Bildschirminhalte lesen.
Related MCP server: claude-mux-iterm
Verifizierter bidirektionaler Roundtrip
Live aufgezeichnet während der Entwicklung auf macOS 14, iTerm 3.6.8, Claude Code 2.1.119 + Opus 4.7, Codex 0.125.0:
{"event":"ask.enqueue","id":"…c5d085","from_":"claude","to":"codex","len":49}
{"event":"ask.send", "id":"…c5d085","to":"codex","session_id":"7E39032F-…"}
{"event":"ask.complete","id":"…c5d085","answer_len":3}Das Intervall ask.send → ask.complete betrug 3,0 Sekunden für die
Aufforderung "Was ist zwei plus zwei? Antworte nur mit der Ziffer" – der Großteil
davon ist die Denkzeit von Codex, nicht die der Brücke. Fünf aufeinanderfolgende
Durchläufe schlossen den Kreislauf jeweils in 1,5 – 4,5 Sekunden.
Sechs unabhängige Zeitmessungsberichte, die in tests/results/ erfasst wurden,
sind im Repository enthalten, damit Sie die Zahlen selbst prüfen können.
Schnellstart
1. Installation
git clone https://github.com/jonghklee/teammate-mcp.git
cd teammate-mcp
uv venv
uv pip install -e .2. Registrieren Sie den Server bei beiden CLIs
# Claude Code
claude mcp add teammate -s user -- $PWD/.venv/bin/teammate-mcp serve
# Codex
codex mcp add teammate -- $PWD/.venv/bin/teammate-mcp serve3. Öffnen Sie die Fenster
Sie haben zwei Optionen:
Option A — lassen Sie bin/team ein neues iTerm-Fenster für Sie öffnen:
./bin/teamOption B — verwenden Sie ein beliebiges iTerm-Fenster, das bereits geöffnet ist.
Führen Sie einfach claude in einem Fenster und codex in einem anderen aus.
teammate-mcp findet sie anhand des Prozessnamens; keine Beschriftungen erforderlich.
4. (Einmalig) Geben Sie den Agenten die Betriebsregeln
Legen Sie templates/AGENTS.md in Ihr Projektstammverzeichnis. Sowohl Claude Code
als auch Codex werden sie automatisch erkennen (es ist die Konvention, der beide folgen).
Die Datei teilt ihnen mit, wie und wann sie sich gegenseitig aufrufen sollen.
5. Ausprobieren
Im Claude-Fenster:
Ask Codex what timezone library it prefers in Python and tell me what
it said.Sie werden sehen, wie Claude mcp__teammate__ask_codex aufruft, die Frage im
rechten Fenster erscheint, Codex antwortet und Claude die Antwort weiterleitet.
Funktionsweise
┌──────────────────────────────────────────────────────┐
│ Claude pane Codex pane │
│ ───────────── ───────────── │
│ user prompt [teammate-mcp ASK …] │
│ │ tool call ▲ │
│ ▼ │ async_send_text │
│ ┌──────────────┐ │ │
│ │ teammate-mcp │ ─────────────┘ │
│ │ (FastMCP) │ ◄────── async_get_screen_contents │
│ └──────────────┘ │
│ │ │
│ └─► returns extracted answer to Claude │
└──────────────────────────────────────────────────────┘Für jeden ask_codex (oder ask_claude) Aufruf:
Generieren Sie einen eindeutigen Marker, stellen Sie die Nachricht in die festplattenbasierte Warteschlange (
pending/→inflight/atomares Umbenennen).Lokalisieren Sie das Zielfenster:
bevorzugen Sie die Umgebungsvariable
TEAMMATE_<UPPER>_SESSION_IDandernfalls listen Sie alle laufenden Prozesse auf (
ps-Stil), finden Sie jedenclaude- odercodex-Prozess, lesen Sie dessenTERM_SESSION_IDUmgebungsvariable und gleichen Sie diese mit der Sitzungsliste von iTerm ab. Dies funktioniert übertmux, Login-Shells und pyenv-Wrapper – überall dort, wo die Umgebungsvariable vererbt wird.greifen Sie auf
jobName/commandLineAbgleich mit bevorzugtem Arbeitsverzeichnis (cwd) zurück.
async_send_textüberträgt den Prompt + eine Anforderung, die Antwort mit dem Marker zu beenden.Pollen Sie
async_get_screen_contentsnach dem Marker. Da der von uns eingegebene Prompt den Markertext enthält (er wird im Fenster wiederholt), erfordert der Server, dass der Marker zweimal erscheint, bevor die Antwort als vollständig betrachtet wird.Schneiden Sie die Antwort zwischen den beiden Marker-Vorkommen aus, protokollieren Sie
ask.completeund geben Sie die Antwort an den Aufrufer zurück.
Was "keine Konfiguration" tatsächlich bedeutet
Es gibt genau eine Sache, die (einmalig) konfiguriert werden muss: die MCP-Registrierung in Schritt 2 oben. Danach funktioniert jedes iTerm-Fenster mit claude+codex-Fenstern einfach so – einschließlich Fenstern, die bereits vor der Installation von teammate-mcp geöffnet waren.
Sie schreiben niemals eine .teammate.toml, Sie führen niemals teammate start aus,
Sie müssen sich nie merken, welche Sitzungs-ID welche ist.
Testen
uv pip install -e ".[dev]"
pytest # 18 unit + integration tests
python scripts/auto_demo.py # full end-to-end demo (spawns iTerm)Die Unit-Tests decken die Warteschlange, die ANSI/Marker-Verarbeitung, den Server-Modul-Import und die iTerm-Sitzungserkennungslogik mit Mocks ab. Die End-to-End-Demo öffnet ein echtes iTerm-Fenster und führt einen Claude → Codex → Claude Roundtrip durch; dies erfordert, dass beide CLIs eingeloggt sind, und verursacht deren normale API-Gebühren.
Zeitberichte pro Durchlauf werden in tests/results/*.jsonl geschrieben. Diejenigen,
die bereits im Repository enthalten sind, sind echt, nicht synthetisch.
Fehlerbehebung
"iTerm Python API is not enabled" — Einstellungen → Allgemein → Magic →
"Enable Python API" ✓. Wenn sich teammate-mcp zum ersten Mal verbindet, fragt iTerm
ebenfalls nach der Erlaubnis; klicken Sie auf Allow.
"asyncio.run() cannot be called from a running event loop" — Sie verwenden eine
teammate-mcp-Version älter als 0.1.0. Führen Sie git pull main aus; die Tools sind
jetzt als async deklariert.
"Tool returned an answer that's just my own prompt echo" — das Ziel-Fenster für den Prompt führt das falsche CLI aus (z. B. hat die Suche ein Geschwisterfenster gefunden, das denselben Prozess ausführte). Pinnen Sie das Fenster explizit:
export TEAMMATE_CLAUDE_SESSION_ID=<unique id from iTerm>
export TEAMMATE_CODEX_SESSION_ID=<unique id from iTerm>(Sie können die unique id jedes Fensters über Window menu → Window Settings → Identifier
oder via AppleScript lesen.)
"Marker not detected within timeout" — der Agent auf der anderen Seite hat vergessen,
<<DONE_…>> auszugeben. Fügen Sie eine explizite Erinnerung in Ihre AGENTS.md ein.
Die mitgelieferte Vorlage enthält dies bereits.
Lizenz
MIT — siehe LICENSE.
Danksagungen
Dieses Projekt kristallisierte sich aus Gesprächen über öffentliche Forschung dazu heraus, wie Claude Code und Codex im Jahr 2026 betrieben werden:
Anthropics Plan-Generate-Verify und Initializer + Coding Agent Harness-Papiere (Rajasekaran 2026-03; Justin Young 2025-11).
IndyDevDans
claude-code-hooks-masteryfür die Observability-Muster.OthmanAdis
planning-with-filesfür die Idee "strukturierte Dateien überbrücken Sitzungen, nicht den Chatverlauf".Boris Chernys "Verifizierungsschleifen"-Regel aus seinem How I use Claude Code-Thread.
Geoffrey Huntleys Ralph Wiggum Schleife für die Intuition "frischer Kontext pro Durchgang".
Die Implementierung verdankt ihre iTerm Python API-Muster den iTerm2-Dokumenten unter https://iterm2.com/python-api/.
Zusammenfassung (Koreanisch)
Dies ist ein kleiner MCP-Server, der es claude / codex ermöglicht, sich gegenseitig Fragen zu stellen, ohne dass eine Vorabkonfiguration wie CCB erforderlich ist.
Öffnen Sie einfach
claudeundcodexin zwei iTerm-Fenstern. Es gibt keine Labels, keine Config und keinen Daemon.Die iTerm Python API erkennt das Gegenfenster automatisch (Abgleich von laufendem Prozess + Umgebungsvariable
TERM_SESSION_ID) – es funktioniert auch innerhalb vontmux.Nachrichten werden per Push übertragen, Antworten per Polling empfangen, und jeder Roundtrip wird in
~/.teammate-mcp/logs/<Datum>.jsonlprotokolliert.Gemessene Roundtrip-Zeit: 3,0 Sekunden für eine 2 + 2 = 4 Frage (send → complete) (hauptsächlich Codex-Denkzeit).
Die Installation erfolgt über die Schritte 1-3 des englischen Schnellstarts, die Verwendung ist einfach: Bitten Sie Claude wie gewohnt: "Frag Codex danach".
Available Tools
4 toolsask_claudeA
Ask the Claude pane a question and return its answer.
Use this from Codex when you want Claude's plan, design feedback, or a sanity check.
| Name | Required | Description | Default |
|---|---|---|---|
| question | Yes | ||
| timeout | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description must carry full burden. It only states it returns an answer, but does not disclose potential side effects, timeout behavior, or whether it is a read-only operation. The agent lacks critical behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is concise with only two short sentences, no redundant information, and the primary action is front-loaded. Every word adds value.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
The tool is simple with 2 parameters and an output schema, but the description lacks detail on the output format and usage constraints. An agent can infer basic usage but may miss nuances like timeout meaning or question style expectations.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 0%, yet the description adds no information about the 'question' or 'timeout' parameters beyond what the schema provides. For a tool with 2 parameters and no enum constraints, the description should compensate but fails to do so.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb 'Ask' and the resource 'Claude pane', specifying that it returns an answer. The sibling tool 'ask_codex' helps differentiate, making the purpose unambiguous.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description explicitly recommends using this tool for 'plan, design feedback, or a sanity check' from Codex, providing clear context. However, it does not mention when to avoid using this tool in favor of alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
ask_codexB
Ask the Codex pane a question and return its answer.
Use this from Claude when you want Codex's opinion, a code review, or to delegate execution to it.
| Name | Required | Description | Default |
|---|---|---|---|
| question | Yes | ||
| timeout | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations provided, and the description lacks behavioral details such as side effects, authentication requirements, rate limits, or any constraints. Merely states it returns an answer without elaboration.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three sentences, no fluff. First sentence is clear; second adds usage guidance. Could be slightly more efficient, but overall well-structured for a simple tool.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Lacks details on return value format despite having an output schema. No information on how Codex processes the question or what happens with the timeout. Minimal guidance for an agent to use effectively.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, meaning no parameter descriptions in schema. The description does not explain the 'question' or 'timeout' parameters at all, adding zero value beyond the parameter names.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
Clearly states the verb 'ask' and the resource 'Codex pane', with explicit mention of returning an answer. Distinguishes from sibling 'ask_claude' by naming Codex specifically.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly says 'Use this from Claude when you want Codex's opinion, a code review, or to delegate execution to it', providing clear context and implicitly contrasting with alternatives.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
broadcastB
Push a message to both panes without waiting for a reply.
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
Without annotations, the description carries the burden. It discloses the key behavior of not waiting for a reply, but omits other behavioral traits like side effects, required permissions, or whether the message is stored. This is adequate for a simple tool but not comprehensive.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single sentence with no extraneous words. It is appropriately sized and front-loaded with the key action.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (1 parameter, output schema exists), the description is minimally complete. It covers the core action and behavioral note, but does not explain 'both panes' or provide any usage context. It meets the minimum viability for a simple tool.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema description coverage is 0%, so the description must compensate. It says 'message' but adds no detail beyond the schema's type string. It does not explain format, constraints, or expected values, which is insufficient for a parameter with no description in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool pushes a message to both panes without waiting for a reply, using a specific verb and resource. This distinguishes it from sibling tools like ask_claude and ask_codex, which likely expect replies, and queue_status for status checks.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description provides no guidance on when to use this tool over alternatives. It does not mention when not to use it or compare it to sibling tools, leaving the agent to infer usage.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
queue_statusA
Return queue counts + recent completions (debugging).
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, but the description clearly indicates it is a non-destructive read (returning counts and completions). There is no behavior beyond what is described, and no contradictions. A slight deduction for not explicitly stating read-only nature.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise: a single sentence that immediately states the tool's purpose and context. No fluff or redundant information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given zero parameters and no output schema, the description sufficiently describes the tool's output. It could be considered complete for a simple status check, though mentioning any authentication or availability requirements would improve completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The input schema has no parameters (0 params, 100% coverage). The description adds value by specifying the return content (queue counts + recent completions). Baseline 4 is appropriate since the schema carries no burden.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool returns queue counts and recent completions, with 'debugging' context. It identifies the specific resource (queue status) and verb (return). It is well distinguished from siblings like ask_claude, ask_codex, and broadcast.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
The description implies usage for debugging via the parenthetical '(debugging)'. It does not explicitly state when to use vs. alternatives or when not to use, but the siblings are sufficiently different, so the guidance is adequate but minimal.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
4 tool updates
v0.1.0- First observed
ask_claude - First observed
ask_codex - First observed
broadcast - First observed
queue_status
TDQS
Scored across 4 tools
Each tool has a distinct purpose: ask_claude and ask_codex target specific panes, broadcast sends to both without waiting, and queue_status provides debugging info. No overlap.
All tool names use lowercase with underscores and follow a consistent verb_noun pattern (ask_claude, ask_codex, queue_status) or are a clear verb (broadcast).
4 tools is well-scoped for the server's purpose of inter-pane communication, covering questioning each pane, broadcasting, and status monitoring.
Core workflows are covered, but a minor gap exists: there is no tool to send a one-way message to a specific pane without expecting a reply (only broadcast to both).
Maintenance
Related MCP Connectors
Share context and questions between Claude instances — VS Code, claude.ai web, and mobile.
Use your Mac, Windows or Linux computer from ChatGPT, Claude or Codex: files, commands, documents.
Work on your own computers from Claude or ChatGPT: run commands, edit and search files.
Shared memory for AI tools: save once, recall word for word from Claude, ChatGPT, Codex or Gemini.
Related MCP Servers
- AlicenseAqualityDmaintenanceOrchestrates multiple Claude Code agents across iTerm2 sessions with process-level isolation, enabling collaborative AI development workflows on multiple codebases with task-based inter-agent communication and persistent state management.71MIT
- AlicenseAqualityCmaintenanceEnables communication between Claude Code sessions in iTerm2 panes, primarily for notifying other sessions when a PR is merged to main so they can pull latest changes.6MIT
- AlicenseNot gradedqualityCmaintenanceEnables Claude Desktop to spawn new Claude Code instances in iTerm2 windows for interactive coding sessions.13 npmMIT
- FlicenseNot gradedqualityDmaintenanceGives Claude Code terminal control and multi-agent coordination through tmux sessions.4-