Skip to main content
Glama

claude-gemini-mcp

Servidor MCP local para que Claude Code sea el arquitecto (piensa, decide, define criterios de aceptación y aprueba) y Gemini sea el obrero (implementa) mediante Antigravity CLI (agy) con tu licencia Google AI Pro. Objetivo: ahorrar cuota de Claude sin perder control de calidad.

Claude ──create_task(spec + ACs)──► servidor ──► worktree aislado (rama gemini/T-000N)
                                       │
                                       ├─ loop interno (sin Claude): agy -p → commit → checks (ACs command) → reintento
                                       │
Claude ◄──── reporte compacto (≤3.000 chars) ◄┘
Claude ──submit_review(approve | revise + feedback | reject)──► nueva ronda o cierre
Claude ──finish_task(merge | keep | discard)

Por qué existe

Se investigaron proyectos open source (nov-2026). Ninguno cubría a la vez Claude-arquitecto + Gemini-obrero + loop con criterios de aceptación:

Este proyecto toma la división de roles del primero y el loop con ACs del segundo. Diseño completo: docs/superpowers/specs/2026-11-30-claude-gemini-orchestra-design.md.

Related MCP server: relevo

Requisitos

  • Windows 11 (también funciona en Linux/macOS), Python ≥ 3.11, git ≥ 2.30, Git Bash (para ACs con sintaxis bash).

  • Antigravity CLI (agy) instalado y con sesión iniciada con tu cuenta AI Pro. Desde 2026-06-18 Gemini CLI dejó de servir cuentas personales/AI Pro; agy es el reemplazo oficial.

Instalación

.\scripts\install.ps1

Crea .venv, instala el paquete, copia la skill gemini-architect a ~/.claude/skills/ y una config de ejemplo a ~/.claude-gemini-mcp/config.toml. Después registra el MCP (el script imprime la ruta exacta):

claude mcp add gemini-worker -s user -- "C:\ruta\a\claude-gemini-mcp\.venv\Scripts\python.exe" -m claude_gemini_mcp

Reinicia Claude Code y pide, por ejemplo: "delega a Gemini: añade paginación al endpoint /users con tests".

Herramientas MCP

Tool

Uso

create_task

Crea la tarea: spec, ACs (command/review), seed_files (tests protegidos), copy_untracked, setup_command

run_task / wait_task

Ejecuta el loop interno y espera (devuelve running si tarda más de wait_seconds)

get_diff / get_log

Detalle bajo demanda (diff por archivo, cola del log de Gemini)

submit_review

approve / revise (feedback por AC → nueva ronda) / reject

finish_task

merge (squash en tu rama base), keep, discard

list_tasks

Estado de las tareas

Configuración (~/.claude-gemini-mcp/config.toml)

Ver config.example.toml. Claves: agy_path, agy_args (placeholders {prompt_file}, {model}), model, agy_timeout_s, ac_shell, bash_path, report_max_chars, prompt_template. Variables de entorno: CGM_DATA_DIR, CGM_CONFIG.

El prompt completo para Gemini se escribe en <worktree>/.cgm/prompt.md y agy recibe una instrucción corta que apunta a ese archivo (evita el límite de longitud de línea de comandos de Windows). Plantilla editable: src/claude_gemini_mcp/prompts/worker.md.

Timeouts de Claude Code: run_task espera hasta 540 s por defecto. Si tu Claude Code corta antes las llamadas MCP, baja wait_seconds o sube MCP_TOOL_TIMEOUT.

Garantías

  • Tu rama y tu árbol de trabajo no se tocan hasta finish_task(merge), que exige árbol limpio y estar en la rama base.

  • Solo los checks deterministas marcan ACs command como pass; solo Claude aprueba.

  • Archivos protegidos (y seed_files) modificados por Gemini se revierten y se reportan.

  • copy_untracked (p. ej. .env) y lo que cree setup_command nunca se commitean.

  • Presupuestos: 3 iteraciones internas × 3 rondas por defecto.

  • Varias sesiones de Claude Code pueden compartir el estado: cada tarea en curso registra el PID de su sesión, y las demás no la interrumpen ni la relanzan. Los IDs se reservan de forma atómica.

  • En Windows, agy y los checks corren dentro de un Job Object: si el servidor muere (aunque sea forzado), sus procesos hijos mueren con él.

Seguridad

agy ejecuta comandos en tu máquina con tus permisos. El worktree aísla el código, no el sistema. Usa el modo de permisos de agy más restrictivo que te funcione (p. ej. --mode auto con sandbox, vía agy_args). Las transcripciones quedan locales en ~/.claude-gemini-mcp/runs/.

