mcp-bridge-go

MCP server that bridges AI coding tools on macOS. mcp-bridge-go is a free, lightweight MCP server in Go that lets AI coding tools on macOS, such as Gemini CLI, Antigravity and Claude Desktop, pass tasks to each other through AppleScript automation, so you don't have to copy and paste between them. Source-available (PolyForm Shield).

Documentation

πŸŒ‰ MCP Bridge

Lightweight MCP server that bridges AI coding tools via macOS automation.
Send prompts to any Electron-based AI IDE and get back git diffs β€” all through the MCP protocol.

Problem Β· The Hack Β· How It Works Β· Quick Start Β· API Β· Limitations


πŸ’‘ The Problem

Modern AI-assisted development involves multiple AI tools β€” but they can't talk to each other. You use Gemini CLI for quick tasks, Antigravity for deep coding, Claude Desktop for review β€” and you're the manual copy-paste bridge between them.

We hit this trying to adopt Paperclip for AI agent orchestration:

  • Paperclip doesn't support Antigravity. It ships adapters for Claude Code, Codex, and Cursor β€” but not Antigravity.
  • API costs kill you. Paperclip's default adapter uses Claude Code, which burns paid tokens on trivial routing tasks. Most orchestration doesn't need a frontier model.

πŸ”§ The Hack: Paperclip β†’ Gemini CLI

This is the fun part. Paperclip's agent adapter is hardcoded for Claude Code β€” it calls the agent binary with Claude-specific flags:

claude --print --verbose --max-turns 10 --add-dir /path/to/workspace "Do the task"

Gemini CLI doesn't understand any of these flags. It would just crash.

The hack: a 25-line shell script that pretends to be Claude.

#!/bin/bash
# Paperclip thinks it's calling Claude Code.
# It's not. It's calling Gemini CLI.

# Ignore ALL Claude-specific args ($@). Read prompt from stdin.
PROMPT=$(cat)

# Forward to Gemini CLI with Gemini-native flags
exec gemini --prompt "$PROMPT" --yolo --output-format stream-json

That's it. Paperclip sends a heartbeat with the prompt on stdin + Claude flags as positional args. The wrapper ignores the args and pipes stdin straight to Gemini CLI. Paperclip has no idea it's talking to a different model.

Why this matters

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”    Paperclip     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     MCP Bridge     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  Paperclip  β”‚ ──────────────► β”‚ Gemini CLI  β”‚ ──────────────────► β”‚ Antigravity  β”‚
β”‚  (CEO agent)β”‚   heartbeat      β”‚ (free tier) β”‚    AppleScript      β”‚ (heavy code) β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                  β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                  πŸ†“ Free tokens                     🧠 Deep coding
                                  ⚑ Fast routing                    πŸ“ File changes
                                  πŸ”§ Coordination                    πŸ” Git diffs
LayerWhatCost
PaperclipTask management, agent governanceFree (self-hosted)
gemini-wrapper.shThe 25-line hack β€” translates Claude β†’ GeminiFree
Gemini CLIAI orchestration via Gemini 2.5 ProFree (1,000 req/day)
MCP BridgemacOS automation + git pollingFree (local binary)
AntigravityThe actual codingYour subscription

Total orchestration cost: $0/day for up to 1,000 tasks.


βš™οΈ How It Works

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     MCP stdio     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”     AppleScript     β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  MCP Client  β”‚ ◄───────────────► β”‚ MCP Bridge  β”‚ ──────────────────► β”‚  Target IDE  β”‚
β”‚ (Gemini CLI) β”‚                   β”‚  (Go server) β”‚                    β”‚ (Antigravity)β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜                   β””β”€β”€β”€β”€β”€β”€β”¬β”€β”€β”€β”€β”€β”€β”˜                    β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
                                          β”‚
                                   β”Œβ”€β”€β”€β”€β”€β”€β–Όβ”€β”€β”€β”€β”€β”€β”
                                   β”‚  git status  β”‚
                                   β”‚  (polling)   β”‚
                                   β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
StepWhat happens
1. ClipboardCopies prompt via pbcopy
2. ActivateBrings target app to foreground via AppleScript
3. ChatOpens chat panel (Cmd+shortcut), clears, pastes, Enter
4. PollWatches git status --porcelain until changes appear
5. Stability checkAfter detecting changes, polls 3 more times to confirm IDE stopped writing
6. ReportReturns diff, file status, and new file previews

Stability Check

A naive approach would read the diff as soon as git status changes β€” but the IDE might still be writing files. MCP Bridge uses an active stability check: after detecting changes, it polls git status 3 consecutive times (every 2s). Only when the status is identical across all 3 checks does it consider the IDE done. If the status keeps changing, the counter resets.

Change detected β†’ poll #1 (2s) β†’ same? βœ“ β†’ poll #2 (2s) β†’ same? βœ“ β†’ poll #3 (2s) β†’ same? βœ“ β†’ STABLE β†’ read diff
                                  └─ different? β†’ reset counter, keep polling

πŸš€ Quick Start

Build

git clone https://github.com/jangtrinh/mcp-bridge-go.git
cd mcp-bridge-go
make build

Configure

All configuration via environment variables β€” zero config files:

VariableDefaultDescription
MCP_BRIDGE_APPAntigravityTarget application name
MCP_BRIDGE_SHORTCUTlKey for chat panel (used with Cmd)
MCP_BRIDGE_WORKSPACE. (current dir)Default workspace path

Supported Apps

AppMCP_BRIDGE_APPMCP_BRIDGE_SHORTCUT
AntigravityAntigravityl
CursorCursorl
WindsurfWindsurfl

