teammate-mcp
teammate-mcp
Deja que Claude Code y OpenAI Codex se hagan preguntas entre sí a través de tus paneles de iTerm. Sin demonios. Sin archivos
.configque tengas que editar manualmente por proyecto. Solo abre dos paneles y podrán hablar.
┌──────────── 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 es un pequeño servidor MCP que expone dos herramientas a cualquier
CLI que lo cargue:
mcp__teammate__ask_codex(question, timeout)— llamar desde Claudemcp__teammate__ask_claude(question, timeout)— llamar desde Codex
El servidor utiliza la API de Python de iTerm2 para enviar la pregunta al otro panel y leer la respuesta. El panel de destino es detectado automáticamente por el proceso en ejecución: no etiquetas pestañas, no preconfiguras nada por proyecto.
¿Por qué?
Los arneses multi-agente existentes caen en dos campos:
Pesados: un demonio, archivos de configuración por proyecto, estado de sesión opaco. Genial hasta que algo se rompe a las 2 a.m. y no puedes ver por qué.
Proceso único: un modelo que orquesta subagentes internamente, por lo que el usuario solo ve la respuesta final.
teammate-mcp apunta a una tercera opción: los dos agentes se ejecutan visiblemente
en tu terminal uno al lado del otro, puedes leer ambas
transcripciones en tiempo real, y la única "infraestructura" son unos pocos
cientos de líneas de Python que envían texto y leen pantallas.
Related MCP server: claude-mux-iterm
Viaje de ida y vuelta bidireccional verificado
Capturado en vivo durante el desarrollo en 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}El intervalo ask.send → ask.complete fue de 3.0 segundos para un
prompt de "¿Cuánto es dos más dos? Responde solo con el dígito" — la mayor
parte es tiempo de pensamiento de Codex, no del puente. Cinco ejecuciones consecutivas
cerraron el ciclo en 1.5 – 4.5 segundos.
Se incluyen seis informes de tiempo independientes capturados en tests/results/ en
el repositorio para que puedas auditar los números tú mismo.
Inicio rápido
1. Instalar
git clone https://github.com/jonghklee/teammate-mcp.git
cd teammate-mcp
uv venv
uv pip install -e .2. Registrar el servidor con ambas CLI
# 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. Abrir los paneles
Tienes dos opciones:
Opción A — deja que bin/team abra una ventana nueva de iTerm para ti:
./bin/teamOpción B — usa cualquier ventana de iTerm que ya tengas abierta. Solo ejecuta
claude en un panel y codex en otro. teammate-mcp los encuentra
por nombre de proceso; no se necesitan etiquetas.
4. (Una sola vez) Entrega a los agentes las reglas de operación
Coloca templates/AGENTS.md en la raíz de tu proyecto. Tanto Claude Code
como Codex lo detectarán automáticamente (es la convención que
ambos siguen). El archivo les indica cómo y cuándo llamarse entre sí.
5. Pruébalo
En el panel de Claude:
Ask Codex what timezone library it prefers in Python and tell me what
it said.Verás a Claude llamar a mcp__teammate__ask_codex, la pregunta
aparecer en el panel de la derecha, Codex responder, y Claude transmitir la
respuesta.
Cómo funciona
┌──────────────────────────────────────────────────────┐
│ 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 │
└──────────────────────────────────────────────────────┘Para cada llamada ask_codex (o ask_claude):
Generar un marcador único, encolar el mensaje en la cola del disco (
pending/→inflight/renombrado atómico).Localizar el panel de destino:
preferir la anulación de entorno
TEAMMATE_<UPPER>_SESSION_IDde lo contrario, enumerar todos los procesos activos (estilo
ps), encontrar cualquier procesoclaudeocodex, leer su variable de entornoTERM_SESSION_ID, y compararla con la lista de sesiones de iTerm. Esto funciona a través detmux, shells de inicio de sesión y wrappers de pyenv — donde sea que la variable de entorno sea heredada.recurrir a la coincidencia de
jobName/commandLinecon preferencia de cwd.
async_send_textel prompt + una solicitud para terminar la respuesta con el marcador.Sondear
async_get_screen_contentspara el marcador. Debido a que el prompt que escribimos contiene el texto del marcador (se hace eco en el panel), el servidor requiere que el marcador aparezca dos veces antes de tratar la respuesta como completa.Cortar la respuesta entre las dos apariciones del marcador, registrar
ask.complete, devolver la respuesta al llamador.
Qué significa realmente "sin configuración"
Hay exactamente una cosa que configurar (una vez): el registro MCP en el paso 2 anterior. Después de eso, cualquier ventana de iTerm con paneles claude+codex simplemente funciona, incluidas las ventanas que ya estaban abiertas antes de que instalaras teammate-mcp.
Nunca escribes un .teammate.toml, nunca haces teammate start, nunca tienes
que recordar qué id de sesión es cuál.
Pruebas
uv pip install -e ".[dev]"
pytest # 18 unit + integration tests
python scripts/auto_demo.py # full end-to-end demo (spawns iTerm)Las pruebas unitarias cubren la cola, el manejo de ANSI/marcador, la importación del módulo del servidor y la lógica de descubrimiento de sesiones de iTerm con mocks. La demostración de extremo a extremo abre una ventana real de iTerm y ejercita un viaje de ida y vuelta Claude → Codex → Claude; requiere que ambas CLI hayan iniciado sesión e incurrirá en sus cargos normales de API.
Los informes de tiempo por ejecución se escriben en tests/results/*.jsonl.
Los que ya están confirmados en el repositorio son reales, no sintéticos.
Solución de problemas
"iTerm Python API is not enabled" — Ajustes → General → Magic →
"Enable Python API" ✓. La primera vez que teammate-mcp se conecta, iTerm
también solicita permiso; haz clic en Allow.
"asyncio.run() cannot be called from a running event loop" — estás
en una versión de teammate-mcp anterior a la 0.1.0. Haz un pull de main; las herramientas ahora
se declaran async.
"Tool returned an answer that's just my own prompt echo" — el panel de destino del prompt está ejecutando la CLI incorrecta (por ejemplo, la búsqueda eligió un panel hermano que tenía el mismo proceso ejecutándose). Fija el panel explícitamente:
export TEAMMATE_CLAUDE_SESSION_ID=<unique id from iTerm>
export TEAMMATE_CODEX_SESSION_ID=<unique id from iTerm>(Puedes leer el unique id de cada panel desde
Window menu → Window Settings → Identifier, o a través de AppleScript.)
"Marker not detected within timeout" — el agente en el otro extremo
olvidó emitir <<DONE_…>>. Agrega un recordatorio explícito en tu
AGENTS.md. La plantilla incluida ya lo incluye.
Licencia
MIT — ver LICENSE.
Agradecimientos
Este proyecto se cristalizó a partir de conversaciones sobre investigaciones públicas sobre cómo se están ejecutando Claude Code y Codex en 2026:
Los documentos de arneses Plan-Generate-Verify e Initializer + Coding Agent de Anthropic (Rajasekaran 2026-03; Justin Young 2025-11).
claude-code-hooks-masteryde IndyDevDan para los patrones de observabilidad.planning-with-filesde OthmanAdi para la idea de "archivos estructurados que unen sesiones, no historial de chat".La regla del "bucle de verificación" de Boris Cherny de su hilo How I use Claude Code.
El bucle Ralph Wiggum de Geoffrey Huntley para la intuición de "contexto fresco por turno".
La implementación debe sus patrones de API de Python de iTerm a los documentos de iTerm2 en https://iterm2.com/python-api/.
Resumen en coreano
Es un pequeño servidor MCP que permite que claude / codex se hagan preguntas entre sí sin configuraciones previas como CCB.
Solo tienes que abrir
claudeycodexen dos paneles de iTerm. No hay etiquetas, ni configuración, ni demonios.Detecta automáticamente el panel opuesto con la API de Python de iTerm (proceso en ejecución + coincidencia de variable de entorno
TERM_SESSION_ID) — funciona incluso si se abre dentro detmux.Los mensajes se envían mediante push, las respuestas se reciben mediante polling, y todos los viajes de ida y vuelta se registran en
~/.teammate-mcp/logs/<fecha>.jsonl.Tiempo de ida y vuelta medido: 3.0 segundos para send → complete basado en la pregunta 2 + 2 = 4 (la mayor parte es el tiempo de pensamiento de Codex).
La instalación sigue los pasos 1~3 del inicio rápido en inglés, y para usarlo, simplemente pídele a Claude como siempre: "Pregúntale a Codex".
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-