AI CLI MCP Server
This server lets AI agents delegate autonomous coding tasks and automated code reviews to the OpenAI Codex CLI and Google Antigravity CLI through MCP.
Run autonomous coding tasks non-interactively using Codex (codex_run) or Antigravity (antigravity_run).
Perform automated code reviews on repositories or workspaces with codex_review and antigravity_review.
Check installed CLI health, paths, versions, and platform info via cli_status.
Retrieve a built-in agent skills and orchestration guide via get_agent_skills.
Configure per-task model, timeout, working directory, and YOLO permission-bypass mode.
Serve as a unified gateway for Claude, Gemini, Cursor, Windsurf, and other MCP clients, with process supervision and timeout tree-killing.
Allows delegating autonomous coding tasks and code reviews to Google Antigravity CLI (agy), with support for working directories, models, timeouts, and YOLO mode.
Allows delegating autonomous coding tasks and code reviews to OpenAI Codex CLI, with support for working directories, models, timeouts, and YOLO mode.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@AI CLI MCP Server Use Codex to review the uncommitted git diff and suggest fixes."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
AI CLI MCP Server
A production-ready Model Context Protocol (MCP) server that acts as a secure, unified gateway to both OpenAI Codex CLI and Google Antigravity CLI (agy).
It empowers primary AI orchestrators (such as Claude Desktop, Gemini, Cursor, or Windsurf) to delegate complex coding tasks, file refactorings, and deep automated code reviews to autonomous CLI agents running in YOLO mode with robust process lifecycle supervision.
Architecture
┌───────────────────────────────────┐
│ Any AI Agent │
│ Claude / Gemini / Cursor / etc. │
└─────────────────┬─────────────────┘
│ MCP Protocol
▼
┌────────────────────────────────────┐
│ Python MCP Server │
│ (ai_cli_mcp_server) │
├────────────────────────────────────┤
│ • codex_run • codex_review │
│ • antigravity_run • antigravity_rvw│
│ • cli_status • get_agent_skills │
└──────────────┬──────────────┬──────┘
│ │
┌───────────┘ └───────────┐
▼ ▼
┌───────────────────────────┐ ┌───────────────────────────┐
│ OpenAI Codex CLI │ │ Google Antigravity CLI │
│ (--dangerously-bypass) │ │ (--dangerously-skip) │
└───────────────────────────┘ └───────────────────────────┘Related MCP server: SubagentBridge
Key Features
Unified CLI Gateway: Controls both OpenAI Codex and Google Antigravity agents through clean, standard MCP tools.
True Autonomous YOLO Mode:
Automatically applies
--dangerously-bypass-approvals-and-sandboxfor Codex.Automatically applies
--dangerously-skip-permissionsfor Antigravity (agy).Guarantees non-blocking, headless execution without hanging on confirmation dialogs.
Safer by Design: Does not expose arbitrary shell execution (
cmd.exe/bash). Only structured, sandboxed tasks are dispatched to vetted agent CLIs.Process Supervision & Windows Tree-Killing: When a task times out, child processes (compilers, servers, node) are terminated cleanly via process-tree signals.
Built-in Agent Skills: Exposes an embedded, self-contained skills document via tool (
get_agent_skills) and MCP resource (skills://usage-guide) so calling agents know how to orchestrate multi-agent workflows.Multi-Client Support: Out-of-the-box configuration for Claude Desktop, Cursor, Antigravity, Gemini, and VS Code.
Available MCP Tools
Tool | Parameters | Description |
|
| Runs an autonomous coding task with OpenAI Codex CLI. |
|
| Runs an autonomous coding task with Google Antigravity CLI. |
|
| Runs a non-interactive Git diff code review via Codex. |
|
| Runs an automated codebase critique and review via Antigravity. |
| (none) | Inspects local CLI binary health, versions, paths, and platform info. |
| (none) | Returns the comprehensive orchestration guide for calling agents. |
Quickstart
1. Installation
# Clone the repository
git clone https://github.com/kiranmaya/ai-cli-mcp.git
cd ai-cli-mcp
# Install dependencies or install in editable mode
pip install -e .2. Verify Host Binaries & CLI Status
Run the server status check using the provided runner scripts or directly in Python:
:: Using Batch runner
run_server.bat --status
:: Using PowerShell runner
.\run_server.ps1 -Status
:: Or directly via Python
python -c "import asyncio, server; print(asyncio.run(server.cli_status()))"3. Running the Server
To launch the MCP Server on stdio transport:
Batch:
run_server.batPowerShell:
.\run_server.ps1Direct Python:
python server.py
4. Client Quick Setup
Claude (Claude Desktop & Claude Code CLI)
Claude Desktop: In
%APPDATA%\Claude\claude_desktop_config.json:
{
"mcpServers": {
"ai-cli-gateway": {
"command": "python",
"args": ["c:/Projects2026/AgentsCLI_MCP_Server/ai_cli_mcp_server.py"],
"env": { "CLI_YOLO_MODE": "true", "CLI_DEFAULT_TIMEOUT": "300" }
}
}
}Claude Code CLI: Add
"ai-cli-gateway"to~/.claude.json.
OpenAI Codex CLI
codex mcp add ai-cli-gateway --env CLI_YOLO_MODE=true --env CLI_DEFAULT_TIMEOUT=300 -- python c:/Projects2026/AgentsCLI_MCP_Server/ai_cli_mcp_server.pyGemini CLI & Google Antigravity
Gemini CLI:
gemini mcp add ai-cli-gateway python c:/Projects2026/AgentsCLI_MCP_Server/ai_cli_mcp_server.pyGoogle Antigravity CLI / IDE:
agy mcp add --env CLI_YOLO_MODE=true --env CLI_DEFAULT_TIMEOUT=300 ai-cli-gateway python c:/Projects2026/AgentsCLI_MCP_Server/ai_cli_mcp_server.py(For detailed configurations including Cursor, Windsurf, and VS Code Cline, see INSTALLATION_AND_CLIENTS.md.)
Multi-Agent Workflow Example
A calling agent (e.g. Claude) can execute an end-to-end task and peer review:
# 1. Dispatch feature implementation to Codex
codex_run(
prompt="Implement JWT refresh token rotation with SQLite in src/auth.py",
working_directory="C:/MyProject"
)
# 2. Dispatch cross-verification review to Antigravity
antigravity_review(
working_directory="C:/MyProject",
instructions="Audit security edge cases for token invalidation in src/auth.py"
)Project Structure
ai-cli-mcp/
├── ai_cli_mcp_server.py # Main CLI entrypoint
├── server.py # MCP Server & Tool definitions
├── config.py # Path discovery & sandbox validation
├── process.py # Async process execution & tree killing
├── cli/
│ ├── codex.py # OpenAI Codex CLI adapter
│ └── antigravity.py # Google Antigravity CLI adapter
├── models/
│ └── requests.py # Pydantic schemas & response models
├── skills/
│ └── document.md # In-depth agent usage & skills documentation
├── pyproject.toml # Packaging & build configuration
├── requirements.txt # Core dependencies
├── INSTALLATION_AND_CLIENTS.md # Client configuration reference
└── README.mdEnvironment Configuration
Variable | Default | Purpose |
|
| Runs commands with permission-bypass flags. |
|
| Default timeout in seconds (5 min). |
|
| Maximum timeout ceiling (30 min). |
|
| Sandbox directory whitelist (comma-separated). |
| Auto | Override path to |
| Auto | Override path to |
License
MIT License. See LICENSE for details.
Available Tools
6 toolsantigravity_reviewB
Performs an automated code review on a workspace using Google Antigravity CLI.
Args: working_directory: Root directory of the workspace or repository to review. instructions: Optional custom review criteria, guidelines, or focus areas. model: Optional model override. timeout: Execution timeout in seconds (default: 300).
Returns: JSON string containing review critique, exit code, and execution summary.
Inputs: working_directory (required), model, timeout, instructions. Returns: result
antigravity_runA
Executes a coding prompt non-interactively using Google Antigravity CLI (agy).
Args: prompt: Detailed instruction or task description for the Antigravity agent. working_directory: Target project root directory where the task executes. model: Optional model override (e.g. gemini-2.5-pro, gemini-2.5-flash). timeout: Execution timeout in seconds (default: 300, max: 1800). yolo: When true, runs in YOLO mode (--dangerously-skip-permissions) for automated non-blocking execution.
Returns: JSON string containing success status, exit code, execution time, stdout, and stderr.
Inputs: prompt (required), working_directory (required), yolo, model, +1 more. Returns: result
cli_statusA
Checks the operational status of Codex CLI and Antigravity CLI binaries on the host.
Inputs: no named parameters. Returns: result
codex_reviewA
Performs an automated code review on a git repository using OpenAI Codex CLI.
Args: working_directory: Root directory of the Git repository to review. instructions: Optional review focus areas or guidelines (e.g. security, memory leaks). model: Optional model override. timeout: Execution timeout in seconds (default: 300). uncommitted: When true, reviews uncommitted staged and unstaged changes.
Returns: JSON string containing code review output, exit code, and execution summary.
Inputs: working_directory (required), model, timeout, uncommitted, +1 more. Returns: result
codex_runA
Executes a coding prompt non-interactively using the OpenAI Codex CLI.
Args: prompt: Detailed instruction or task description for the Codex agent. working_directory: Target project root directory where the task executes. model: Optional model override (e.g. o3-mini, o1, gpt-4o). timeout: Execution timeout in seconds (default: 300, max: 1800). yolo: When true, runs in YOLO mode (--dangerously-bypass-approvals-and-sandbox) for automated non-blocking execution.
Returns: JSON string containing success status, exit code, execution time, stdout, and stderr.
Inputs: prompt (required), working_directory (required), yolo, model, +1 more. Returns: result
get_agent_skillsA
Returns the comprehensive AI Agent Skills & Usage Guide for delegating tasks to Codex and Antigravity.
Calling agents should read this guide to understand:
Tool invocation parameters and return formats
YOLO autonomous mode execution mechanics
Decision matrix for choosing Codex vs. Antigravity
Multi-agent collaboration pipelines and prompt patterns
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
The two run tools and two review tools are intentionally parallel but clearly distinguished by vendor (Codex vs. Antigravity), and cli_status/get_agent_skills are wholly distinct. The main confusion risk is between codex_run and antigravity_run, but descriptions make the target CLI explicit.
The core tools follow a consistent vendor_action pattern (codex_run, antigravity_run, codex_review, antigravity_review). cli_status and get_agent_skills break the pattern slightly, but they are also different kinds of operations and the names remain readable and predictable.
Six tools is a well-scoped set for a server that wraps two external CLI agents. Each tool covers a distinct operational need: execute, review, status check, and usage guidance.
The server covers the primary workflows one would expect: running and reviewing with both Codex and Antigravity, plus environment status and skill guidance. Minor gaps like model listing or installation tooling exist, but agents can work around them.
Maintenance
Related MCP Connectors
Autonomous AI developers on your own infrastructure: assign a task, get a pull request.
Multiplayer for the coding agents your team already uses: shared tasks, decisions, skills and tools.
Coordination hub for AI coding agents: message teammates, ask humans, audit every event.
Shared control plane for AI coding agents — tasks, memory, decisions, file locks. 12 tools.
Related MCP Servers
- AlicenseNot gradedqualityBmaintenanceEnables Claude Code to delegate implementation tasks to Antigravity CLI and OpenCode, run them fully autonomously, and then review and gate the results.1MIT
- AlicenseCqualityBmaintenanceEnables a primary agent in Antigravity IDE to delegate coding tasks to background subagents across multiple model backends, with crash recovery, process cleanup, and human-in-the-loop approval for destructive actions.20MIT
- AlicenseAqualityAmaintenanceEnables orchestrating external AI-agent CLIs like Codex to execute project development tasks through an async task system with objective verification and automated failure rework loops.8428 npm12Apache 2.0
- AlicenseAqualityCmaintenanceEnables Codex to delegate bounded code analysis, review, isolated edits, multimodal research, and native image generation to supervised Antigravity workers, with queued execution, retries, and inspectable patches.232MIT