# Codex MCP Go

A Go MCP server that wraps Codex CLI. Lets your agent hand coding tasks to Codex as a tool call.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 51
- Author: w31r4
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/w31r4/codex-mcp-go
- Updated: 2026-02-03
- HTML: https://affpapa.org/en/nevibecode/mcp/codex-mcp-go

## What it does

Codex MCP Go runs a stdio server exposing a single `codex` tool. Clients like Claude, Cursor or Cline send a task through it, and Codex CLI does the work. The implementation is Go, ships as one binary, and handles concurrent clients with goroutines.

Sessions are supported: keep the returned `SESSION_ID` and pass it back to continue a multi-turn exchange. The `sandbox` parameter ranges from `read-only` to `danger-full-access`. Limits on models, profiles and working directories come from a TOML config or environment variables, and the variables win over the file.

The `codex` CLI has to be installed and configured first — nothing runs without it. Using `npx` avoids a Go toolchain; building from source needs Go 1.24+. Put `OPENAI_API_KEY` in the client config.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add codex-mcp-go -- npx -y @zenfun510/codex-mcp-go
```

### Codex

**Platform CLI**
```bash
codex mcp add codex-mcp-go -- npx -y @zenfun510/codex-mcp-go
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "codex-mcp-go": {
            "command": "npx",
            "args": [
                "-y",
                "@zenfun510/codex-mcp-go"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "codex-mcp-go": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@zenfun510/codex-mcp-go"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add codex-mcp-go npx -y @zenfun510/codex-mcp-go
```

## When to use it
- wire Codex CLI into Claude or Cursor as a tool
- send a tricky patch to a second agent for review
- keep a multi-turn Codex conversation alive with `SESSION_ID`
- confine Codex to `read-only` while it inspects a repo
- run the MCP server without installing Go

## Example prompts
- Ask Codex over MCP to look at this module and draft a patch
- Call the `codex` tool with `sandbox` set to `read-only` and check my implementation
- Resume the Codex session with `SESSION_ID` and refine the refactor plan

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
