Skip to content

MCP Integration

CodexA implements a Model Context Protocol (MCP) server, enabling direct integration with Claude Desktop, Cursor, and other MCP-compatible AI tools.

Quick Start

bash
codex mcp --path /your/project

This starts a JSON-RPC server over stdio that exposes all 8 CodexA tools.

Claude Desktop Setup

Add to your claude_desktop_config.json:

json
{
  "mcpServers": {
    "codex": {
      "command": "codex",
      "args": ["mcp", "--path", "/your/project"]
    }
  }
}

After restarting Claude Desktop, CodexA tools appear in the tool picker.

Cursor Setup

In Cursor settings, add CodexA as an MCP server:

json
{
  "mcp": {
    "servers": {
      "codex": {
        "command": "codex",
        "args": ["mcp", "--path", "/your/project"]
      }
    }
  }
}

Exposed Tools

ToolArgumentsDescription
semantic_searchquery, top_kNatural language code search
explain_symbolsymbol_name, file_pathStructural symbol explanation
explain_filefile_pathAll symbols in a file
summarize_repo(none)Repository overview
find_referencessymbol_nameCross-reference lookup
get_dependenciesfile_pathFile dependency map
get_call_graphsymbol_nameCall graph traversal
get_contextsymbol_name, file_pathRich AI context window

Protocol Details

The MCP server implements the official MCP SDK protocol:

  • Transport: stdio (stdin/stdout)
  • Format: JSON-RPC 2.0
  • Tool schemas: Auto-generated from CodexA's tool definitions
  • Error handling: Typed errors with machine-readable codes

Requirements

The MCP SDK (mcp) is an optional dependency. If not installed, codex mcp raises a helpful error:

bash
pip install mcp
# or install CodexA with MCP support

TIP

The MCP import is optional — CodexA works fine without it. Only the codex mcp command requires the MCP SDK.

Architecture

Claude/Cursor  ←→  stdio  ←→  MCP Server  ←→  ToolExecutor  ←→  CodexA Core

The MCP server is a thin adapter that:

  1. Receives JSON-RPC tool invocation requests
  2. Routes them to the same ToolExecutor used by CLI and bridge
  3. Returns structured results via JSON-RPC responses

This means all MCP tools behave identically to their CLI and bridge counterparts.

Released under the MIT License.