# ai-cli-mcp

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 27
- Author: mkXultra
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/mkXultra/ai-cli-mcp
- Updated: 2026-09-30
- HTML: https://affpapa.org/en/nevibecode/mcp/ai-cli-mcp

## What it 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.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add ai-cli-mcp -- npx -y ai-cli-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add ai-cli-mcp -- npx -y ai-cli-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "ai-cli-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "ai-cli-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "ai-cli-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "ai-cli-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add ai-cli-mcp npx -y ai-cli-mcp
```

## When to use it
- 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
- 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`

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
