loading…
Search for a command to run...
loading…
An MCP-only server that launches AI CLI tasks (Claude, Codex, Gemini, Forge, OpenCode) as background subprocesses and manages them via PID for status, output, a
An MCP-only server that launches AI CLI tasks (Claude, Codex, Gemini, Forge, OpenCode) as background subprocesses and manages them via PID for status, output, and lifecycle control.
MCP-only server for running local Claude, Codex, Forge, OpenCode, and Antigravity CLI agents as background jobs.
English | 简体中文
agent-bridge-mcp lets an MCP client delegate work to AI coding CLIs already installed on your machine. It does not call model APIs directly. Instead, it starts local Claude, Codex, Forge, OpenCode, or Antigravity CLI processes in the background, returns a PID immediately, and exposes MCP tools to inspect, wait for, peek at, terminate, and clean up those jobs.
The package has one executable entry point:
agent-bridge-mcp
Most AI CLIs are excellent at real local work: editing files, running commands, searching code, using project context, and continuing long tasks. MCP clients, however, need a stable tool contract and should not block while a long agent process runs.
This server bridges that gap:
peek.agent-bridge-mcp is intentionally narrow:
ai-cli run, ai-cli ps, or similar subcommands.~/.agent-bridge-mcp by default; set AGENT_BRIDGE_PROCESS_REGISTRY_DIR to override the location.The server can launch these local tools:
You must install, configure, and sign in to the CLIs you plan to use before calling run. doctor only checks whether binaries can be resolved and executed; it does not check account state.
Gemini CLI support has been removed because that CLI is no longer maintained. Legacy gemini-* models and gemini-ultra are rejected instead of being routed to another agent.
^20.19.0 || >=22.12.0git clone https://github.com/lailai258/agent-bridge-mcp.git
cd agent-bridge-mcp
npm install
npm run build
Start the built MCP server:
npm start
Development mode:
npm run dev
If installed from npm, the package name is:
npm install -g agent-bridge-mcp-server
Then start the stdio server with:
agent-bridge-mcp
Use the package executable when it is available on PATH:
{
"mcpServers": {
"agent-bridge-mcp": {
"command": "agent-bridge-mcp",
"args": []
}
}
}
Or point your MCP client at the built server file:
{
"mcpServers": {
"agent-bridge-mcp": {
"command": "node",
"args": [
"/absolute/path/to/agent-bridge-mcp/dist/server.js"
]
}
}
}
MCP registry metadata is available in server.json.
Call run from your MCP client:
{
"model": "codex-ultra",
"workFolder": "/absolute/path/to/project",
"prompt": "Review this repository and identify the most important test failures."
}
The server returns immediately:
{
"pid": 12345,
"status": "started",
"agent": "codex",
"message": "codex process started successfully"
}
Later, inspect the process:
{
"pid": 12345,
"verbose": true
}
Or wait for it:
{
"pids": [12345],
"timeout": 300,
"on_timeout": "return_status",
"verbose": false
}
All tool responses are returned as MCP text content containing pretty-printed JSON.
runStarts a new local AI CLI child process in the background and returns a PID immediately.
Required:
workFolder: absolute working directory for the agent process.Prompt input, exactly one required:
prompt: inline task prompt.prompt_file: absolute path or path relative to workFolder.Optional:
model: standard model, alias, or OpenCode dynamic model. Use antigravity to select Antigravity CLI.reasoning_effort: supported only for Claude and Codex.session_id: resume an existing CLI session where the selected CLI supports it.list_processesLists tracked processes from current server memory plus the persisted process registry:
pidagentstatusStatuses are running, completed, or failed.
get_resultReturns the current status and output for one PID.
Parameters:
pid: PID returned by run.verbose: include metadata such as startTime, workFolder, prompt, and fuller parsed output.waitWaits for one or more tracked processes to finish.
Parameters:
pids: non-empty PID array.timeout: logical wait budget in seconds. Defaults to 900 and can be raised with AGENT_BRIDGE_WAIT_TIMEOUT_SEC.on_timeout: return_status by default; returns current running results when the per-call observation window expires. Use throw only for legacy timeout errors.verbose: return verbose result objects.One MCP tool call observes at most AGENT_BRIDGE_WAIT_CALL_WINDOW_SEC seconds, default 90 and capped at 110, so host tools/call deadlines are not hit while long-running child processes keep running.
peekObserves a short live output window for running processes.
Parameters:
pids: PID array. Duplicates are removed while preserving first-seen order.peek_time_sec: positive integer, default 10, maximum 60.include_tool_calls: include normalized tool-call events without raw tool output.Important boundaries:
peek is not a history API.peek is not a gapless stream.peek is not stdout/stderr tailing.kill_processSends SIGTERM to a running process by PID.
cleanup_processesRemoves completed and failed process records from the server's in-memory process table and persisted registry. Log files are left on disk for troubleshooting.
doctorReports binary path resolution for supported CLIs:
It does not verify login state, terms acceptance, model permissions, or network connectivity.
modelsLists supported model names, aliases, Antigravity entrypoint, and OpenCode dynamic model syntax.
claude-ultra -> Claude opus, with default reasoning_effort=maxcodex-ultra -> Codex gpt-5.5, with default reasoning_effort=xhighClaude:
sonnetsonnet[1m]deepseek-v4-pro[1m]deepseek-v4-flash[1m]glm-5.1opusopusplanhaikuCodex:
gpt-5.4gpt-5.5gpt-5.4-minigpt-5.3-codexgpt-5.3-codex-sparkgpt-5.2Forge:
forgeOpenCode:
opencodeoc-<provider/model>Antigravity:
antigravityantigravity selects the Antigravity CLI agent. This integration does not pass a model flag to agy.
Example dynamic OpenCode model:
{
"model": "oc-openai/gpt-5.4",
"workFolder": "/absolute/path/to/project",
"prompt": "Find the highest-risk regression in this branch."
}
Example OpenCode DeepSeek v4 Pro model:
{
"model": "oc-opencode-go/deepseek-v4-pro",
"workFolder": "/absolute/path/to/project",
"prompt": "Find the highest-risk regression in this branch."
}
reasoning_effort is intentionally limited by agent family:
low, medium, high, xhigh, maxlow, medium, high, xhighInvalid combinations are rejected before launching the child process.
The optional session_id parameter is passed to the selected CLI using that CLI's native resume mechanism:
exec resume <session_id>.--session.--conversation <session_id> in print mode.Session behavior still depends on the installed CLI version and its own storage model.
By default, the server resolves CLIs from common local install paths and PATH.
Override a CLI command or absolute path with environment variables:
CLAUDE_CLI_NAMECODEX_CLI_NAMEFORGE_CLI_NAMEOPENCODE_CLI_NAMEANTIGRAVITY_CLI_NAMEValues may be simple command names or absolute paths. Relative paths such as ./claude or tools/codex are rejected.
Enable debug logging with:
MCP_CLAUDE_DEBUG=true agent-bridge-mcp
MCP Client
↓ stdio / tools.call
MCP Server Boundary src/app/mcp.ts
↓
Runtime Process Layer src/process-service.ts
↓
CLI Adapter Layer src/cli-builder.ts / src/cli-utils.ts
↓
Local AI CLI Processes claude / codex / forge / opencode / agy
Core modules:
run input into safe CLI argument arrays.Live child process handles exist only in the current Node.js server process. Lightweight process metadata and stdout/stderr log paths are persisted in the local registry, which defaults to ~/.agent-bridge-mcp and can be changed with AGENT_BRIDGE_PROCESS_REGISTRY_DIR.
Consequences:
run can be observed live while the same MCP server process is alive.cleanup_processes removes finished records from memory and the persisted registry; it does not delete log files.run call starts a new child process.--dangerously-skip-permissions; Codex uses --dangerously-bypass-approvals-and-sandbox. Only run this server against work folders you trust, and review the selected CLI's own security model before exposing it to untrusted prompts or repositories.peek excludes raw tool output and raw command output.Install dependencies:
npm install
Build:
npm run build
Run unit tests:
npm run test:unit
Run the full test suite:
npm test
Check package contents before publishing:
npm_config_cache="/private/tmp/agent-bridge-mcp-npm-cache" npm pack --dry-run
Additional project documentation:
MIT. See LICENSE.
Run in your terminal:
claude mcp add agent-bridge-mcp -- npx Yes, Agent Bridge MCP is free — one-click install via Unyly at no cost.
No, Agent Bridge runs without API keys or environment variables.
Self-hosted: the server runs locally on your machine via the install command above.
Open Agent Bridge on unyly.org, pick your client tab (Claude Desktop, Claude Code, Cursor) and press Install — the config is generated automatically, no JSON editing.
CSA PROJECT - FZCO © 2026 IFZA Business Park, DDP, Premises Number 31174 - 001
Security
Low riskAutomated heuristic from public metadata — not a security guarantee.