Codex Bridge

Codex Bridge

elyin

Connects Claude with OpenAI's Codex through the official CLI, enabling direct code consultation and batch processing without API costs.

Bridges Claude with OpenAI's Codex through the official CLI, enabling direct consultation, stdin-piped execution for CI/CD workflows, and batch processing for automated code analysis and reviews.

81687 views6Local (stdio)

What it does

  • Query Codex with structured output formats
  • Pipe content through stdin for CI/CD workflows
  • Process multiple Codex queries in batch mode
  • Execute automated code analysis and reviews

Best for

Developers wanting free Codex access through CLICI/CD pipelines requiring automated code reviewBatch code analysis workflows
Zero API costs using official CLIBuilt for CI/CD automation90-second configurable timeouts

About Codex Bridge

Codex Bridge is a community-built MCP server published by elyin that provides AI assistants with tools and capabilities via the Model Context Protocol. Codex Bridge connects Claude with OpenAI Codex via CLI for automated code analysis, reviews, and CI/CD integrations. It is categorized under ai ml, developer tools. This server exposes 3 tools that AI clients can invoke during conversations and coding sessions.

How to install

You can install Codex Bridge in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.

License

Codex Bridge is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.

Tools (3)

consult_codex

Consult Codex in non-interactive mode with structured output. Processes prompt and returns formatted response. Supports text, JSON, and code extraction formats. Args: query: The prompt to send to Codex directory: Working directory (required) format: Output format - "text", "json", or "code" (default: "json") timeout: Optional timeout in seconds (overrides env var, recommended: 60-120) Returns: Formatted response based on format parameter

consult_codex_with_stdin

Consult Codex with stdin content piped to prompt - pipeline-friendly execution. Similar to 'echo "content" | codex exec "prompt"' - combines stdin with prompt. Perfect for CI/CD workflows where you pipe file contents to the AI. Args: stdin_content: Content to pipe as stdin (e.g., file contents, diff, logs) prompt: The prompt to process the stdin content directory: Working directory (required) format: Output format - "text", "json", or "code" (default: "json") timeout: Optional timeout in seconds (overrides env var, recommended: 60-120) Returns: Formatted response based on format parameter

consult_codex_batch

Consult multiple Codex queries in batch - perfect for CI/CD automation. Processes multiple prompts and returns consolidated JSON output. Each query can have individual timeout and format preferences. Args: queries: List of query dictionaries with keys: 'query' (required), 'timeout' (optional) directory: Working directory (required) format: Output format - currently only "json" supported for batch Returns: JSON array with all results

Codex Bridge

CI Status PyPI Version MIT License Python 3.10+ MCP Compatible Codex CLI

A lightweight MCP (Model Context Protocol) server that enables AI coding assistants to interact with OpenAI's Codex AI through the official CLI. Works with Claude Code, Cursor, VS Code, and other MCP-compatible clients. Designed for simplicity, reliability, and seamless integration.

✨ Features

  • Direct Codex CLI Integration: Zero API costs using official Codex CLI
  • Simple MCP Tools: Two core functions for basic queries and file analysis
  • Stateless Operation: No sessions, caching, or complex state management
  • Production Ready: Robust error handling with configurable timeouts (default: 90 seconds)
  • Minimal Dependencies: Only requires mcp>=1.0.0 and Codex CLI
  • Easy Deployment: Support for both uvx and traditional pip installation
  • Universal MCP Compatibility: Works with any MCP-compatible AI coding assistant

🚀 Quick Start

Prerequisites

  1. Install Codex CLI:

    npm install -g @openai/codex-cli
    
  2. Authenticate with Codex:

    codex
    
  3. Verify installation:

    codex --version
    

Installation

🎯 Recommended: PyPI Installation

# Install from PyPI
pip install codex-bridge

# Add to Claude Code with uvx (recommended)
claude mcp add codex-bridge -s user -- uvx codex-bridge

Alternative: From Source

# Clone the repository
git clone https://github.com/shelakh/codex-bridge.git
cd codex-bridge

