Codex MCP Go
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.
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
Maintainer
Works with
Installation
NPM
npx -y @zenfun510/codex-mcp-goManual Installation
npx -y @zenfun510/codex-mcp-goConfiguration
Configuration Details
claude_desktop_config.json
Performance
Response Metrics
Resource Usage
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
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 --versionInstall 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/releasesConfigure 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=infoAdd 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"
}
}
}
}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.
Codex MCP Go Alternatives — Similar Developer Tools Servers
Looking for alternatives to Codex MCP Go? Here are other popular developer tools servers you can use with Claude, Cursor, and VS Code.
Ecc
★ 188.2kThe agent harness performance optimization system. Skills, instincts, memory, security, and research-first development for Claude Code, Codex, Opencode, Cursor and beyond.
Javaguide
★ 155.8kJava 面试 & 后端通用面试指南,覆盖计算机基础、数据库、分布式、高并发、系统设计与 AI 应用开发
Gemini CLI
★ 104.5kA secure MCP server that wraps the Google Gemini CLI, allowing clients to query Gemini models using local OAuth sessions without requiring an API key. It provides tools for model interaction and diagnostics with built-in protection against command in
Awesome MCP Servers
★ 87.3k⭐ Curated list of Model Context Protocol (MCP) servers - tools that extend Claude Desktop, Cursor, Windsurf, and other MCP clients with custom capabilities.
MCP Servers
★ 86.0kModel Context Protocol Servers
CC Switch
★ 77.5kA cross-platform desktop All-in-One assistant for Claude Code, Codex, OpenCode, OpenClaw, Gemini CLI & Hermes Agent. Only official website: ccswitch.io
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.
Set Up Codex MCP Go in Your Editor
Choose your AI client for step-by-step setup instructions.
Quick Config Preview
Add this to your claude_desktop_config.json or .cursor/mcp.json
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.