Skip to main content
Glama
MauricioPerera

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_codexcodex exec

  • delegate_to_claudeclaude -p --output-format json

  • delegate_to_agyagy -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

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNoAbsolute path to the working directory the sub-agent should operate in. Defaults to this MCP server's own working directory if omitted.
modelNoModel override for this run (e.g. 'gpt-5.6-luna', 'claude-opus-4-8'). Omit to use the CLI's own configured default.
promptYesTask instructions for the sub-agent to execute, exactly as it should receive them.
auto_approveNoBypass the sub-agent's interactive tool-permission prompts (shell commands, file edits, etc). This call has no terminal attached, so without auto_approve most non-trivial tasks will fail immediately the first time the sub-agent needs to use a tool. Set true when you trust the task to run unattended.
timeout_secondsNoHow long to wait for the sub-agent to finish, in seconds (10-1800, default 600). The process is killed if it runs longer.

Output Schema

ParametersJSON Schema
NameRequiredDescription
stderrNoCaptured stderr, included only when the run was not successful.
successYesTrue if the sub-agent process exited with code 0 and did not time out.
exit_codeYesProcess exit code, or null if the process could not be spawned.
timed_outYesTrue if the process was killed after exceeding timeout_seconds.
final_messageYesThe sub-agent's final response text.

TDQS

A4.7/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

The description discloses output format, error handling, timeout behavior, and the necessity of auto_approve for tool-using tasks. This goes well beyond the annotations, which are already present.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with a summary line, parameter listing, return format, and error handling. It is concise and front-loaded with the essential purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters, output schema, annotations), the description covers return values, error cases, and operational nuances, making it fully complete.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100%, but the description adds valuable context for parameters like auto_approve (explaining failure without it) and timeout (kill behavior), exceeding the baseline of 3.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it runs the Antigravity CLI non-interactively to execute a task, using a specific verb and resource. The title and description distinguish it from sibling tools by naming the specific CLI.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use (delegating to Antigravity CLI) and highlights the need for auto_approve, but does not explicitly compare with siblings or state when not to use it.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNoAbsolute path to the working directory the sub-agent should operate in. Defaults to this MCP server's own working directory if omitted.
modelNoModel override for this run (e.g. 'gpt-5.6-luna', 'claude-opus-4-8'). Omit to use the CLI's own configured default.
promptYesTask instructions for the sub-agent to execute, exactly as it should receive them.
auto_approveNoBypass the sub-agent's interactive tool-permission prompts (shell commands, file edits, etc). This call has no terminal attached, so without auto_approve most non-trivial tasks will fail immediately the first time the sub-agent needs to use a tool. Set true when you trust the task to run unattended.
timeout_secondsNoHow long to wait for the sub-agent to finish, in seconds (10-1800, default 600). The process is killed if it runs longer.

Output Schema

ParametersJSON Schema
NameRequiredDescription
stderrNoCaptured stderr, included only when the run was not successful.
successYesTrue if the sub-agent process exited with code 0 and did not time out.
exit_codeYesProcess exit code, or null if the process could not be spawned.
timed_outYesTrue if the process was killed after exceeding timeout_seconds.
final_messageYesThe sub-agent's final response text.

TDQS

A4.3/5.0
Behavior5/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Adds substantial behavioral details beyond annotations: describes process killing on timeout, structured return value format, and error handling (success, exit_code, timed_out, stderr). Annotations indicate destructiveHint=true, and the description warns of side effects via auto_approve. No contradictions.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Well-structured with sections for args, return format, and error handling. Every sentence is informative and earns its place. No redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness5/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given full schema coverage, output schema, and annotations, the description is highly complete. Covers purpose, usage caveats, return values, error states, and parameter details comprehensively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with good descriptions for each parameter. The description does not add significant new meaning beyond summarizing the schema. Baseline 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

Clearly states it runs Claude Code CLI non-interactively to execute a task and returns the final message. Includes the exact CLI invocation format. Names sibling tools but does not explicitly contrast them, so slightly below top tier.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

Explains the non-interactive context and warns that auto_approve is needed for tool-using tasks (otherwise they fail). Provides implicit when-to-use guidance for unattended execution. Lacks explicit when-not-to-use or comparison with alternatives.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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

ParametersJSON Schema
NameRequiredDescriptionDefault
cwdNoAbsolute path to the working directory the sub-agent should operate in. Defaults to this MCP server's own working directory if omitted.
modelNoModel override for this run (e.g. 'gpt-5.6-luna', 'claude-opus-4-8'). Omit to use the CLI's own configured default.
promptYesTask instructions for the sub-agent to execute, exactly as it should receive them.
auto_approveNoBypass the sub-agent's interactive tool-permission prompts (shell commands, file edits, etc). This call has no terminal attached, so without auto_approve most non-trivial tasks will fail immediately the first time the sub-agent needs to use a tool. Set true when you trust the task to run unattended.
timeout_secondsNoHow long to wait for the sub-agent to finish, in seconds (10-1800, default 600). The process is killed if it runs longer.

Output Schema

ParametersJSON Schema
NameRequiredDescription
stderrNoCaptured stderr, included only when the run was not successful.
successYesTrue if the sub-agent process exited with code 0 and did not time out.
exit_codeYesProcess exit code, or null if the process could not be spawned.
timed_outYesTrue if the process was killed after exceeding timeout_seconds.
final_messageYesThe sub-agent's final response text.

TDQS

A3.6/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

Annotations indicate destructiveHint=true and openWorldHint=true, but the description adds critical details: non-interactive mode, auto_approve necessity (tasks fail without terminal), timeout killing, and structured return values. This significantly enriches understanding beyond annotations.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is well-structured with clear sections (Args, Returns, Error Handling). Every sentence contributes practical information, though some default values are repeated between schema and description, making it slightly longer than necessary.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's complexity (5 parameters, output schema), the description covers input semantics, return structure, and error handling comprehensively. No critical gaps are evident, though concurrency or resource impacts are not addressed.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

With 100% schema coverage, the description still adds value by explaining defaults (cwd, model), behavioral implications (auto_approve), and range constraints (timeout). This context helps the agent craft appropriate parameter values.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states it runs Codex CLI non-interactively to execute a coding task and returns results. While it doesn't explicitly differentiate from siblings (delegate_to_agy, delegate_to_claude), the title and specificity to Codex make 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.

Usage Guidelines2/5

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 vs. its siblings. It neither explains the distinguishing characteristics of Codex CLI nor suggests alternatives for other AI agents, leaving the agent to infer usage from the name alone.

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.

  1. 3 tool updatesv1.0.0
    • First observeddelegate_to_agy
    • First observeddelegate_to_claude
    • First observeddelegate_to_codex

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.

Maintenance

ActivityStale
ResponsivenessNo issues

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
    B
    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