# Build and install locally
uvx --from build pyproject-build
pip install dist/*.whl

# Add to Claude Code
claude mcp add codex-bridge -s user -- uvx codex-bridge

Development Installation

# Clone and install in development mode
git clone https://github.com/shelakh/codex-bridge.git
cd codex-bridge
pip install -e .

# Add to Claude Code (development)
claude mcp add codex-bridge-dev -s user -- python -m src

🌐 Multi-Client Support

Codex Bridge works with any MCP-compatible AI coding assistant - the same server supports multiple clients through different configuration methods.

Supported MCP Clients

  • Claude Code ✅ (Default)
  • Cursor
  • VS Code
  • Windsurf
  • Cline
  • Void
  • Cherry Studio
  • Augment
  • Roo Code
  • Zencoder
  • Any MCP-compatible client

Configuration Examples

Claude Code (Default)
# Recommended installation
claude mcp add codex-bridge -s user -- uvx codex-bridge

# Development installation
claude mcp add codex-bridge-dev -s user -- python -m src
Cursor

Global Configuration (~/.cursor/mcp.json):

{
  "mcpServers": {
    "codex-bridge": {
      "command": "uvx",
      "args": ["codex-bridge"],
      "env": {}
    }
  }
}

Project-Specific (.cursor/mcp.json in your project):

{
  "mcpServers": {
    "codex-bridge": {
      "command": "uvx",
      "args": ["codex-bridge"],
      "env": {}
    }
  }
}

Go to: SettingsCursor SettingsMCPAdd new global MCP server

VS Code

Configuration (.vscode/mcp.json in your workspace):

{
  "servers": {
    "codex-bridge": {
      "type": "stdio",
      "command": "uvx",
      "args": ["codex-bridge"]
    }
  }
}

Alternative: Through Extensions

  1. Open Extensions view (Ctrl+Shift+X)
  2. Search for MCP extensions
  3. Add custom server with command: uvx codex-bridge
Windsurf

Add to your Windsurf MCP configuration:

{
  "mcpServers": {
    "codex-bridge": {
      "command": "uvx",
      "args": ["codex-bridge"],
      "env": {}
    }
  }
}
Cline (VS Code Extension)
  1. Open Cline and click MCP Servers in the top navigation
  2. Select Installed tab → Advanced MCP Settings
  3. Add to cline_mcp_settings.json:
{
  "mcpServers": {
    "codex-bridge": {
      "command": "uvx",
      "args": ["codex-bridge"],
      "env": {}
    }
  }
}
Void

Go to: SettingsMCPAdd MCP Server

{
  "mcpServers": {
    "codex-bridge": {
      "command": "uvx",
      "args": ["codex-bridge"],
      "env": {}
    }
  }
}
Cherry Studio
  1. Navigate to Settings → MCP Servers → Add Server
  2. Fill in the server details:
    • Name: codex-bridge
    • Type: STDIO
    • Command: uvx
    • Arguments: ["codex-bridge"]
  3. Save the configuration
Augment

Using the UI:

  1. Click hamburger menu → SettingsTools
  2. Click + Add MCP button
  3. Enter command: uvx codex-bridge
  4. Name: Codex Bridge

Manual Configuration:

"augment.advanced": { 
  "mcpServers": [ 
    { 
      "name": "codex-bridge", 
      "command": "uvx", 
      "args": ["codex-bridge"],
      "env": {}
    }
  ]
}
Roo Code
  1. Go to Settings → MCP Servers → Edit Global Config
  2. Add to mcp_settings.json:
{
  "mcpServers": {
    "codex-bridge": {
      "command": "uvx",
      "args": ["codex-bridge"],
      "env": {}
    }
  }
}
Zencoder
  1. Go to Zencoder menu (...) → ToolsAdd Custom MCP
  2. Add configuration:
{
  "command": "uvx",
  "args": ["codex-bridge"],
  "env": {}
}
  1. Hit the Install button
Alternative Installation Methods

For pip-based installations:

{
  "command": "codex-bridge",
  "args": [],
  "env": {}
}

For development/local testing:

{
  "command": "python",
  "args": ["-m", "src"],
  "env": {},
  "cwd": "/path/to/codex-bridge"
}

For npm-style installation (if needed):

{
  "command": "npx",
  "args": ["codex-bridge"],
  "env": {}
}

Universal Usage

Once configured with any client, use the same two tools:

  1. Ask general questions: "What authentication patterns are used in this codebase?"
  2. Analyze specific files: "Review these auth files for security issues"

The server implementation is identical - only the client configuration differs!

⚙️ Configuration

Timeout Configuration

By default, Codex Bridge uses a 90-second timeout for all CLI operations. For longer queries (large files, complex analysis), you can configure a custom timeout using the CODEX_TIMEOUT environment variable.

Git Repository Check

By default, Codex CLI requires being inside a Git repository or trusted directory. If you need to use Codex Bridge in directories that aren't Git repositories, you can set the CODEX_SKIP_GIT_CHECK environment variable.

⚠️ Security Warning: Only enable this flag in trusted environments where you control the directory structure.

Example configurations:

Claude Code
# Add with custom timeout (120 seconds)
claude mcp add codex-bridge -s user --env CODEX_TIMEOUT=120 -- uvx codex-bridge

# Add with git repository check disabled (for non-git directories)
claude mcp add codex-bridge -s user --env CODEX_SKIP_GIT_CHECK=true -- uvx codex-bridge

# Add with both configurations
claude mcp add codex-bridge -s user --env CODEX_TIMEOUT=120 --env CODEX_SKIP_GIT_CHECK=true -- uvx codex-bridge
Manual Configuration (mcp_settings.json)
{
  "mcpServers": {
    "codex-bridge": {
      "command": "uvx",
      "args": ["codex-bridge"],
      "env": {
        "CODEX_TIMEOUT": "120",
        "CODEX_SKIP_GIT_CHECK": "true"
      }
    }
  }
}

Configuration Options:

CODEX_TIMEOUT:

  • Default: 90 seconds (if not configured)
  • Range: Any positive integer (seconds)
  • Recommended: 60-120 seconds for most queries, 120-300 for large file analysis
  • Invalid values: Fall back to 90 seconds with warning

CODEX_SKIP_GIT_CHECK:

  • Default: false (Git repository check enabled)
  • Valid values: "true", "1", "yes" (case-insensitive) to disable the check
  • Use case: Working in directories that are not Git repositories
  • Security: Only use in trusted directories you control

🛠️ Available Tools

consult_codex

Direct CLI bridge for simple queries with structured JSON output by default.

Parameters:

  • query (string): The question or prompt to send to Codex
  • directory (string): Working directory for the query (default: current directory)
  • format (string): Output format - "text", "json", or "code" (default: "json")
  • timeout (int, optional): Timeout in seconds (recommended: 60-120, default: 90)

Example:

consult_codex(
    query="Find authentication patterns in this codebase",
    directory="/path/to/project",
    format="json",  # Default format
    timeout=90      # Default timeout
)

consult_codex_with_stdin

CLI bridge with stdin content for pipeline-friendly execution.

Parameters:

  • stdin_content (string): Content to pipe as stdin (file contents, diffs, logs)
  • prompt (string): The prompt to process the stdin content
  • directory (string): Working directory for the query
  • format (string): Output format - "text", "json"

README truncated. View full README on GitHub.

Alternatives

Related Skills

Browse all skills
codex-cli-bridge

Bridge between Claude Code and OpenAI Codex CLI - generates AGENTS.md from CLAUDE.md, provides Codex CLI execution helpers, and enables seamless interoperability between both tools

7
finance-skills

Production-ready financial analyst skill with ratio analysis, DCF valuation, budget variance analysis, and rolling forecast construction. 4 Python tools (all stdlib-only). Works with Claude Code, Codex CLI, and OpenClaw.

55
ui-design-system

UI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.

18
ai-sdk

Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".

6
api-documenter

Master API documentation with OpenAPI 3.1, AI-powered tools, and modern developer experience practices. Create interactive docs, generate SDKs, and build comprehensive developer portals. Use PROACTIVELY for API documentation or developer portal creation.

4
engineering-skills

23 production-ready engineering skills covering architecture, frontend, backend, fullstack, QA, DevOps, security, AI/ML, data engineering, computer vision, and specialized tools like Playwright Pro, Stripe integration, AWS, and MS365. 30+ Python automation tools (all stdlib-only). Works with Claude Code, Codex CLI, and OpenClaw.

4