agent-bridge-mcp
agent-bridge-mcp
一个MCP服务器和HTTP网关,用于将编码任务分派给 Claude Code、
Codex 和 Antigravity (agy) CLI会话,跟踪这些会话,
并可选择对真实仓库运行实现 → 审查 → 验证循环。
状态:实验性。 最初是个人编排工具, 希望会话路由和证据检查部分对他人有用。 接口将会变化。
功能
会话路由 — 按项目和主题启动/恢复 Claude Code / Codex 会话, 使后续提示进入同一上下文。
任务跟踪 — 每次分派都成为一个任务,包含状态、输出和退出码。
证据检查 — 运行您指定的仓库测试命令,并报告更改是否 实际通过了测试,然后才接受。
审查循环 — 依次分派实现代理和审查代理, 达到修订限制,并通过证据检查进行门控。
网关 — 通过 HTTP + WebSocket 提供相同功能, 以便远程客户端(例如手机)可以分派工作并流式输出。
Related MCP server: agent-intern
安装
npm install -g @yukinuma/agent-bridge-mcp需要 Node.js 20+,以及您打算使用的任何代理 CLI
(claude、codex 和/或 agy)已安装并认证。
关于 antigravity 代理的说明
agy 运行一个内部语言服务器,需要真正的终端。从普通管道启动时,
它在回答之前就关闭了,从调用方来看,这与挂起无法区分。
在 Windows 上,此适配器因此使用 winpty(随 Git for Windows 捆绑)
运行它,并在调用期间保持 stdin 打开。
两个值得注意的后果:
winpty在拆卸时因其自身断言而中止,因此其退出码不反映agy做了什么。通过 pty 运行时,适配器通过是否收到响应 来判断成功,而不是退出码,并从捕获的输出中过滤掉断言文本。超时时,进程树按 PID 终止。按映像名称终止会杀死您在其他地方 打开的任何交互式
agy,因此故意不这样做。
如果任一二进制文件位于非标准位置,请设置 WINPTY_PATH 或 AGY_PATH。
在非 Windows 平台上,agy 直接启动,未经测试。
用作 MCP 服务器
{
"mcpServers": {
"agent-bridge": {
"command": "agent-bridge-mcp",
"env": {
"AGENT_BRIDGE_WORKSPACE": "/path/to/your/projects"
}
}
}
}暴露的工具:agent_send、agent_status、agent_sessions、agent_cancel。
用作网关
export ABC_AUTH_TOKEN="$(openssl rand -hex 24)"
export AGENT_BRIDGE_WORKSPACE="/path/to/your/projects"
agent-bridge-gateway如果未设置 ABC_AUTH_TOKEN,网关拒绝启动。没有默认令牌。
变量 | 默认值 | 含义 |
| (必需) | REST 和 WebSocket 认证的共享密钥 |
|
| 监听端口 |
|
| 绑定地址 |
|
|
|
|
| 会话和任务状态文件写入位置 |
| 仅 localhost | 逗号分隔的 CORS 允许列表 |
端点
方法 | 路径 | 说明 |
|
| 网关和运行中任务摘要 |
|
| 工作区下找到的目录 |
|
| 列出会话 |
|
| 列出/检查任务 |
|
| 向代理分派任务 |
|
| 取消运行中的任务 |
|
| 运行证据检查 |
|
| 提交并推送仓库 |
|
| 运行实现/审查循环 |
|
| 任务输出和生命周期事件 |
/api/dispatch、/api/git/commit-push 和 /api/review-loop 需要明确的
目标 — 要么是 cwd,要么是在工作区内的 project。它们返回 400,
而不是回退到默认目录,并且会拒绝逃逸工作区的 project 值。
安全性
此服务在关闭安全提示的情况下运行编码代理。 这是实现无人值守分派的 必要条件——代理在需要批准时会停止,当无人操作键盘时就会挂起—— 但这意味着任何能访问 API 的人都可以以网关运行用户的身份运行任意代码。
具体来说,CLI 适配器传递:
代理 | 标志 | 退出选项 |
Codex |
|
|
Antigravity |
|
|
两者默认都绕过。退出选项是适配器级别的选项;尚未通过 MCP 工具或 REST API 暴露,因此通过 HTTP 时绕过目前是无条件的。
将其视为特权本地守护进程:
默认绑定到
127.0.0.1。将AGENT_BRIDGE_HOST设置为其他值会向您的网络 暴露任务分派、无沙箱代码执行和 git 推送。认证令牌是一个共享密钥,作为 Bearer 标头或
token查询参数发送。 查询参数会出现在日志中——尽可能使用标头。泄露该令牌等同于交出 shell。除了工作区路径检查外,项目之间没有沙箱隔离。
/api/git/commit-push推送到目标仓库配置的任何远程仓库。 推送前不会再次询问。
不要将其暴露给不受信任的网络,也不要使用比工作所需更多权限的用户运行。
开发
npm install
npm run typecheck
npm run build许可证
MIT
Available Tools
6 toolsagent_cancelC
Cancel a currently running agent task.
Inputs: taskId (required).
agent_evidence_checkA
Run Evidence Gate validation: inspect git status/diff and execute test/typecheck/lint commands to produce empirical evidence report.
Inputs: cwd, timeoutMs, testCommands.
agent_review_loopA
Execute full autonomous development loop: Codex implements -> Evidence Gate validates -> Claude reviews -> Auto-revision (up to max 2 revisions limit).
Inputs: prompt (required), cwd, topic, engine, +4 more.
agent_sendB
Send an instruction to Claude Code or Codex CLI/SDK. Executes asynchronously in background and returns task_id.
Inputs: agent (required), prompt (required), cwd, model, +7 more.
agent_sessionsC
List active or archived sessions tracked by Agent Bridge.
Inputs: agent, topic, status, project.
agent_statusB
Check the status, output, or error of a background task dispatched via agent_send.
Inputs: taskId (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Each tool targets a distinct action: send, cancel, check evidence, check status, list sessions, and run a full review loop. The only minor overlap is between agent_send and agent_review_loop, as both can dispatch work, but the latter is a higher-level workflow clearly distinguished by name and description.
All tool names consistently follow the agent_verb or agent_verb_noun pattern (e.g., agent_send, agent_evidence_check, agent_review_loop). The naming is predictable and readable across the set.
With 6 tools, the surface is appropriately scoped for an agent orchestration and review bridge. Each tool provides a distinct function without overwhelming users or leaving the set feeling thin.
The set covers the core workflow: dispatch, status, cancel, and an integrated review loop. Evidence check and session listing add useful supporting operations. A minor gap is the lack of an explicit tool to modify or configure review loop parameters, but the overall surface is solid.
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Real-time chat hub for AI agents — Claude Code, Cursor, Cline, Codex over MCP or REST.
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Related MCP Servers
- AlicenseAqualityDmaintenanceMCP server that spawns autonomous Claude Code agents in GitHub repos, enabling task delegation with persistent state, multi-step workflows, and job monitoring.47168 npm2Apache 2.0
- AlicenseAqualityAmaintenanceAn MCP server that bridges Claude Code with Antigravity CLI using a Swarm Agent architecture to optimize local development workflows and minimize LLM token costs. Includes a web UI for monitoring agent workflows.33604 PyPI35MIT
- AlicenseNot gradedqualityCmaintenanceA local-first MCP orchestration server that uses Codex as lead planner and Antigravity as host to delegate and review bounded tasks with Git integration and persistent SQLite state.Apache 2.0
- AlicenseNot gradedqualityCmaintenanceAn MCP server that bridges CLI coding agents like Claude Code, Codex, opencode, and Antigravity into any MCP client, enabling synchronous and asynchronous task execution, follow-up input, and a structured code review tool.25 npm3MIT