Enables AI coding assistants to interact with OpenAI's Codex AI through the official CLI, providing tools for code analysis, file review, and general coding queries without direct API costs
Click on "Install 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., "@Codex Bridgereview this Python function for potential bugs"
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.
Codex Bridge
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.0and Codex CLIEasy Deployment: Support for both uvx and traditional pip installation
Universal MCP Compatibility: Works with any MCP-compatible AI coding assistant
Related MCP server: Sourcegraph MCP Server
π Quick Start
Prerequisites
Install Codex CLI:
npm install -g @openai/codex-cliAuthenticate with Codex:
codexVerify 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-bridgeAlternative: 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-bridgeDevelopment 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
# Recommended installation
claude mcp add codex-bridge -s user -- uvx codex-bridge
# Development installation
claude mcp add codex-bridge-dev -s user -- python -m srcGlobal 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: Settings β Cursor Settings β MCP β Add new global MCP server
Configuration (.vscode/mcp.json in your workspace):
{
"servers": {
"codex-bridge": {
"type": "stdio",
"command": "uvx",
"args": ["codex-bridge"]
}
}
}Alternative: Through Extensions
Open Extensions view (Ctrl+Shift+X)
Search for MCP extensions
Add custom server with command:
uvx codex-bridge
Add to your Windsurf MCP configuration:
{
"mcpServers": {
"codex-bridge": {
"command": "uvx",
"args": ["codex-bridge"],
"env": {}
}
}
}Open Cline and click MCP Servers in the top navigation
Select Installed tab β Advanced MCP Settings
Add to
cline_mcp_settings.json:
{
"mcpServers": {
"codex-bridge": {
"command": "uvx",
"args": ["codex-bridge"],
"env": {}
}
}
}Go to: Settings β MCP β Add MCP Server
{
"mcpServers": {
"codex-bridge": {
"command": "uvx",
"args": ["codex-bridge"],
"env": {}
}
}
}Navigate to Settings β MCP Servers β Add Server
Fill in the server details:
Name:
codex-bridgeType:
STDIOCommand:
uvxArguments:
["codex-bridge"]
Save the configuration
Using the UI:
Click hamburger menu β Settings β Tools
Click + Add MCP button
Enter command:
uvx codex-bridgeName: Codex Bridge
Manual Configuration:
"augment.advanced": {
"mcpServers": [
{
"name": "codex-bridge",
"command": "uvx",
"args": ["codex-bridge"],
"env": {}
}
]
}Go to Settings β MCP Servers β Edit Global Config
Add to
mcp_settings.json:
{
"mcpServers": {
"codex-bridge": {
"command": "uvx",
"args": ["codex-bridge"],
"env": {}
}
}
}Go to Zencoder menu (...) β Tools β Add Custom MCP
Add configuration:
{
"command": "uvx",
"args": ["codex-bridge"],
"env": {}
}Hit the Install button
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:
Ask general questions: "What authentication patterns are used in this codebase?"
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:
# 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{
"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 Codexdirectory(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 contentdirectory(string): Working directory for the queryformat(string): Output format - "text", "json", or "code" (default: "json")timeout(int, optional): Timeout in seconds (recommended: 60-120, default: 90)
consult_codex_batch
Batch processing for multiple queries - perfect for CI/CD automation.
Parameters:
queries(list): List of query dictionaries with 'query' and optional 'timeout'directory(string): Working directory for all queriesformat(string): Output format - currently only "json" supported for batch
Example:
consult_codex_with_stdin(
stdin_content=open("src/auth.py").read(),
prompt="Analyze this auth file and suggest improvements",
directory="/path/to/project",
format="json", # Default format
timeout=120 # Custom timeout for complex analysis
)π Usage Examples
Basic Code Analysis
# Simple research query
consult_codex(
query="What authentication patterns are used in this project?",
directory="/Users/dev/my-project"
)Detailed File Review
# Analyze specific files
with open("/Users/dev/my-project/src/auth.py") as f:
auth_content = f.read()
consult_codex_with_stdin(
stdin_content=auth_content,
prompt="Review this file and suggest security improvements",
directory="/Users/dev/my-project",
format="json", # Structured output
timeout=120 # Allow more time for detailed analysis
)Batch Processing
# Process multiple queries at once
consult_codex_batch(
queries=[
{"query": "Analyze authentication patterns", "timeout": 60},
{"query": "Review database implementations", "timeout": 90},
{"query": "Check security vulnerabilities", "timeout": 120}
],
directory="/Users/dev/my-project",
format="json" # Always JSON for batch processing
)ποΈ Architecture
Core Design
CLI-First: Direct subprocess calls to
codexcommandStateless: Each tool call is independent with no session state
Configurable Timeout: 90-second default execution time (configurable)
Structured Output: JSON format by default for better integration
Simple Error Handling: Clear error messages with fail-fast approach
Project Structure
codex-bridge/
βββ src/
β βββ __init__.py # Entry point
β βββ __main__.py # Module execution entry point
β βββ mcp_server.py # Main MCP server implementation
βββ .github/ # GitHub templates and workflows
βββ pyproject.toml # Python package configuration
βββ README.md # This file
βββ CONTRIBUTING.md # Contribution guidelines
βββ CODE_OF_CONDUCT.md # Community standards
βββ SECURITY.md # Security policies
βββ CHANGELOG.md # Version history
βββ LICENSE # MIT licenseπ§ Development
Local Testing
# Install in development mode
pip install -e .
# Run directly
python -m src
# Test CLI availability
codex --versionIntegration with Claude Code
The server automatically integrates with Claude Code when properly configured through the MCP protocol.
π Troubleshooting
CLI Not Available
# Install Codex CLI
npm install -g @openai/codex-cli
# Authenticate
codex auth login
# Test
codex --versionConnection Issues
Verify Codex CLI is properly authenticated
Check network connectivity
Ensure Claude Code MCP configuration is correct
Check that the
codexcommand is in your PATH
Common Error Messages
"CLI not available": Codex CLI is not installed or not in PATH
"Authentication required": Run
codex auth login"Timeout after X seconds": Query took too long, try increasing timeout or breaking into smaller parts
π€ Contributing
We welcome contributions from the community! Please read our Contributing Guidelines for details on how to get started.
Quick Contributing Guide
Fork the repository
Create a feature branch
Make your changes
Add tests if applicable
Submit a pull request
π License
This project is licensed under the MIT License - see the LICENSE file for details.
π Version History
See CHANGELOG.md for detailed version history.
π Support
Issues: Report bugs or request features via GitHub Issues
Discussions: Join the community discussion
Documentation: Additional docs can be created in the
docs/directory
Focus: A simple, reliable bridge between Claude Code and Codex AI through the official CLI.
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.