πŸ’‘ Works with any Electron-based AI IDE that has a keyboard shortcut to open a chat panel.

Add to Gemini CLI

~/.gemini/settings.json:

{
  "mcpServers": {
    "mcp-bridge": {
      "command": "/path/to/mcp-bridge",
      "env": {
        "MCP_BRIDGE_APP": "Antigravity",
        "MCP_BRIDGE_WORKSPACE": "/path/to/your/project"
      }
    }
  }
}

Add to Claude Desktop

~/Library/Application Support/Claude/claude_desktop_config.json:

{
  "mcpServers": {
    "mcp-bridge": {
      "command": "/path/to/mcp-bridge",
      "env": {
        "MCP_BRIDGE_APP": "Cursor",
        "MCP_BRIDGE_WORKSPACE": "/path/to/your/project"
      }
    }
  }
}

Use with Paperclip

Step 1: Build MCP Bridge and add it to Gemini CLI (see above).

Step 2: In Paperclip, set the agent command to the adapter:

/path/to/mcp-bridge-go/scripts/paperclip-adapter.sh

Step 3: Start Paperclip, open Antigravity with your project, assign a task. The full chain activates on the next heartbeat:

Paperclip CEO β†’ paperclip-adapter.sh β†’ Gemini CLI (free) β†’ MCP Bridge β†’ Antigravity
     β”‚                   β”‚                     β”‚                   β”‚
     β”‚                   β”‚                     β”‚                   └── Writes code, edits files
     β”‚                   β”‚                     └── Has MCP Bridge as MCP server
     β”‚                   └── Ignores Claude flags, pipes stdin to Gemini
     └── Sends heartbeat with prompt on stdin

πŸ”§ MCP Tools

send_to_app

Sends a prompt to the target application and waits for workspace changes.

ParameterRequiredDefaultDescription
promptβœ…β€”The prompt/task to send
workspacePathβ€”MCP_BRIDGE_WORKSPACEWorkspace to monitor
waitSecondsβ€”120Max wait time (seconds)

On success: Returns markdown with prompt echo, change status, and full workspace diff.

On timeout: Returns diagnostic report β€” app state (running/frontmost), workspace state, and recommended next actions.

check_workspace_changes

Checks current workspace state without sending a prompt.

ParameterRequiredDefaultDescription
workspacePathβ€”MCP_BRIDGE_WORKSPACEWorkspace to check

Returns: Git status, diff (≀5KB), untracked file previews (≀500 chars each), and 3 most recent commits.


⚠️ Known Limitations

Git Polling as Completion Signal

MCP Bridge uses git status to detect when the target AI has finished. This is the biggest architectural trade-off:

ScenarioGit statusBridge behavior
AI writes codeChangesβœ… Stability check β†’ returns diff
AI asks a clarifying questionNo changes⏱ Timeout with diagnostic
AI says "no changes needed"No changes⏱ Timeout with diagnostic
AI crashesNo changes⏱ Timeout with diagnostic

Why? Antigravity (and similar IDEs) don't expose an API to read AI responses. The GUI is the only interface. Git polling detects side effects (file changes) but is blind to text responses.

Timeout Diagnostics

When no changes are detected, MCP Bridge returns an informative diagnostic instead of failing silently:

⏱ Prompt sent to Antigravity but no file changes detected after 120s.

Diagnostic:
- Antigravity: running and frontmost (may still be processing)
- Workspace: clean (no uncommitted changes)
- Wait time: 120s

Recommended actions:
- The AI may have responded with a question or explanation (no code changes)
- Try sending a more specific prompt
- Use `check_workspace_changes` to verify current state
- Increase `waitSeconds` if the task is complex

Other Limitations

  • macOS only β€” AppleScript is not available on other platforms
  • Requires UI focus β€” target app comes to foreground during submission
  • Sequential only β€” one prompt at a time (needs app focus)
  • No response content β€” captures file changes, not the AI's text response

πŸ”„ Alternatives

ToolApproachTrade-off
SimulateDevFull workflow engine, AppleScript-basedHeavier β€” full Planner/Coder/Tester pipeline
Claude Agent TeamsClaude agents via @mentionsLocked to Claude ecosystem
applescript-mcpGeneric AppleScript MCP serverGeneral-purpose, no AI-IDE-specific features
VS Code SubagentsVS Code's native delegationVS Code only, not cross-tool
MCP BridgeMCP-native, ~560 lines, cross-toolmacOS only, sequential, requires UI focus

MCP Bridge is for you if: You want a tiny, composable MCP tool that connects any MCP client to any Electron-based AI IDE β€” especially if you're optimizing for free-tier models as orchestrators.


πŸ› οΈ Development

make audit    # Runs: gofmt β†’ go vet β†’ golangci-lint β†’ gosec β†’ go build
make build    # Compile with version/commit/date via ldflags
make lint     # Static analysis only
make clean    # Remove binary

See CONTRIBUTING.md for code standards and PR guidelines.

πŸ“‹ Requirements

  • macOS β€” uses AppleScript for UI automation
  • Go 1.26+ β€” to build from source
  • Git β€” for workspace change detection
  • Target app must be open with a workspace loaded
  • Accessibility permissions β€” System Settings β†’ Privacy & Security β†’ Accessibility β†’ enable your terminal/MCP client

πŸ“„ License

PolyForm Shield 1.0.0 Β© 2026 Jang Trinh β€” free to use and modify; no resale or competing products.


Built by the founder of EaseUI β€” an AI-powered design tool that generates production-ready UI from text prompts.