Skip to main content
MCP server CX Codex

ai-cli-mcp — Claude Code MCP server: run AI CLIs in the background

An MCP server that lets your agent fire off Claude, Claude, Gemini or OpenCode CLI jobs in the background and keep working while they run.

Install into Claude Code · Platform CLI All methods and platforms ↓
claude mcp add ai-cli-mcp -- npx -y ai-cli-mcp
Open on GitHub

What ai-cli-mcp does

The server exposes a single run tool. Your agent in Claude, Cursor or Claude hands it a task and a model name; the outside CLI executes it as a separate process with PID tracking. Control comes back right away, so the calling model can start the next job or spin up another agent. wait blocks until the work finishes and returns a parsed result, and the response carries a session_id you pass to later runs so a large codebase isn't read twice.

Models are picked by name: Claude (sonnet, opus, haiku), Claude (gpt-5.3-codex, gpt-5.5), Gemini, Claude, OpenCode and Pi. Gemini runs through the Antigravity CLI agy; GROK_CLI_NAME and PI_CLI_NAME override the binary name or path for those two. Each CLI has to be installed and signed in locally, so an unconfigured opencode means that run fails. For Claude you need a passing claude doctor plus one manual launch where you accept --dangerously-skip-permissions.

Permits come from bypassing confirmations: Claude runs with --dangerously-skip-permissions, Claude with --dangerously-bypass-approvals-and-sandbox. The agent edits files and executes commands in your working folder without asking. Keep that on a git-tracked repo rather than a directory holding anything you can't restore.

What it helps with

  • run several agents in parallel on different models
  • collect the output of a background job when it finishes
  • resume a session by session_id instead of resending context
  • call an outside AI CLI from Cursor or Claude
  • split a refactor and its unit tests across two models

Example prompts for the agent

  • Run the src/backend refactor through run on sonnet, then wait and show me the result
  • Read every file under src/ with run on opus, give me the session_id, then start two jobs on gpt-5.3-codex with it
  • Start a project review via run with gemini-3.1-pro-high and --cwd ./project

How to install ai-cli-mcp

Platform CLI

claude mcp add ai-cli-mcp -- npx -y ai-cli-mcp

Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more

Questions about ai-cli-mcp

How do I install ai-cli-mcp in Claude Code?

Run claude mcp add ai-cli-mcp -- npx -y ai-cli-mcp. Restart the session afterwards so the server comes up.

What does ai-cli-mcp do?

It launches an outside AI CLI (Claude, Claude, Gemini, OpenCode, Claude, Pi) as a background process when your agent asks, tracks the PID, and hands back a structured answer.

What has to be set up first?

Whichever CLIs you plan to call must be installed and authenticated locally. For Claude a clean claude doctor and one manual run accepting --dangerously-skip-permissions are enough; the other CLIs are optional.

Similar MCP servers

All MCP servers for Agent setup: memory, context, orchestration →

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor