MCP server for AI CLI tools (Claude, Codex, and Gemini) with background process management
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
๐ฏ๐ต ๆฅๆฌ่ชใฎREADMEใฏใใกใ
๐ฆ Package Migration Notice: This package was formerly
@mkxultra/claude-code-mcpand has been renamed toai-cli-mcpto reflect its expanded support for multiple AI CLI tools.
An MCP (Model Context Protocol) server that allows running AI CLI tools (Claude, Codex, Gemini, Forge, and OpenCode) in background processes with automatic permission handling.
Did you notice that Cursor sometimes struggles with complex, multi-step edits or operations? This server, with its powerful unified run tool, enables multiple AI agents to handle your coding tasks more effectively.
This MCP server provides tools that can be used by LLMs to interact with AI CLI tools. When integrated with MCP clients, it allows LLMs to:
--dangerously-skip-permissions)--dangerously-bypass-approvals-and-sandbox)-y)forge -C <workFolder> -p <prompt>)opencode run --format json --dir <workFolder> <prompt>)forge), and OpenCode (opencode plus explicit oc-<provider/model> wrappers such as oc-openai/gpt-5.4)You can instruct your main agent to run multiple tasks in parallel like this:
Launch agents for the following 3 tasks using acm mcp run:
- Refactor
src/backendcode usingsonnet- Create unit tests for
src/frontendusinggpt-5.3-codex- Update docs in
docs/usinggemini-2.5-proWhile they run, please update the TODO list. Once done, use the
waittool to wait for all completions and report the results together.
You can reuse heavy context (like large codebases) using session IDs to save costs while running multiple tasks.
- First, use
acm mcp runwithopusto read all files insrc/and understand the project structure.- Use the
waittool to wait for completion and retrieve thesession_idfrom the result.- Using that
session_id, run the following two tasks in parallel withacm mcp run:
- Create refactoring proposals for
src/utilsusingsonnet- Add architecture documentation to
README.mdusinggpt-5.3-codex- Finally,
waitagain to combine both results.
The only prerequisite is that the AI CLI tools you want to use are locally installed and correctly configured.
claude doctor passes, and execution with --dangerously-skip-permissions is approved (you must run it manually once to login and accept terms).opencode run --format json, and explicit provider/model selection follows the oc-<provider/model> wrapper syntax exposed by ai-cli models.There are now two primary ways to use this package:
ai-cli-mcp: MCP server entrypointai-cli: human-facing CLI for background AI runsnpxThe recommended way to use the MCP server is via npx.
If you want to use the production CLI directly from your shell, install the package globally:
This exposes both commands:
ai-cliai-cli-mcpExamples:
npxBecause the published package name is still ai-cli-mcp, the shortest npx form for the CLI is:
Before the MCP server can use Claude, you must first run the Claude CLI manually once with the --dangerously-skip-permissions flag, login and accept the terms.
Follow the prompts to accept. Once this is done, the MCP server will be able to use the flag non-interactively.
For Codex, ensure you're logged in and have accepted any necessary terms:
For Gemini, ensure you're logged in and have configured your credentials:
macOS might ask for folder permissions the first time any of these tools run. If the first run fails, subsequent runs should work.
ai-cli currently supports:
runpsresultpeekwaitkillcleanupdoctormodelsmcpExample flow:
run accepts --cwd as the primary working-directory flag and also accepts the older aliases --workFolder / --work-folder for compatibility.
OpenCode model selection accepts either:
opencode for the CLI's configured default modeloc-<provider/model> for an explicit OpenCode provider/model, for example oc-openai/gpt-5.4ai-cli models exposes OpenCode machine-readably via opencode: ["opencode"] plus dynamicModelBackends.opencode, which points users to opencode models for backend-native discovery.
Codex model selection uses gpt-5.4 as the default advertised model.
doctor checks only binary availability and path resolution. Its JSON output includes a checks block that marks login state and terms acceptance as unchecked.
Background CLI runs are stored under:
Each PID directory contains:
meta.jsonstdout.logstderr.logexit-status.json for detached runsUse ai-cli cleanup to remove completed and failed runs. Running processes are preserved.
Detached ai-cli runs persist natural exit status for all supported backends through exit-status.json. Non-zero exits are surfaced as failed with the recorded exitCode; zero exits are surfaced as completed with exitCode: 0. ai-cli kill records SIGTERM termination as a failed exit, and a tracked process that disappears without exit metadata is treated as failed rather than assumed successful.
After setting up the server, add the configuration to your MCP client's settings file (e.g., mcp.json for Cursor, mcp_config.json for Windsurf).
If the file doesn't exist, create it and add the ai-cli-mcp configuration.
This server exposes the following tools:
runNo reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/ai-cli-mcp)<a href="https://allmcps.com/mcp/ai-cli-mcp"><img src="https://allmcps.com/api/badge/ai-cli-mcp?style=directory" alt="AI Cli MCP on AllMCPs" /></a>