Desarrollo

.\.venv\Scripts\python -m pytest -q

Las pruebas usan un agy falso (tests/fake_agy.py); no gastan cuota.

Estado verificado

  • Suite automatizada con agy simulado: verde (incluye una prueba sobre el transporte stdio real).

  • Prueba real (2026-11-30, Windows 11, agy 1.5.20, cuenta AI Pro, flags por defecto): tarea fizzbuzz con un test de aceptación sembrado y un AC de revisión. Gemini implementó en 1 iteración (~110 s), AC-1 pasó, reporte de 460 caracteres, approve + merge produjo un único commit squash en main y limpió worktree y rama.

  • Con agy 1.5.20 los argumentos por defecto (-p "<instrucción>") bastan: en modo print agy edita archivos y ejecuta comandos sin pedir confirmación. Para más aislamiento puedes añadir "--sandbox" a agy_args.

Available Tools

8 tools
create_taskB

Create a Gemini task in an isolated git worktree/branch (gemini/) from the repo's HEAD. seed_files {path: content} are your acceptance tests: committed first and protected from Gemini. copy_untracked (e.g. ['.env']) are copied but never committed. setup_command runs once (e.g. venv + deps).

Inputs: spec (required), title (required), repo_path (required), acceptance_criteria (required), +7 more. Returns: result

finish_taskA

merge: squash into the base branch (approved only; user's tree must be clean). keep: leave the branch. discard: delete worktree and branch. Ask the user before merge.

Inputs: action (required), task_id (required). Returns: result

get_diffC

Diff of Gemini's changes (optionally one file). Request only what you need to review.

Inputs: task_id (required), path, max_lines. Returns: result

get_logA

Tail of Gemini's raw transcript for one iteration. Use only to diagnose agent_error.

Inputs: round (required), task_id (required), iteration (required), tail_lines. Returns: result

list_tasksC

List tasks (id, status, round, title).

Inputs: repo_path. Returns: result

run_taskB

Start the automatic inner loop (Gemini works → command checks → retry) and wait up to wait_seconds. Returns the compact report, or 'running' (then call wait_task).

Inputs: task_id (required), wait_seconds. Returns: result

submit_reviewA

Your verdict. ac_results marks type=review ACs. approve requires every AC = pass. revise sends feedback to Gemini and runs a new round (returns its report). reject closes the task.

Inputs: task_id (required), verdict (required), feedback, ac_results, +2 more. Returns: result

wait_taskB

Keep waiting for a running task; returns the compact report when it stops.

Inputs: task_id (required), wait_seconds. Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 8 tools

    Disambiguation4/5

    Each tool maps to a distinct phase of the task lifecycle: create, run, wait, inspect diff, inspect log, review, finish, list. The only borderline pair is run_task and wait_task, but descriptions make the boundary clear (run_task starts the loop and waits up to wait_seconds; wait_task resumes waiting on an already-running task). get_diff vs get_log are also clearly separated by purpose (review changes vs diagnose errors).

    Naming Consistency5/5

    All eight tools follow a strict verb_noun snake_case pattern (create_task, run_task, wait_task, get_diff, get_log, submit_review, finish_task, list_tasks). Verbs are used consistently for their semantic class (create/run/wait/get/submit/finish/list), with no camelCase or stylistic mixing.

    Tool Count5/5

    Eight tools is well within the ideal 3-15 range and each tool covers a necessary lifecycle stage with no filler. The set is tightly scoped to orchestration of Gemini tasks in git worktrees, with no redundant or trivial entries.

    Completeness4/5

    The surface covers the full lifecycle: create, execute, wait, inspect (diff and log), review with approve/revise/reject, finalize with merge/keep/discard, and list. Minor gaps exist, such as no explicit way to cancel/abort a running task or fetch full task details beyond the compact list entry, but agents can work around these via finish_task discard and wait_task.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      B
      maintenance
      Enables Claude Code to hand individual plan tasks to Gemini 3.8 Flash through the Antigravity CLI, running each in an isolated git worktree with contract tests, tool-call gating, and protected paths. Verifies the returned work server-side and merges only branches that pass the configured test suite, tracking jobs, progress, and lessons learned.
      4
      24 npm
      8
      MIT
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables Claude Code to delegate heavy coding and image-generation work to Gemini through the Antigravity CLI using a Google AI Pro subscription instead of an API key, while Claude writes briefs, reviews results, and sends corrections. It runs jobs asynchronously in a guarded work folder, continues the same Gemini conversation for fixes, and reports status, output, and token usage back to the caller.
      MIT