agent-bridge
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
agent-bridge
A local SQLite-backed peer-to-peer MCP bridge and plugin bundle enabling official Antigravity, Claude Code, and Codex sessions to collaborate directly in the same workspace—via shared rooms, lifecycle auto-trigger hooks, a zero-token background wait listener, and visible interactive session launching.
Overview (English)
agent-bridge lets official AI coding agent clients collaborate as peers without wrapping or scraping third-party CLIs behind the scenes:
Official clients talk to each other: Each agent runs in its own official client (Antigravity, Claude Code, Codex) and talks through standard stdio MCP tools and lifecycle hooks backed by a local SQLite WAL database (
~/.agent-bridge/hub.db)—no daemon required.Automatic workspace room matching: Omitting
roomderives a deterministic room ID (<repo-name>-<8-char-hash>) from the git repository root (or workspace path), so agents opened in the same repository automatically meet in the same room. Supports N agents (antigravity,claude-code,codex, or custom handles).Lifecycle auto-trigger hooks & stall detection: Bundled plugins wire
SessionStart/PreInvocation/Stop(Antigravity) andSessionStart/UserPromptSubmit/Stop(Claude Code) to inject unread messages, maintain passive presence, warn the sender when a reply-expected message goes unanswered (seen_no_replyvsunseen), and prevent infinite ping-pong loops (max_turns+ Stop-hook continuation caps).Zero-token background wait listener (
agent-bridge wait): Long-running CLI listener (default1800s, or0for indefinite) that blocks on SQLite with zero token usage while idle and exits immediately when a peer message arrives—waking an idle Antigravity conversation automatically via Reactive Wakeup. Includes a PID-verified singleton guard to prevent duplicate listeners.Visible interactive launching: When a target peer is offline,
bridge_launch/bridge_send(..., auto_launch=True)/agent-bridge upopens a visible terminal window for the official CLI instead of hidden background processes.
Quickstart (English)
git clone https://github.com/holmesfems/agent-bridge.git agent-bridge
cd agent-bridge
python -m venv .venv
# Windows (PowerShell)
.venv\Scripts\python -m pip install -e ".[dev]"
.venv\Scripts\agent-bridge install --target all
# macOS / Linux
.venv/bin/python -m pip install -e ".[dev]"
.venv/bin/agent-bridge install --target allAntigravity: Installed automatically to
~/.gemini/config/plugins/agent-bridge/(auto-discovered on the next turn).Claude Code: Installed to
~/.agent-bridge/plugins/claude-code/. Launch with:claude --plugin-dir ~/.agent-bridge/plugins/claude-code
Related MCP server: agent-bridge
概要(日本語)
Antigravity・Claude Code・Codex などの公式クライアント同士が、ローカルの共有 SQLite ハブと公式プラグイン/フックを通じて対等に協調作業するための MCP ブリッジです。
公式クライアント同士で通信:他社 CLI のサブスク認証を裏でヘッドレスにラップするのではなく、ユーザーが起動した公式の Antigravity / Claude Code / Codex 同士が、ローカルの共有ボード(
~/.agent-bridge/hub.db)を標準 MCP とフックで読み書きします。N エージェント対応:最初から 2 者専用ではなく、同じワークスペースのルームに何人でも参加できます(
antigravity/claude-code/codex/ カスタム名)。自動トリガー(Hooks + スマート待機リスナー):
Antigravity(
SessionStart/PreInvocation/Stop)と Claude Code(SessionStart/UserPromptSubmit/Stop)の公式フックをプラグインに同梱。新着メッセージがあれば自動でコンテキスト注入・ターン続行します。Antigravity 向けには、待機中トークン消費ゼロで自動起床できるバックグラウンド待機コマンド
agent-bridge waitと、オンラインピア検知時のスマート自動待機ルールを同梱しています。無限ピンポン防止のため、スレッドごとの
max_turns上限と Stop フック連続発火上限を内蔵しています。
新規セッションの可視起動:相手がオフラインのときは
bridge_launch(またはbridge_send(..., auto_launch=True)/agent-bridge up)で、ユーザーの目の前に公式 CLI の対話ウィンドウを開きます。
アーキテクチャ
┌──────────────────────────┐ ┌──────────────────────────┐
│ Antigravity (公式) │ │ Claude Code (公式) │
│ + plugins/antigravity │ │ + plugins/claude-code │
│ (MCP + Skill + Hooks) │ │ (MCP + Skill + Hooks) │
└────────────┬─────────────┘ └─────────────┬────────────┘
│ stdio MCP / Hook CLI / wait │ stdio MCP / Hook CLI
└──────────────┐ ┌──────────────┘
▼ ▼
┌────────────────────────────────┐
│ ~/.agent-bridge/hub.db (SQLite)│ ← 常駐デーモン不要(WAL モード)
└────────────────────────────────┘
▲
│ (任意)
┌────────────┴─────────────┐
│ Codex (plugins/codex) │
└──────────────────────────┘ルームの自動一致:
roomを省略すると、カレントの git リポジトリルート(またはワークスペースパス)から決定論的なルーム ID(<repo-name>-<8桁ハッシュ>)を生成するため、同じプロジェクトを開いた各エージェントが自動的に同じ部屋に入ります。ファイル受け渡し:バイナリや巨大な本文は送らず、
filesにワークスペース内のファイルパスだけを渡します。
セットアップ
1. インストール
# リポジトリを取得して仮想環境を作成(Windows / PowerShell の例)
git clone https://github.com/holmesfems/agent-bridge.git agent-bridge
cd agent-bridge
python -m venv .venv
.venv\Scripts\python -m pip install -e ".[dev]"macOS / Linux の場合は .venv/bin/python -m pip install -e ".[dev]" を使用してください。
2. Antigravity & Claude Code プラグインの配置
agent-bridge install を実行すると、現在の .venv 内の実行ファイル絶対パスを mcp_config.json・hooks.json・rules/AGENTS.md・skills/agent-bridge/SKILL.md に埋め込んだ状態でプラグインを配置します(グローバル PATH 未登録でも別リポジトリから動作します。起動中の再インストールでも上書き更新されます)。
# Windows (PowerShell)
.venv\Scripts\agent-bridge install --target all
# macOS / Linux
.venv/bin/agent-bridge install --target allAntigravity:
~/.gemini/config/plugins/agent-bridge/に自動配置されます(~/.gemini/config/config.jsonは編集せず、Antigravity の自動検出に任せます)。次のターンから有効になり、Customizations 画面で ON/OFF 管理できます。Claude Code:
~/.agent-bridge/plugins/claude-code/に配置されます。以下のように読み込んで起動します:
# Windows (PowerShell)
claude --plugin-dir "$env:USERPROFILE\.agent-bridge\plugins\claude-code"
# macOS / Linux
claude --plugin-dir "$HOME/.agent-bridge/plugins/claude-code"3. Antigravity の権限設定(毎回確認を省くおすすめ設定)
Antigravity の MCP ツールは既定で確認ダイアログ(Ask)が出ます。以下の 2 つを許可しておくと、自動待機〜返信まで完全ノンストップで動きます。
Settings → General → Permissions → Advanced から以下を Allow に追加:
MCP Tools:
agent-bridge_agent-bridge/*(
bridge_launchだけ毎回確認したい場合は、あわせて Ask にagent-bridge_agent-bridge/bridge_launchを追加)Commands(バックグラウンド待機リスナーを無確認で張る場合):
<path-to-agent-bridge>\.venv\Scripts\agent-bridge.exe wait(macOS / Linux は
<path-to-agent-bridge>/.venv/bin/agent-bridge wait)
MCP ツール一覧
ツール | 役割 |
| ルームに参加・オンライン登録し、参加者一覧と未読メッセージを返す |
| ルーム内のオンライン/待機中エージェントを確認する |
| 相手(または |
| 自分宛て・部屋宛ての未読メッセージを読む |
| 相手からの新着メッセージをロングポーリング待機する(MCP タイムアウト回避のため最大 110 秒) |
| ルームまたはスレッドの履歴を参照する |
| 対象エージェント( |
| アクティブ・最近のルーム一覧を表示する |
自動トリガー・待機リスナーの仕組みと安全ガード
ターン開始・プロンプト送信時:
Antigravity:
SessionStart/PreInvocationフックが未読メッセージをinjectSteps(systemMessage)で自動注入します。Claude Code:
SessionStart/UserPromptSubmitフックが未読メッセージをadditionalContextで自動注入します。同時にオンライン状態(presence)も受動的に更新されるため、
bridge_joinを明示的に呼ばなくても相手から「オンライン」に見えます。
アイドル中の自動起床(スマート待機リスナー
agent-bridge wait):MCP の
bridge_wait(上限 110 秒)とは別に、CLI のagent-bridge wait --client antigravity --timeout 1800(0で無期限)を用意しています。Antigravity のバックグラウンドコマンドとして起動してターンを終了すると、待機中のトークン消費ゼロのまま SQLite を監視し、ピアからメッセージが届いた瞬間に終了 → Antigravity の Reactive Wakeup で会話が自動起床します。
スマート起動 & 安全ガード:
同じルームにオンラインのピア(Claude Code 等)がいて待機リスナーが未起動のときだけ、
SessionStart/PreInvocationフックがセッションにつき 1 回自動起動を促します。重複起動ガード:同一
(room, client)で生きているwaitプロセス(PID 生存確認+ハートビート)がある場合はalready_running: trueを返して即終了し、多重起動を防ぎます(--forceで強制起動可)。自然終了:返信後は自動で張り直しますが、無通信タイムアウト(既定 30 分、
timed_out: true)・max_turns到達・ユーザーからの停止指示時は張り直さずに静かに終了します。待機中は
status: "waiting"として公開され、終了時に自動でofflineへクリーンアップされます。
ターン終了時(
Stopフック):返信要求付き(
expect_reply=True)の未処理メッセージがあり、かつturn < max_turnsの場合のみ自動続行します(Antigravity はdecision: "continue"、Claude Code はdecision: "block")。暴走防止:
同一メッセージは 1 セッションにつき 1 回しかフック配信しません(
hook_deliveriesテーブル)。ユーザーキャンセル・エラー終了時(Antigravity
terminationReason != "NO_TOOL_CALL")や Claude Codestop_hook_active=trueでは絶対に止めません。1 ターンあたりの自動続行回数上限(
AGENT_BRIDGE_STOP_MAX_CONTINUES、既定2)とスレッドのmax_turns(既定6)の二重ガードを持ちます。
返信停滞(「返事が来ない」)検知:
expect_reply=Trueのメッセージに、同じスレッドで他クライアントからの後続投稿が無いままAGENT_BRIDGE_STALL_SECONDS(既定180秒、0で無効、6 時間より古い投稿は対象外)を経過すると、送り手へ自動通知します。相手が既にメッセージを読んだ(
message_reads)またはフック注入済み(hook_deliveries)なのに返信がない場合はstate: "seen_no_reply"(権限確認プロンプトやユーザー入力待ちで止まっている可能性)、未読の場合はstate: "unseen"(オフラインや待機リスナー未起動など)として区別します。送り手の
SessionStart/PreInvocation/UserPromptSubmitフックで 1 メッセージにつき 1 セッション・1 状態ごとに 1 回だけ(unseen→seen_no_replyに変わったときは改めて)「Peer reply overdue」通知を注入するほか、bridge_whoおよびagent-bridge status --sender <client>のawaiting_replies欄でも確認できます。
新規セッション起動クールダウン:
同一
(room, target)への連続起動は既定 30 秒間ブロックし、ウィンドウの多重起動を防ぎます。
CLI ユーティリティ
# ルームの参加者と最新メッセージを確認
agent-bridge status
# 同じルームで Antigravity と Claude Code の対話ウィンドウをまとめて起動
agent-bridge up --agents antigravity,claude-code
# ターミナルからエージェントへ直接メッセージ送信
agent-bridge send claude-code "tests/test_hub.py の設計をレビューして" --files tests/test_hub.py
# ピアからの未読メッセージが届くまで長時間待機(既定 1800 秒、0 で無期限)
# 重複起動ガード内蔵(--force で強制上書き、--no-mark-read で既読化せず確認)
agent-bridge wait --client antigravity --timeout 1800環境変数
変数 | 既定 | 意味 |
|
| DB・設定の保存先 |
|
| SQLite DB ファイルパス |
|
| クライアント識別子( |
| クライアント名 | ルーム内での表示ハンドル |
| ワークスペース由来 | ルーム ID の明示指定 |
|
| Stop フックによる連続続行の上限( |
|
|
|
|
| 同一ターゲットの連続起動クールダウン秒数 |
注意事項 / Disclaimer
各クライアント(Antigravity / Claude Code / Codex など)の利用規約に沿った使い方かどうかは、利用者ご自身で確認してください。本プロジェクトは各社の公式ツールではなく、規約への適合を保証するものではありません。
bridge_launch(..., launcher="antigravity-ui")は、Antigravity の公開されていない内部 API(ローカルのConversationService/CreateConversation)を呼びます。仕様変更で動かなくなる可能性があるうえ、規約上の扱いも明確ではありません。明示的に指定したときだけ使われるので、気になる場合は既定のlauncher="auto"(可視ターミナルで起動)のままにしてください。待機リスナーや Stop フックによる自動続行は、人が見ていない間にもエージェントのターンを進めます。
max_turnsやAGENT_BRIDGE_STOP_MAX_CONTINUESで回数を抑え、無人で長時間動かし続けないようにしてください。
English: This is an unofficial, community project. Check each client's terms of service yourself; no compliance is guaranteed. The
antigravity-uilauncher calls an undocumented internal Antigravity API and may break or be disallowed. Auto-continuation (wait listener, Stop hooks) advances agent turns without a human present, so keep the turn caps low and avoid long unattended runs.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
Related MCP Connectors
The team layer for AI coding agents: shared contracts, collision alerts, E2EE sessions.
Privacy-first coordination for autonomous agents: rooms, messaging, inbox, and per-agent memory.
Multiplayer for the coding agents your team already uses: shared tasks, decisions, skills and tools.
Coordination hub for AI coding agents: message teammates, ask humans, audit every event.
Related MCP Servers
- FlicenseAqualityBmaintenanceEnables Claude and Codex sessions on the same host to communicate across different session systems via shared SQLite rooms, with named participants, durable ordered messages, offline delivery, and wait-based message handling.42-
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code, Codex and opencode sessions on the same machine to message each other live over a local pipe, with threaded replies and offline queuing, and to delegate or spawn one another as background subagents. Messages persist in SQLite and any running server can take over as broker, so peers stay reachable without a daemon.5MIT
- AlicenseAqualityBmaintenanceEnables Claude Code, Codex, and other coding-agent sessions on the same machine to message each other, exchange tracked tasks with owners and states, and coordinate through channels, broadcasts, and multi-session asks without typing into terminals. Messages are routed by what the receiver is doing — next tool call, end of turn, or a held-back digest — so a flood of traffic doesn't interrupt active work.2541470 npm1MIT
- AlicenseNot gradedqualityCmaintenanceEnables coordinating local coding agents across Antigravity, DeepSeek Harness, Claude Code, and OpenCode with persistent tasks, live public events, file-change artifacts, session follow-ups, process-tree cancellation, and configurable execution permissions.MIT