Agent Gateway MCP
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., "@Agent Gateway MCP let Pi and ZCode inspect this repository read-only and compare their findings"
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.
Agent Gateway MCP
A Windows-native MCP gateway that lets any MCP-capable host orchestrate local coding-agent CLIs as external workers.
Windows 原生的通用 CLI Agent 网关。Codex、Claude Desktop 或其他支持 stdio MCP 的宿主,可以统一调度本机 ZCode、Kimi Code、Claude Code、Codex CLI 和 Pi Coding Agent。
Why
Route routine work to lower-cost plans/models and reserve the controller for hard decisions.
Compare different agent harnesses with the same task and permissions.
Keep asynchronous lifecycle, logs, cancellation, resume and workspace safety behind one MCP API.
Prefer structured CLI protocols; never inject into an already-open interactive TUI.
Related MCP server: codex-hermes-worker
MCP tools
agents_list, agents_spawn, agents_status, agents_wait, agents_logs, agents_cancel, and agents_resume.
Legacy Kimi compatibility tools remain available: kimi_status, kimi_run, kimi_resume, and kimi_list_sessions.
Install
Requirements: Windows, Node.js 20+, and at least one supported Agent CLI already installed and authenticated.
git clone https://github.com/Kvxw1105/agent-gateway-mcp.git
cd agent-gateway-mcp
npm ci
npm run build
npm testAdd the built server to any stdio MCP host. Generic JSON:
{
"mcpServers": {
"agent-gateway": {
"command": "node",
"args": ["C:\\absolute\\path\\agent-gateway-mcp\\dist\\src\\index.js"]
}
}
}Codex TOML and generic JSON examples are in examples/. Restart the host after editing its MCP configuration.
Natural-language usage
The controller can translate requests such as:
“Let Pi inspect this repository without editing files.”
“让 Kimi 先定位问题;失败后再升级给 Codex。”
“Run the same read-only task with Pi and ZCode, then compare their harness behavior.”
“让两个 Agent 在各自 Git worktree 实现,最后只保留通过测试的方案。”
The reusable orchestration Skill is included under integrations/skills/agent-gateway-orchestrator. Install it for Codex, Claude Code, or both:
powershell -ExecutionPolicy Bypass -File scripts/install-skill.ps1 -TargetHost bothProvider configuration
The gateway auto-discovers common global npm layouts and executables on PATH. Override any provider without editing source:
Variable | Purpose |
| Executable for |
| JSON array inserted before normal CLI arguments |
| Default Codex model |
| Default Pi provider; defaults to |
| Default Pi model; defaults to |
| Windows user-environment key read for Pi; defaults to |
| Remove Anthropic endpoint overrides only for the Claude child process |
For a JavaScript CLI installed in an unusual location, set both command and prefix arguments:
$env:AGENT_GATEWAY_ZCODE_COMMAND = 'C:\Program Files\nodejs\node.exe'
$env:AGENT_GATEWAY_ZCODE_PREFIX_ARGS = '["C:\\tools\\zcode\\bin\\zcode.js"]'Secrets belong in the provider's credential store or Windows user environment. Do not put API keys in the repository, prompts, or MCP config.
Safety model
read-onlyis the default permission.Concurrent writes to the same ordinary directory are rejected.
Parallel writers must use separate Git worktrees and set
isolated_worktree=true.Cancellation terminates the task process tree on Windows.
Resume starts a new non-interactive process; it never writes into an open TUI session.
Kimi prompt mode lacks a hard read-only flag, so its read-only boundary is explicitly reported as mixed.
Task state is currently in-memory; provider session IDs may still be resumed after an MCP server restart.
Development
npm test
npm run typecheck
npm run smoke
npm auditThe upstream ecosystem audit is in docs/audits/2026-08-13-windows-agent-gateway-ecosystem.md.
Current architecture decisions, limitations, and the prioritized handoff roadmap are in .context/handoff/2026-08-13-agent-gateway-handoff.md.
License
Apache-2.0. The supported Agent CLIs are separate products with their own licenses and terms; this repository does not redistribute them.
Available Tools
11 toolsagents_cancelA
Cancel a running agent task. This does not attach to or modify unrelated interactive TUI sessions.
Inputs: task_id (required).
agents_listA
List supported local CLI agents and their structured transport, resume, and permission capabilities.
Inputs: no named parameters.
agents_logsA
Read agent stdout/stderr from a character cursor. Pass the returned cursor to fetch only new output.
Inputs: task_id (required), cursor.
agents_resumeA
Resume a completed CLI agent session as a new asynchronous task. Never use this to inject into a session still open in an interactive TUI.
Inputs: prompt (required), provider (required), work_dir (required), session_id (required), +4 more.
agents_spawnA
Start a local CLI agent asynchronously and return a task id immediately. Use read-only unless edits are required. Parallel write tasks must use independent Git worktrees.
Inputs: prompt (required), provider (required), work_dir (required), model, +3 more.
agents_statusB
Return the current state of an asynchronous agent task.
Inputs: task_id (required).
agents_waitA
Wait for an agent task to reach a terminal state, bounded by wait_seconds.
Inputs: task_id (required), wait_seconds.
kimi_list_sessionsA
List local Kimi Code sessions, optionally filtered by working directory.
Inputs: limit, work_dir.
kimi_resumeA
Resume a Kimi Code session. Do not resume a session that is still open in an interactive TUI, because two writers can race on the same session.
Inputs: prompt (required), work_dir (required), session_id (required), timeout_seconds.
kimi_runA
Start a new non-interactive Kimi Code agent session in a working directory. The Kimi CLI may read, edit, and run commands in that directory. Scope the prompt and work_dir carefully.
Inputs: prompt (required), work_dir (required), timeout_seconds.
kimi_statusA
Check whether the local Kimi Code CLI is callable and report its version.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 11 tools
Each tool has a clear, distinct purpose. The generic agents_* tools manage asynchronous tasks, while kimi_* tools are specific to Kimi Code sessions; even similar operations like agents_resume and kimi_resume are differentiated by target system and description.
All tools follow a consistent snake_case pattern with clear domain prefixes: agents_* for generic agent management and kimi_* for Kimi-specific operations. The pattern is predictable and uniform.
With 11 tools, the server is well-scoped for its purpose of managing local CLI agents and Kimi sessions. The count falls within the ideal range and each tool serves a distinct function.
The generic agent lifecycle (spawn, resume, status, wait, logs, cancel) is complete, and Kimi-specific tools cover status, run, resume, and listing. Minor gaps exist, such as no explicit kimi_cancel, but the generic cancel may cover it, so core workflows are supported.
Maintenance
Related MCP Connectors
MCP gateway and cloud hosting for MCP servers, agents and apps like RAG, managed from your agent.
Connect ChatGPT and Claude to your Mac, Windows or Linux with secure MCP remote access.
Hosted MCP server for task-first delegation to remote workstations and workers.
Host any HTTP API as a standard MCP server; auto-distribute to 12+ mainstream agent platforms.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceA general-purpose MCP gateway that exposes your local CLI skills to any AI assistant.11 npm1MIT
- AlicenseAqualityCmaintenanceA Windows-first, dual-mode MCP bridge that delegates bounded work to Hermes Agent and a local Qwen model via an OpenAI-compatible endpoint, providing restricted batch or trusted full execution modes.9MIT
- AlicenseNot gradedqualityDmaintenanceSecure localhost MCP gateway that exposes project-scoped file/Git/search tools and controlled CLI agent adapters (Codex, Claude) with fixed argv for safe Windows-native agent work.MIT
- AlicenseNot gradedqualityBmaintenanceRemote-first, model-independent Windows execution MCP for ChatGPT, Claude, Gemini, and other MCP-compatible AI clients.MIT