agy-pi-bridge_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.
agy-pi-bridge
Structured Pi CLI agent orchestration plugin for Google Antigravity
Typed MCP tools · Zero-polling event waiter (agy-pi wait) · Streaming --mode json liveness watchdog · Visual Roles Studio & Settings Sidecar UI
English · 简体中文
Why agy-pi-bridge?
Calling pi -p through ad-hoc shell commands works for one-off prompts, but creates heavy friction in daily multi-agent workflows:
Hand-crafting long CLI flags (
--model,--thinking,--exclude-tools,--append-system-prompt, temp prompt files, output redirects) every turn.Text-mode
pi -pbuffers output until completion, leaving/tmp/pi-*.mdat 0 bytes while the main agent burns turns on timers,ps,pgrep, andtailliveness checks.Antigravity enforces a 180s MCP call timeout and has no built-in push callback for long-running background MCP calls.
agy-pi-bridge solves this with a hybrid architecture:
Typed MCP Control Plane (
agy-pi-bridge_bridge): 6 eager tools (pi_run,pi_batch_run,pi_status,pi_result,pi_cancel,pi_roles). Short tasks (mode: "auto",syncWaitSec <= 140) complete in 1 turn; long tasks degrade gracefully to async without killing the run.Zero-Polling Event Waiter (
agy-pi wait): Pairs with Antigravity's native backgroundrun_commandReactive Wakeup. Exits the exact moment Pi finishes (or triggers the stall detector) and prints a concise structured summary + incremental changed files—zero timer loops.Streaming
--mode json+ Smart Liveness Watchdog: Strictly LF-framed JSONL parser tracks turns, active tools, retries, and child process tree CPU (distinguishesbusy_childbuilds/tests from trulystalledruns), with fullPGIDtree termination on cancel or hard timeout.Native Sidecar Panel (
sidecar://agy-pi-bridge/bridge/):Runs: Live run monitor, tool execution timeline, incremental changed files, Quick Run drawer, Cancel & Send to Chat.
Roles Studio: Visually create, edit, duplicate, reset, or import/export role profiles with local
pi --list-modelsautocomplete—persisted live toprofiles.json.Settings: English / 简体中文 switcher (default English, persisted across sessions), polling cadence, runtime diagnostics, maintenance actions, and one-click Agent Role Setup prompt handoff.
1x Quota Friendly: Contains no Antigravity custom/plugin
agents/*.mddefinitions; only MCP, CLI, rules, skill, and sidecar.
Related MCP server: native-agent-router
Requirements
Node.js >= 22 (zero external runtime dependencies;
install.sh/install.ps1also auto-detect Antigravity's bundledagy-node)Pi CLI installed and authenticated (
pi --list-models)Google Antigravity (Desktop / IDE / CLI)
Installation
Option 1: Clone & install script (recommended)
git clone https://github.com/Ayagikei/agy-pi-bridge.git
cd agy-pi-bridge
# Copy install into ~/.gemini/config/plugins/agy-pi-bridge
./install.sh
# Or symlink install for local development
./install.sh --linkWindows PowerShell:
git clone https://github.com/Ayagikei/agy-pi-bridge.git
cd agy-pi-bridge
.\install.ps1
# Or junction link install:
.\install.ps1 --linkOption 2: Direct clone into Antigravity's plugins folder
git clone https://github.com/Ayagikei/agy-pi-bridge.git ~/.gemini/config/plugins/agy-pi-bridgeOption 3: Ask Antigravity to install it for you
Send this directly in Antigravity chat:
Clone https://github.com/Ayagikei/agy-pi-bridge.git and run its install.sh (or install.ps1 on Windows), then show me the link to enable the plugin and open the Pi Bridge sidecar panel.After installation:
Open Customizations → Installed (or click
customization://agy-pi-bridge) and ensure Pi Agent Bridge is enabled.Start a new conversation so Antigravity loads the 6 eager MCP tools and plugin routing rules.
Open the sidecar panel via
sidecar://agy-pi-bridge/bridge/(you can switch between English and 简体中文 anytime in the Settings tab).
Configuring Roles (Recommended First Step)
Because every user has different Pi providers and subscriptions, all 10 built-in roles ship with safe guardrails and an empty model: "" (inheriting your Pi CLI default model) so nothing breaks out-of-the-box.
You have three easy ways to assign models and thinking levels to each role:
Way 1: Let Antigravity Configure Roles Automatically (Fastest)
Copy and send this prompt to Antigravity in a new conversation (also available as a one-click button inside Pi Bridge → Settings):
Please inspect my local Pi models using pi_roles(operation: "models") (filter by provider if needed) and configure my agy-pi-bridge roles via pi_roles(operation: "upsert") so explore, implement, review, and accept_mobile roles each use my best available models and thinking levels.You can also customize the mapping explicitly, for example:
Inspect my local Pi models via pi_roles(operation: "models", provider: "openai") and configure agy-pi-bridge roles using pi_roles(operation: "upsert"):
- explore_fast / explore_deep: my fast / deep reasoning model (read-only)
- implement_logic / implement_complex: my coding model (leaf, no subagents)
- review_routine / review_deep: my independent code review model
- accept_mobile: my multimodal UI validation model (keep requireDeviceSerial: true)
Show me a summary table after saving.Tip for Agent Authors: Always call
pi_roles(operation: "models", provider: "...")orquery: "..."instead of dumping hundreds of models unfiltered. Allpi_roles(operation: "upsert")edits write atomically to~/.gemini/antigravity/plugin_state/agy-pi-bridge/profiles.jsonand take effect immediately for MCP, CLI, and the Sidecar UI.
Way 2: Visual Roles Studio (Sidecar UI)
Open Pi Bridge (sidecar://agy-pi-bridge/bridge/) → Roles:
Pick any built-in role or click + New Role.
Click Models to fetch your local
pi --list-modelscatalog for autocomplete.Configure primary model, thinking level, fallback model, session mode, read-only/subagent/device-lock toggles, excluded tools, watchdog timeouts, and appended system prompt.
Click Save — changes apply live with zero restart. Use JSON to export/import or share profiles.
Way 3: Edit profiles.json Directly
Overrides are stored in ~/.gemini/antigravity/plugin_state/agy-pi-bridge/profiles.json (array of partial or full role objects merged onto built-in defaults):
[
{
"id": "explore_fast",
"model": "your-provider/your-fast-model",
"thinking": "medium"
},
{
"id": "implement_logic",
"model": "your-provider/your-coding-model",
"thinking": "low",
"systemPromptAppend": "Perform all code edits and tests directly. Do not delegate edits to subagents. Do not commit or push."
},
{
"id": "review_deep",
"model": "your-provider/your-reasoning-model",
"thinking": "high"
},
{
"id": "accept_mobile",
"model": "your-provider/your-multimodal-model",
"thinking": "high"
}
]Built-in Roles
Role ID | Category | Default Guardrails | Session |
| Explore | Read-only ( | Ephemeral |
| Implement | Direct edits, leaf ( | Persistent |
| Review | Read-only, leaf, prioritized findings contract | Ephemeral |
| Accept | Repo read-only ( | Persistent |
| Accept | Repo read-only ( | Persistent |
MCP Tools & CLI Reference
MCP Tools (agy-pi-bridge_bridge)
Tool | Purpose |
| Run a role or resume a finished persistent run via |
| Launch multiple independent tasks concurrently (rejects duplicate |
| Live health ( |
| Bounded ( |
| Terminate the entire process group ( |
|
|
CLI (bin/agy-pi.mjs)
# Zero-polling event wait (exit 0=done, 1=failed, 124=stalled alert, 130=cancelled)
node bin/agy-pi.mjs wait <runId...> [--mode all|any] [--no-stall-exit]
# Launch, inspect, or cancel from terminal
node bin/agy-pi.mjs run --role review_routine --cwd /path/to/repo --prompt "Review git diff"
node bin/agy-pi.mjs run --resume-run <runId> --prompt "Address P1-1 and re-run tests"
node bin/agy-pi.mjs status [runId]
node bin/agy-pi.mjs cancel <runId>
# Inspect roles or filter local Pi models
node bin/agy-pi.mjs roles list
node bin/agy-pi.mjs roles models
node bin/agy-pi.mjs roles models --provider openai --query miniUninstall
./uninstall.sh
# Optionally also remove saved profiles.json, settings.json, and run history:
./uninstall.sh --purge-stateWindows PowerShell:
.\uninstall.ps1
# Or with state cleanup:
.\uninstall.ps1 --purge-stateTesting
npm testLicense
MIT
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Your org's AI agents, tasks, runs, search, and brain files as MCP tools and resources.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Email inboxes, webhook URLs, mock APIs and 170+ tools for coding agents over one MCP connection.
MCP-first toolbox for agents: KV storage, auth, queue, and utility tools. Free in early access.
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceEnables Claude Code to delegate coding implementation and testing to a local pi agent via MCP tools, including dispatching task books, monitoring status, steering or aborting runs mid-execution, and retrieving results and transcripts.4MIT
- AlicenseAqualityCmaintenanceEnables orchestrator agents to route coding tasks to native CLI worker agents via MCP, providing tools for agent discovery, task submission, waiting, inspection, and cancellation.53MIT
- AlicenseNot gradedqualityBmaintenanceEnables unified access to multiple coding-agent CLIs via MCP, with tools for running prompts, managing sessions, and retrieving task outputs.MIT
- AlicenseNot gradedqualityBmaintenanceEnables AI coding agents across supported harnesses to run a structured multi-agent workflow with persistent memory, squad roles, and bundled skills through MCP tools.108 npm3MIT