Skip to main content
Glama
agent-bridge-mcp

agent-bridge-mcp

by yukinuma-cpu

agent-bridge-mcp

Claude Code、Codex、Antigravity (agy) のCLIセッションにコーディングタスクをディスパッチし、それらのセッションを追跡し、オプションで実際のリポジトリに対して実装 → レビュー → 検証ループを実行するMCPサーバー兼HTTPゲートウェイです。

ステータス: 実験的。 これは個人的なオーケストレーション用の装置として始まったもので、セッションルーティングとエビデンスゲートの部分が他の人の役に立つことを願って公開しています。インターフェースは変更される予定です。

機能

  • セッションルーティング — プロジェクトとトピックごとに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に同梱)の下でagyを実行し、呼び出しの間stdinを開いたままにします。

知っておく価値のある2つの結果:

  • 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 pushがネットワークに公開されます。

  • 認証トークンは単一の共有シークレットで、ベアラーヘッダーまたはtokenクエリパラメータとして送信されます。クエリパラメータはログに残るため、可能な場合はヘッダーを優先してください。そのトークンが漏洩することは、シェルを渡すことと同等です。

  • ワークスペースのパスチェック以外に、プロジェクト間のサンドボックス化はありません。

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