A local, zero-cloud Model Context Protocol (MCP) server designed for AI-to-AI pair programming and technical peer review (Driver & Navigator).
When developing with multiple AI coding assistants (e.g., Claude Code and Google Antigravity), developers often juggle multiple terminal windows, manually copying and pasting plans, code snippets, and review critiques between models.
Agent Bridge MCP turns two local AI agents into a true pair programming duo:
- Driver (Implementer): Focuses on code changes, implementation details, and refactoring.
- Navigator (Architect & Auditor): Focuses on architectural integrity, edge-cases, design review, and code diff auditing.
Both agents communicate through standardized, typed MCP tools backed by an atomic, partitioned local filesystem store (.agent-bridge/) in the target project.
- Local-First & Zero-Cloud: Runs via standard
stdio. No remote servers, no databases, and no extra API keys required. - Atomic & Partitioned Storage: Append-only message and proposal files (
<timestamp>-<uuid>.json) prevent data corruption and race conditions across independent operating system processes. - Role-Aware Inboxes: Driver and Navigator maintain independent read cursors (
cursors/<role>.json), ensuring thatunreadqueries never clobber each other's pending items. - Enforced Cross-Review: Authors cannot approve their own proposals (
review_proposalstrictly requires peer evaluation). - Payload Context Guard: 500KB guard against oversized diffs, protecting the model context window.
| Tool Name | Purpose | Key Inputs |
|---|---|---|
post_proposal |
Submit a formal plan or architecture proposal for review | title, target_files, proposal, focus_areas |
review_proposal |
Issue a verdict (APPROVED or CHANGES_REQUESTED) |
proposal_id, verdict, critique |
submit_diff_for_review |
Submit code changes or a unified diff for inspection | description, diff_or_patch, branch_or_commit |
chat_with_peer |
Send a quick direct message or technical question to peer | message, reply_to_id (optional) |
read_bridge |
Read unread messages, active proposals, and recent diffs | filter (unread, all, proposals, chat), mark_as_read |
- Node.js 18+
git clone https://github.com/MPT0M/agent-bridge.git
cd agent-bridge
npm install
npm run buildAdd to your Claude Code MCP configuration (~/.claude/settings.json or run CLI):
claude mcp add agent-bridge node /path/to/agent-bridge/dist/index.js --role driverAdd to your Antigravity MCP settings or configuration:
{
"mcpServers": {
"agent-bridge": {
"command": "node",
"args": ["/path/to/agent-bridge/dist/index.js", "--role", "navigator"]
}
}
}By default, an AI agent cannot receive unsolicited external pushes while idle. Waiting via continuous polling loops burns tokens and context quota rapidly.
agent-bridge solves this with a single-shot filesystem sentinel (agent-bridge watch). The sentinel sleeps on kernel filesystem notifications (fs.watch) using 0 tokens while waiting in silence. When peer activity is detected (a message, proposal, or diff), it coalesces rapid events (2-second window), prints a diagnostic summary, and exits with code 0. This process termination signals the agent harness to wake up automatically.
Agent A (Active) Agent B (Sleeping)
──────────────── ──────────────────
Writes proposal or chat
│
▼
.agent-bridge/ (atomic write) ───► fs.watch kernel event
│
Coalescence window (2s)
│
agent-bridge watch exits (code 0)
│
▼
Agent B wakes up automatically!
Calls `read_bridge` (unread)
Processes peer input
Rearms watcher & goes to sleep
When Claude finishes a turn and needs to await Navigator input, run the watcher in the background:
node /path/to/agent-bridge/dist/index.js watch --role driverIn Claude Code, running a background command emits a Background task completed notification upon process exit. Instruct Claude:
"Whenever you finish a turn waiting for Navigator feedback, run
agent-bridge watch --role driverin the background. When the background task notifies you of peer activity, callread_bridgeto inspect the inbox and rearm the watcher."
Antigravity automatically wakes up when background tasks complete. Run the watcher as a background task:
node C:/path/to/agent-bridge/dist/index.js watch --role navigatorWhen Antigravity receives the completion message:
- Calls
read_bridge({ filter: 'unread' }). - Evaluates the proposal or inspects the diff.
- Submits feedback via
review_proposalorchat_with_peer. - Relaunches
agent-bridge watch --role navigatorin the background and ends turn.
Run unit tests:
npm testBuild distribution:
npm run buildMIT © MPT0M