Codex MCP Go

v0.2.1Developer Toolsstable

codex-mcp-go is a Go-based MCP (Model Context Protocol) server that serves as a bridge for Codex CLI, enabling various AI coding assistants (such as Claude Code, Roo Code, KiloCode, etc.) to seamlessly collaborate with Codex.

codex-mcp-gomcpai-integration
Share:
52
Stars
0
Downloads
0
Weekly
0/5

What is Codex MCP Go?

Codex MCP Go is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to codex-mcp-go is a go-based mcp (model context protocol) server that serves as a bridge for codex cli, enabling various ai coding assistants (such as claude code, roo code, kilocode, etc.) to seamlessl...

codex-mcp-go is a Go-based MCP (Model Context Protocol) server that serves as a bridge for Codex CLI, enabling various AI coding assistants (such as Claude Code, Roo Code, KiloCode, etc.) to seamlessly collaborate with Codex.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • codex-mcp-go is a Go-based MCP (Model Context Protocol) serv

Use Cases

Bridge Codex CLI with AI coding assistants like Claude Code and Roo Code for seamless collaboration.
w31r4

Maintainer

LicenseMIT
Languagego
Versionv0.2.1
UpdatedMay 18, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y @zenfun510/codex-mcp-go

Manual Installation

npx -y @zenfun510/codex-mcp-go

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use Codex MCP Go

codex-mcp-go is a Go-based MCP server that acts as a bridge between AI coding assistants (Claude Code, Roo Code, KiloCode, and others) and OpenAI's Codex CLI, exposing a single `codex` tool that lets assistants delegate code-generation tasks to Codex with configurable sandbox policies, session management for multi-turn conversations, and fine-grained timeout controls. It ships as a single self-contained binary with zero runtime dependencies, making it easy to drop into any development environment.

Prerequisites

  • Node.js and npm installed (for the recommended npx installation method)
  • OpenAI's Codex CLI installed globally: npm i -g @openai/codex
  • An OpenAI API key configured for the Codex CLI
  • An MCP-compatible client such as Claude Code, Roo Code, or KiloCode
  • Go 1.24+ only if building from source
1

Install the Codex CLI

codex-mcp-go wraps the Codex CLI, so that must be installed first and configured with your OpenAI credentials.

npm i -g @openai/codex
# Verify installation
codex --version
2

Install codex-mcp-go via npx

The recommended installation uses npx to download and run the server without a permanent install. Alternatively, download a pre-compiled binary from the GitHub releases page.

# Run directly with npx (downloads on first use)
npx @zenfun510/codex-mcp-go

# Or download binary from:
# https://github.com/w31r4/codex-mcp-go/releases
3

Configure environment variables (optional)

Control timeouts, sandbox modes, allowed models, and working directories via environment variables. These override the default TOML config.

export CODEX_DEFAULT_TIMEOUT=120
export CODEX_MAX_TIMEOUT=1800
export CODEX_DEFAULT_SANDBOX=read-only
export CODEX_ALLOWED_WORK_DIRS=/home/user/projects
export CODEX_LOG_LEVEL=info
4

Add to your MCP client configuration

Register codex-mcp-go as an MCP server in Claude Desktop, Claude Code, or another client. The server exposes a single 'codex' tool.

{
  "mcpServers": {
    "codex-mcp-go": {
      "command": "npx",
      "args": ["-y", "@zenfun510/codex-mcp-go"],
      "env": {
        "CODEX_DEFAULT_SANDBOX": "read-only",
        "CODEX_DEFAULT_TIMEOUT": "120"
      }
    }
  }
}
5

Invoke the codex tool

Once connected, AI assistants can call the codex tool with a PROMPT and working directory (cd). Optional parameters control sandbox mode, model, session ID for multi-turn dialogs, and timeout.

Codex MCP Go Examples

Client configuration

Claude Desktop or Claude Code configuration for codex-mcp-go using npx with read-only sandbox by default.

{
  "mcpServers": {
    "codex-mcp-go": {
      "command": "npx",
      "args": ["-y", "@zenfun510/codex-mcp-go"],
      "env": {
        "CODEX_DEFAULT_SANDBOX": "read-only",
        "CODEX_DEFAULT_TIMEOUT": "120",
        "CODEX_ALLOWED_WORK_DIRS": "/home/user/projects"
      }
    }
  }
}

Prompts to try

Example prompts for AI coding assistants using the codex tool exposed by this server.

- "Use Codex to refactor the authentication module in /projects/myapp to use async/await"
- "Ask Codex to write unit tests for the UserService class in /projects/myapp/src"
- "Use Codex with workspace-write sandbox to generate a REST API skeleton in /projects/newapi"
- "Continue our Codex session and add error handling to the code it generated"

Troubleshooting Codex MCP Go

codex command not found when codex-mcp-go starts

Install the Codex CLI with 'npm i -g @openai/codex' and verify it is on your PATH by running 'which codex'. If using a custom path, set the CODEX_EXECUTABLE_PATH environment variable.

Sandbox policy violations — operations denied

The default sandbox is read-only. To allow file writes set CODEX_DEFAULT_SANDBOX=workspace-write. For full access (use with caution) set it to danger-full-access. Review CODEX_ALLOWED_WORK_DIRS to ensure the target directory is permitted.

Timeout errors on long-running code generation tasks

Increase CODEX_MAX_TIMEOUT (max 1800 seconds / 30 minutes) and pass a per-call timeout_seconds parameter when invoking the codex tool. Set CODEX_NO_OUTPUT_TIMEOUT to handle cases where Codex produces no output for a while.

Frequently Asked Questions about Codex MCP Go

What is Codex MCP Go?

Codex MCP Go is a Model Context Protocol (MCP) server that codex-mcp-go is a go-based mcp (model context protocol) server that serves as a bridge for codex cli, enabling various ai coding assistants (such as claude code, roo code, kilocode, etc.) to seamlessly collaborate with codex. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install Codex MCP Go?

Install via npm with the command: npx -y @zenfun510/codex-mcp-go. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with Codex MCP Go?

Codex MCP Go works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is Codex MCP Go free to use?

Yes, Codex MCP Go is open source and available under the MIT license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "codex-mcp-go": { "command": "npx", "args": ["-y", "@zenfun510/codex-mcp-go"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide →

Ready to use Codex MCP Go?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides