Ai MCP Server

MCP server for AI CLI tools (Claude, Codex, and Gemini) with background process management

Local serverstdio

What is the Ai MCP server?

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.

What you get

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:

What the assistant can call

Once Ai is connected, these are the calls the assistant has available:

  • 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
  • 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
  • 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

Setting it up

ai-cli-mcp on npm is all you need. Most clients run it directly, so configuration is a few lines and a restart.

Configuration and credentials

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

Choosing this one

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.

Before you rely on it

  • It runs with your machine's permissions. That is convenient and also the reason to think about what you point it at before you approve a tool call.
  • With 12 tools registered it takes up a noticeable share of the context window; turn it off in projects that never touch Ai.
  • MCP clients confirm each tool call by default. Leave that on until you have watched what the ai mcp server does with a few real requests.

Available tools

ToolWhat it does
ai-cli-mcpMCP server entrypoint
ai-clihuman-facing CLI for background AI runs
runps
resultpeek
waitkill
cleanupdoctor
modelsmcp
peekStarts 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_processesLists all running and completed AI agent processes with their status, PID, and basic info.
doctorChecks 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_resultGets the current output and status of an AI agent process by PID.
kill_processThe kill_process tool exposed by this server.

How to install the Ai MCP 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.

Configuration

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

VariableDescriptionRequired
CLAUDE_CLI_NAMEConfiguration value read at startup.Optional
CODEX_CLI_NAMEConfiguration value read at startup.Optional
OPENCODE_CLI_NAMEConfiguration value read at startup.Optional

Example prompts to try

  • Use Ai to ai-cli-mcp.
  • Use Ai to ai-cli.
  • Use Ai to run.

Frequently asked questions

It connects Ai to MCP-compatible AI assistants such as Claude and Cursor, exposing 12 tools (ai-cli-mcp, ai-cli, run, and more) that the assistant can call on your behalf. Instead of copying data back and forth by hand, the assistant works with Ai directly.