MCP server for AI CLI tools (Claude, Codex, and Gemini) with background process management
Ai MCP server is a locally run integration for AI assistants that speak the Model Context Protocol. MCP server for AI CLI tools (Claude, Codex, and Gemini) with background process management.
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.
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:
Once Ai is connected, these are the calls the assistant has available:
ai-cli-mcp — MCP server entrypointai-cli — human-facing CLI for background AI runsrun — psresult — peekwait — killcleanup — doctormodels — mcppeek — Starts a one-shot short observation window for running child agents and returns structured events observed during that specific call. By default thislist_processes — Lists all running and completed AI agent processes with their status, PID, and basic infodoctor — Checks supported AI CLI binary availability and path resolution from MCP clients. Like ai-cli doctor, it returns a checks block and does not verifyget_result — Gets the current output and status of an AI agent process by PIDkill_process — The kill_process tool exposed by this serverai-cli-mcp on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.
You will need 3 environment variables: CLAUDE_CLI_NAME, CODEX_CLI_NAME, OPENCODE_CLI_NAME. Keep credentials in your client's env block or a secrets manager rather than in a file you might commit.
The only prerequisite is that the AI CLI tools you want to use are locally installed and correctly configured. - Claude Code: claude doctor passes, and execution with --dangerously-skip-permissions is approved (you must run it manually once to login and accept terms). - Codex CLI (Optional): Installed and initial setup (login etc.) completed. - Gemini CLI (Optional): Installed and
Among the developer tooling options, the useful question is rarely "what can it do" but "what does it cost you to run" — permissions, credentials, and how much of your context its toolset consumes. Ai's toolset — ai-cli-mcp, ai-cli, run and 9 more — is a fair guide to whether it matches your workflow. It is maintained by mkXultra; worth a glance at recent repository activity before you build anything load-bearing on it.
SyncDev reviews every entry in this directory against the project's own documentation before publishing, and revisits them as servers change.
| Tool | What it does |
|---|---|
| ai-cli-mcp | MCP server entrypoint |
| ai-cli | human-facing CLI for background AI runs |
| run | ps |
| result | peek |
| wait | kill |
| cleanup | doctor |
| models | mcp |
| peek | Starts a one-shot short observation window for running child agents and returns structured events observed during that specific call. By default this includes only natural-language message events; pass include_tool_calls |
| list_processes | Lists all running and completed AI agent processes with their status, PID, and basic info. |
| doctor | Checks supported AI CLI binary availability and path resolution from MCP clients. Like ai-cli doctor, it returns a checks block and does not verify login state or terms acceptance. |
| get_result | Gets the current output and status of an AI agent process by PID. |
| kill_process | The kill_process tool exposed by this server. |
{
"mcpServers": {
"ai-cli": {
"command": "npx",
"args": ["-y", "ai-cli-mcp"],
"env": {
"CLAUDE_CLI_NAME": "your-value",
"CODEX_CLI_NAME": "your-value",
"OPENCODE_CLI_NAME": "your-value"
}
}
}
}Add to claude_desktop_config.json, then restart Claude Desktop.
The only prerequisite is that the AI CLI tools you want to use are locally installed and correctly configured. - Claude Code: claude doctor passes, and execution with --dangerously-skip-permissions is approved (you must run it manually once to login and accept terms). - Codex CLI (Optional): Installed and initial setup (login etc.) completed. - Gemini CLI (Optional): Installed and
| Variable | Description | Required |
|---|---|---|
| CLAUDE_CLI_NAME | Configuration value read at startup. | Optional |
| CODEX_CLI_NAME | Configuration value read at startup. | Optional |
| OPENCODE_CLI_NAME | Configuration value read at startup. | Optional |
Kill hallucinated APIs — version-accurate, up-to-date library documentation injected straight into context.
Microsoft's official browser automation server — drive a real browser through the accessibility tree, no screenshots needed.
GitHub's official server — repos, issues, pull requests, Actions and code security, straight from your assistant.
Issue tracking at the speed of conversation — Linear's official hosted server with OAuth and zero install.
Local repository surgery — status, diffs, commits, branches and history for any repo on disk.
Timezone sanity for AI — current time anywhere and correct conversions, without the model doing date math.