Moonbridge
OfficialSpawns Google Gemini CLI agents through the gemini adapter, supporting Gemini model overrides and authentication via the Gemini CLI login flow or GEMINI_API_KEY.
Spawns OpenAI Codex agents through the codex adapter, supporting OPENAI_API_KEY authentication, model overrides such as gpt-5.3-codex, and reasoning-effort settings.
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.
Moonbridge
Your MCP client just got a team.
Spawn AI coding agents from Claude Code, Cursor, or any MCP client. Run 10 approaches in parallel for a fraction of the cost.
uvx moonbridgeQuick Start
Install at least one supported CLI:
Adapter
Install
Authenticate
Kimi (default)
uv tool install --python 3.13 kimi-clikimi loginCodex
npm install -g @openai/codexSet
OPENAI_API_KEYOpenCode
curl -fsSL https://opencode.ai/install | bashopencode auth loginGemini CLI
npm install -g @google/gemini-cliRun
geminilogin flow or setGEMINI_API_KEYAdd to MCP config (
~/.mcp.json):{ "mcpServers": { "moonbridge": { "type": "stdio", "command": "uvx", "args": ["moonbridge"] } } }Use it. Your MCP client now has
spawn_agentandspawn_agents_paralleltools.
Related MCP server: pi-mcp
Security Warning (Read First)
Moonbridge executes agentic CLIs (Kimi/Codex/OpenCode/Gemini). A malicious or careless prompt can cause an agent to run shell commands, read accessible files, or exfiltrate data via network calls.
Moonbridge adds guardrails (MOONBRIDGE_ALLOWED_DIRS, environment allowlists, optional
MOONBRIDGE_SANDBOX=1), but these are not equivalent to OS-level containment.
For untrusted prompts or shared environments, run Moonbridge inside a container or VM with least-privilege filesystem and network access.
Updating
Moonbridge checks for updates on startup (cached for 24h). To update manually:
# If using uvx (recommended)
uvx moonbridge --refresh
# If installed as a tool
uv tool upgrade moonbridgeDisable update checks for CI/automation:
export MOONBRIDGE_SKIP_UPDATE_CHECK=1When to Use Moonbridge
Task | Why Moonbridge |
Parallel exploration | Run 10 approaches simultaneously, pick the best |
Frontend/UI work | Kimi excels at visual coding and component design |
Tests and documentation | Cost-effective for high-volume tasks |
Refactoring | Try multiple strategies in one request |
Best for: Tasks that benefit from parallel execution or volume.
How it Works
Connection Flow
MCP client (Claude Code, Cursor, etc.) connects to Moonbridge over stdio
Client discovers available tools via
list_toolsClient calls
spawn_agentorspawn_agents_parallel
Spawn Process
Moonbridge validates the prompt and working directory
Resolves which adapter to use (Kimi, Codex, OpenCode, Gemini)
Adapter builds the CLI command with appropriate flags
Spawns subprocess in a separate process group
Captures stdout/stderr, enforces timeout
Returns structured JSON result
Parallel Execution
spawn_agents_parallelruns up to 10 agents concurrently viaasyncio.gatherEach agent is independent (separate process, separate output)
All results returned together when the last agent finishes (or times out)
MCP Client → stdio → Moonbridge → adapter → CLI subprocess
→ CLI subprocess (parallel)
→ CLI subprocess (parallel)Tools
Tool | Use case |
| Single task: "Write tests for auth.ts" |
| Go wide: 10 agents, 10 approaches, pick the best |
| Verify an adapter CLI is installed and authenticated |
| Show available adapters and their status |
| Show known/dynamic model options for an adapter |
Example: Parallel Exploration
{
"agents": [
{"prompt": "Refactor to React hooks"},
{"prompt": "Refactor to Zustand"},
{"prompt": "Refactor to Redux Toolkit"}
]
}Three approaches. One request. You choose the winner.
Tool Parameters
spawn_agent
Parameter | Type | Required | Description |
| string | Yes | Task description for the agent |
| string | No | Backend to use: |
| string | No | Model override (e.g., |
| boolean | No | Enable reasoning mode (Kimi only) |
| string | No | Reasoning budget: |
| integer | No | Override default timeout (30-3600) |
spawn_agents_parallel
Parameter | Type | Required | Description |
| array | Yes | List of agent configs (max 10) |
| string | Yes | Task for this agent |
| string | No | Backend for this agent |
| string | No | Model override for this agent ( |
| boolean | No | Enable reasoning (Kimi only) |
| string | No | Reasoning budget (Codex only, default |
| integer | No | Timeout for this agent |
check_status
Parameter | Type | Required | Description |
| string | No | Adapter to check explicitly. Defaults to |
list_models
Parameter | Type | Required | Description |
| string | No | Adapter to inspect. Defaults to |
| string | No | Provider filter for OpenCode model catalogs (e.g., |
| boolean | No | Refresh model catalog for adapters that support dynamic discovery. |
Response Format
All tools return JSON with these fields:
Field | Type | Description |
| string |
|
| string | stdout from the agent |
| string|null | stderr if any |
| int | Process exit code (-1 for timeout/error) |
| int | Execution time in milliseconds |
| int | Agent index (0 for single, 0-N for parallel) |
| string? | Human-readable error context (when applicable) |
| object? | Optional structured metadata (e.g., sandbox diff) |
When output is too large, Moonbridge truncates it and adds raw.output_limit metadata
with original sizes.
Configuration
Environment Variables
Variable | Description |
| Default adapter (default: |
| Default timeout in seconds (30-3600) |
| Kimi-specific default timeout |
| Codex-specific default timeout |
| OpenCode-specific default timeout |
| Gemini-specific default timeout |
| Global default model override |
| Kimi-specific model override |
| Codex-specific model override |
| OpenCode-specific model override |
| Gemini-specific model override |
| Maximum parallel agents |
| Max chars returned per agent across |
| Colon-separated allowlist of working directories |
| Set to |
| Set to |
| Set to |
| Max diff size in bytes (default 500000) |
| Max sandbox copy size in bytes (default 500MB) |
| Set to |
Security
Moonbridge inherits the security model of the selected adapter CLI. Kimi, Codex, OpenCode, and Gemini are agentic CLIs; prompts can trigger command execution, file access, and network activity within the process permissions.
1. Threat Model (Prompt Injection Included)
If an attacker can influence prompt input sent through MCP, they can attempt to make the agent:
read sensitive files (for example
~/.sshor.env),run destructive shell commands,
exfiltrate data over the network.
Moonbridge does not inspect prompt intent. Treat prompt input as potentially untrusted.
2. Directory Restrictions (MOONBRIDGE_ALLOWED_DIRS)
Default: agents can operate in any directory. Set MOONBRIDGE_ALLOWED_DIRS to restrict: colon-separated allowed paths. Symlinks resolved via os.path.realpath before checking. Strict mode (MOONBRIDGE_STRICT=1) exits on startup if no valid allowed directories are configured.
export MOONBRIDGE_ALLOWED_DIRS="/home/user/projects:/home/user/work"
export MOONBRIDGE_STRICT=1 # require restrictions3. Environment Sanitization
Only whitelisted env vars are passed to spawned agents. Each adapter defines its own allowlist (PATH, HOME, plus adapter-specific like OPENAI_API_KEY for Codex). Your shell environment (secrets, tokens, SSH keys) is not inherited by default.
4. Input Validation
Model parameters are validated to prevent flag injection (values starting with - are rejected). Prompts are capped at 100,000 characters and cannot be empty.
5. Process Isolation and Sandbox Mode
Agents run in separate process groups (start_new_session=True). Orphan cleanup on exit. Sandbox mode available (MOONBRIDGE_SANDBOX=1) for copy-on-run isolation.
Not OS-level sandboxing. Agents can still read or write arbitrary host files they can access.
6. Hardened Deployment Checklist
Set
MOONBRIDGE_ALLOWED_DIRSto the smallest possible set.Enable
MOONBRIDGE_STRICT=1so missing restrictions fail closed.Enable
MOONBRIDGE_SANDBOX=1to avoid direct workspace mutation.Run Moonbridge in a container/VM for strong isolation.
Do not expose Moonbridge to untrusted clients without additional auth controls.
Troubleshooting
"CLI not found"
Install the CLI for your chosen adapter:
# Kimi
uv tool install --python 3.13 kimi-cli
which kimi
# Codex
npm install -g @openai/codex
which codex
# OpenCode
curl -fsSL https://opencode.ai/install | bash
which opencode
# Gemini
npm install -g @google/gemini-cli
which gemini"auth_error" responses
Authenticate with your chosen CLI:
# Kimi
kimi login
# Codex
export OPENAI_API_KEY=sk-...
# OpenCode
opencode auth login
# Gemini
gemini # complete login flow, or set GEMINI_API_KEYTimeout errors
Adapters have sensible defaults: Codex=1800s, Kimi=600s, OpenCode=1200s, Gemini=1200s.
For exceptionally long tasks, override explicitly:
{"prompt": "...", "timeout_seconds": 3600}Or set per-adapter defaults via environment:
export MOONBRIDGE_CODEX_TIMEOUT=2400 # 40 minutes
export MOONBRIDGE_KIMI_TIMEOUT=900 # 15 minutes
export MOONBRIDGE_OPENCODE_TIMEOUT=1200 # 20 minutes
export MOONBRIDGE_GEMINI_TIMEOUT=1200 # 20 minutesTimeout Best Practices
Task Type | Recommended |
Quick query, status | 60-180s |
Simple edits | 300-600s |
Feature implementation | 1200-1800s |
Large refactor | 1800-3600s |
Priority resolution: explicit param > adapter env > adapter default > global env > 600s fallback
"MOONBRIDGE_ALLOWED_DIRS is not set" warning
By default, Moonbridge warns at startup if no directory restrictions are configured. This is expected for local development. For shared/production environments, set allowed directories:
export MOONBRIDGE_ALLOWED_DIRS="/path/to/project:/another/path"Sandbox Mode (Copy-on-Run)
Enable sandbox mode to run agents in a temporary copy of the working directory:
export MOONBRIDGE_SANDBOX=1When enabled:
Agents run in a temp copy of
cwd.Host files stay unchanged by default.
A unified diff + summary is included in
raw.sandbox.
Optional:
export MOONBRIDGE_SANDBOX_KEEP=1 # keep temp dir
export MOONBRIDGE_SANDBOX_MAX_DIFF=200000
export MOONBRIDGE_SANDBOX_MAX_COPY=300000000Limitations: this is not OS-level isolation. Agents can still read/write arbitrary host paths if they choose to. Use containers/VMs for strong isolation.
To enforce restrictions (exit instead of warn):
export MOONBRIDGE_STRICT=1Permission denied on working directory
Verify the directory is in your allowlist:
export MOONBRIDGE_ALLOWED_DIRS="/path/to/project:/another/path"Debug logging
Enable verbose logging:
export MOONBRIDGE_LOG_LEVEL=DEBUGPlatform Support
macOS and Linux only. Windows is not supported.
License
MIT. See LICENSE.
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
A paid remote MCP for OpenAI Codex agent coordination MCP, built to return verdicts, receipts, usage
Coordinate coding agents through MCP using existing AI plans, saved work, and independent checks.
Discover and call AI agents via MCP. Supports A2A agents and platform agents with async tasks.
- aXDeprecatedio.github.ax-platform
Agent-native collaboration network: orchestrate a team of long-running agents from any MCP client.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables MCP clients to delegate tasks to multiple local and cloud AI workers (Codex, Claude Code, DeepSeek, GLM, Gemini) with deterministic routing, concurrent batch execution, idempotent retries, and auditable traces.MIT
- AlicenseNot gradedqualityBmaintenanceOrchestrates multiple coding agents at once so an MCP client can delegate implementation work while retaining judgment: each agent runs in its own isolated git worktree and branch, claims the files it edits, and communicates via a mailbox and shared board. Supports blocking questions to the orchestrator, Codex-written acceptance tests locked before workers start, scope validation, and reporting on first-pass success.1Apache 2.0
- FlicenseNot gradedqualityAmaintenanceEnables a primary AI assistant in an IDE to delegate tasks to multiple specialized AI coding assistants through a local MCP server, running them in parallel with shared project context and synthesizing their responses.-
- FlicenseNot gradedqualityAmaintenanceEnables a primary AI assistant in an IDE to delegate tasks to multiple specialized AI coding assistants via MCP, running them in parallel with shared project context and synthesizing a single response. It uses existing CLI tools and subscriptions, supporting Codex, Claude, Cursor, Gemini, and 26+ MCP-compatible clients.-