subway-mcp-server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@subway-mcp-serverDelegate to claude to refactor the main function"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
subway-mcp-server
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 execdelegate_to_claude—claude -p --output-format jsondelegate_to_agy—agy -p
Todas comparten el mismo input:
Campo | Tipo | Default | Descripción |
| string | — | instrucciones para el sub-agente |
| string | cwd del server | directorio de trabajo absoluto |
| string | el default de cada CLI | override de modelo |
| number | 600 (máx 1800) | mata el proceso si excede |
| 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 buildTests
npm testCubre 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.jsEjemplo 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,claudeyagyesté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 toolsdelegate_to_agyDelegate task to Antigravity (agy) CLIADestructive
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
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Absolute path to the working directory the sub-agent should operate in. Defaults to this MCP server's own working directory if omitted. | |
| model | No | Model override for this run (e.g. 'gpt-5.6-luna', 'claude-opus-4-8'). Omit to use the CLI's own configured default. | |
| prompt | Yes | Task instructions for the sub-agent to execute, exactly as it should receive them. | |
| auto_approve | No | Bypass 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_seconds | No | How 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
| Name | Required | Description |
|---|---|---|
| stderr | No | Captured stderr, included only when the run was not successful. |
| success | Yes | True if the sub-agent process exited with code 0 and did not time out. |
| exit_code | Yes | Process exit code, or null if the process could not be spawned. |
| timed_out | Yes | True if the process was killed after exceeding timeout_seconds. |
| final_message | Yes | The sub-agent's final response text. |
TDQS
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.
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.
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.
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.
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.
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 CLIADestructive
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
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Absolute path to the working directory the sub-agent should operate in. Defaults to this MCP server's own working directory if omitted. | |
| model | No | Model override for this run (e.g. 'gpt-5.6-luna', 'claude-opus-4-8'). Omit to use the CLI's own configured default. | |
| prompt | Yes | Task instructions for the sub-agent to execute, exactly as it should receive them. | |
| auto_approve | No | Bypass 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_seconds | No | How 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
| Name | Required | Description |
|---|---|---|
| stderr | No | Captured stderr, included only when the run was not successful. |
| success | Yes | True if the sub-agent process exited with code 0 and did not time out. |
| exit_code | Yes | Process exit code, or null if the process could not be spawned. |
| timed_out | Yes | True if the process was killed after exceeding timeout_seconds. |
| final_message | Yes | The sub-agent's final response text. |
TDQS
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.
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.
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.
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.
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.
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 CLIADestructive
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
| Name | Required | Description | Default |
|---|---|---|---|
| cwd | No | Absolute path to the working directory the sub-agent should operate in. Defaults to this MCP server's own working directory if omitted. | |
| model | No | Model override for this run (e.g. 'gpt-5.6-luna', 'claude-opus-4-8'). Omit to use the CLI's own configured default. | |
| prompt | Yes | Task instructions for the sub-agent to execute, exactly as it should receive them. | |
| auto_approve | No | Bypass 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_seconds | No | How 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
| Name | Required | Description |
|---|---|---|
| stderr | No | Captured stderr, included only when the run was not successful. |
| success | Yes | True if the sub-agent process exited with code 0 and did not time out. |
| exit_code | Yes | Process exit code, or null if the process could not be spawned. |
| timed_out | Yes | True if the process was killed after exceeding timeout_seconds. |
| final_message | Yes | The sub-agent's final response text. |
TDQS
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.
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.
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.
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.
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.
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.
3 tool updates
v1.0.0- First observed
delegate_to_agy - First observed
delegate_to_claude - First observed
delegate_to_codex
TDQS
Scored across 3 tools
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.
All tools follow the consistent pattern 'delegate_to_<name>', making it clear they are delegation actions to specific CLIs.
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.
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
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
MCP server for progressive tool usage at any scale (see https://klavis.ai)
Related MCP Servers
- FlicenseBqualityDmaintenanceAn 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-
- AlicenseNot gradedqualityAmaintenanceMCP server enabling delegation of tasks to the Antigravity (Gemini) CLI from any AI client supporting MCP.8 npmMIT
- AlicenseNot gradedqualityAmaintenanceLocal MCP server for asynchronous coding-agent delegation, enabling Claude Code or Codex to delegate tasks to Cursor, Pi, Codex, or Claude Code and collect results later.1MIT
- AlicenseNot gradedqualityBmaintenanceMCP 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.2MIT