Skip to main content
Glama
subway-mcp-server

subway-mcp-server

subway-mcp-server

CI License: MIT Node.js >= 18 MCP Coverage

MCP server local que expone codex, claude (Claude Code) y agy (Antigravity) como tools de delegación, para que un agente orquestador les reparta tareas vía CLI en modo no interactivo.

Tools

  • delegate_to_codex — codex exec

  • delegate_to_claude — claude -p --output-format json

  • delegate_to_agy — agy -p

Todas comparten el mismo input:

Campo

Tipo

Default

Descripción

prompt

string

—

instrucciones para el sub-agente

cwd

string

cwd del server

directorio de trabajo absoluto

model

string

el default de cada CLI

override de modelo

timeout_seconds

number

600 (máx 1800)

mata el proceso si excede

auto_approve

boolean

false

evita prompts de permisos de la CLI (necesario para casi cualquier tarea real, porque no hay terminal para aprobar)

Output: { success, final_message, exit_code, timed_out, stderr? } (stderr solo si success=false).

Related MCP server: agyforclaude

Build

npm install
npm run build

Tests

npm test

Cubre cliRunner (spawn, captura de stdout/stderr, cwd, timeout, comando inexistente) y la construcción de argumentos/parseo de salida de cada tool (argBuilders), sin invocar los CLIs reales de pago.

Cobertura local: npm run coverage. En CI, el job coverage la calcula en cada push a master y commitea badges/coverage.json (leído por el badge del README vía shields.io endpoint) — delegate.ts e index.ts quedan en 0% porque solo se ejercitan invocando los CLIs reales, fuera del alcance de estos tests.

Registrar en Claude Code

claude mcp add subway -- node D:/Repo/subway/dist/index.js

Ejemplo de uso

Una vez registrado, desde cualquier sesión de Claude Code en el proyecto podés pedirle al agente que delegue directamente, por ejemplo:

Delegá a agy: "Reply with exactly: PONG", con auto_approve true

Eso dispara una llamada al tool mcp__subway__delegate_to_agy con:

{
  "prompt": "Reply with exactly: PONG",
  "auto_approve": true
}

y devuelve:

{
  "success": true,
  "final_message": "PONG",
  "exit_code": 0,
  "timed_out": false
}

Mismo patrón para delegate_to_codex y delegate_to_claude, cambiando solo el nombre del tool. Para correr en otro directorio o con otro modelo:

{
  "prompt": "Corré los tests y reportá cuáles fallan",
  "cwd": "D:/Repo/otro-proyecto",
  "model": "claude-opus-4-8",
  "auto_approve": true,
  "timeout_seconds": 900
}

Notas

  • Requiere que codex, claude y agy estén en el PATH y ya autenticados en la máquina.

  • No hay gate de verificación (CCDD) ni orquestación de multi-tarea acá — es solo el mecanismo de delegación. Componer lógica de PM/orquestación por encima queda del lado del agente que use este MCP.

Available Tools

3 tools
delegate_to_agyDelegate task to Antigravity (agy) CLIA
Destructive

Runs the Antigravity CLI non-interactively (agy -p) to execute a task and returns its response.

Args:

  • prompt (string, required): task instructions for the agy agent

  • cwd (string, optional): absolute working directory for the task

  • model (string, optional): model override

  • timeout_seconds (number, optional, default 600): kill the process after this many seconds

  • auto_approve (boolean, optional, default false): bypass agy's tool-permission prompts (--dangerously-skip-permissions). Without this, tasks that need to use tools will fail immediately since there is no terminal to approve from.

Returns structured JSON: { success, final_message, exit_code, timed_out, stderr? }. Note: agy has no JSON output mode, so final_message is the raw trimmed stdout.

Error Handling:

  • success=false with a non-zero exit_code and stderr populated means the CLI reported an error

  • timed_out=true means the task exceeded timeout_seconds and was killed

Inputs: prompt (required), cwd, model, auto_approve, +1 more. Returns: stderr, success, exit_code, timed_out, +1 more

delegate_to_claudeDelegate task to Claude Code CLIA
Destructive

Runs Claude Code non-interactively (claude -p --output-format json) to execute a task and returns its final message.

Args:

  • prompt (string, required): task instructions for Claude

  • cwd (string, optional): absolute working directory for the task

  • model (string, optional): model override (e.g. "claude-opus-4-8")

  • timeout_seconds (number, optional, default 600): kill the process after this many seconds

  • auto_approve (boolean, optional, default false): bypass Claude's tool-permission prompts (--dangerously-skip-permissions). Without this, tasks that need to use tools will fail immediately since there is no terminal to approve from.

Returns structured JSON: { success, final_message, exit_code, timed_out, stderr? }.

Error Handling:

  • success=false with a non-zero exit_code and stderr populated means the CLI reported an error (e.g. auth, invalid model)

  • timed_out=true means the task exceeded timeout_seconds and was killed

Inputs: prompt (required), cwd, model, auto_approve, +1 more. Returns: stderr, success, exit_code, timed_out, +1 more

delegate_to_codexDelegate task to Codex CLIA
Destructive

Runs OpenAI's Codex CLI non-interactively (codex exec) to execute a coding task and returns its final message.

Args:

  • prompt (string, required): task instructions for Codex

  • cwd (string, optional): absolute working directory for the task

  • model (string, optional): model override (e.g. "gpt-5.6-luna")

  • timeout_seconds (number, optional, default 600): kill the process after this many seconds

  • auto_approve (boolean, optional, default false): bypass Codex's shell/edit approval prompts. Without this, tasks that need to run a command or edit a file will fail immediately since there is no terminal to approve from.

Returns structured JSON: { success, final_message, exit_code, timed_out, stderr? }.

Error Handling:

  • success=false with a non-zero exit_code and stderr populated means Codex reported an error (e.g. auth, invalid model, sandbox denial)

  • timed_out=true means the task exceeded timeout_seconds and was killed

Inputs: prompt (required), cwd, model, auto_approve, +1 more. Returns: stderr, success, exit_code, timed_out, +1 more

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A3.9/5.0

    Scored across 3 tools

    Disambiguation2/5

    The three tools are nearly identical in description and parameters, differing only in the target CLI. An agent would struggle to choose between them without additional context about each CLI's capabilities.

    Naming Consistency5/5

    All tools follow the consistent pattern 'delegate_to_<name>', making it clear they are delegation actions to specific CLIs.

    Tool Count5/5

    Three tools is appropriate for a server focused on delegating to a specific set of AI CLIs. The count is within the typical well-scoped range.

    Completeness3/5

    The server covers three major AI CLIs, but lacks tools for listing available CLIs, models, or managing runs, which leaves minor gaps for agent workflows.

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      B
      quality
      D
      maintenance
      An MCP server that exposes a library of delegation prompts to orchestrate tasks between a primary LLM and specialized sub-agents. It enables the execution of self-contained, bounded tasks with built-in support for configuration discovery and project-specific delegation libraries.
      3
      -
    • A
      license
      Not graded
      quality
      C
      maintenance
      MCP server that bridges Claude Code to Google Antigravity's CLI, enabling Claude to orchestrate Gemini workers in parallel for reading, writing, verifying, and autonomous tasks. It provides tools for single dispatch, parallel fan-out, background jobs, and handles permission, cwd, and shell pitfalls.
      2
      MIT