Skip to main content
Glama
agent-bridge-mcp

agent-bridge-mcp

by yukinuma-cpu

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,网关拒绝启动。没有默认令牌。

变量

默认值

含义

ABC_AUTH_TOKEN

(必需)

REST 和 WebSocket 认证的共享密钥

PORT

3030

监听端口

AGENT_BRIDGE_HOST

127.0.0.1

绑定地址

AGENT_BRIDGE_WORKSPACE

process.cwd()

project 名称解析的基础目录

AGENT_BRIDGE_ROOT

process.cwd()

会话和任务状态文件写入位置

AGENT_BRIDGE_ALLOWED_ORIGINS

仅 localhost

逗号分隔的 CORS 允许列表

端点

方法

路径

说明

GET

/api/status

网关和运行中任务摘要

GET

/api/projects

工作区下找到的目录

GET

/api/sessions

列出会话

GET

/api/tasks, /api/tasks/:id

列出/检查任务

POST

/api/dispatch

向代理分派任务

POST

/api/tasks/:id/cancel

取消运行中的任务

POST

/api/evidence

运行证据检查

POST

/api/git/commit-push

提交并推送仓库

POST

/api/review-loop

运行实现/审查循环

WS

/ws?token=…

任务输出和生命周期事件

/api/dispatch、/api/git/commit-push 和 /api/review-loop 需要明确的 目标 — 要么是 cwd,要么是在工作区内的 project。它们返回 400, 而不是回退到默认目录,并且会拒绝逃逸工作区的 project 值。

安全性

此服务在关闭安全提示的情况下运行编码代理。 这是实现无人值守分派的 必要条件——代理在需要批准时会停止,当无人操作键盘时就会挂起—— 但这意味着任何能访问 API 的人都可以以网关运行用户的身份运行任意代码。

具体来说,CLI 适配器传递:

代理

标志

退出选项

Codex

--dangerously-bypass-approvals-and-sandbox

bypassApprovals: false

Antigravity

--dangerously-skip-permissions

bypassPermissions: false

两者默认都绕过。退出选项是适配器级别的选项;尚未通过 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 tools
agent_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

    A3.6/5.0

    Scored across 6 tools

    Disambiguation4/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness4/5

    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

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      MCP server that spawns autonomous Claude Code agents in GitHub repos, enabling task delegation with persistent state, multi-step workflows, and job monitoring.
      47
      168 npm
      2
      Apache 2.0
    • A
      license
      A
      quality
      A
      maintenance
      An 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.
      33
      604 PyPI
      35
      MIT
    • A
      license
      Not graded
      quality
      C
      maintenance
      A 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
    • A
      license
      Not graded
      quality
      C
      maintenance
      An 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 npm
      3
      MIT