CodexSAFE
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.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
Codex CLI 的 MCP 协议封装实现
[](https://opensource.org/licenses/MIT) [](https://golang.org/dl/) [](https://modelcontextprotocol.io) [](https://www.npmjs.com/package/@zenfun510/codex-mcp-go)
⭐ 如果觉得好用,请给个 Star 吧!您的支持是我们更新的动力~ ⭐
English | 简体中文
简介
codex-mcp-go 是一个基于 Go 语言实现的 MCP (Model Context Protocol) 服务器。它封装了 OpenAI 的 Codex CLI,使其能够作为 MCP 工具被 KiloCode、Roo Code、Cline 等各种 "Vibe Coding" AI 客户端调用。
这个项目的初衷很简单:让强者更强,让专才专用。
在我自己的工作流中(在 KiloCode 里使用 Gemini 3.0 Pro),我发现像 Gemini 这样的先进模型拥有强大的规划能力和想象力,但在修复自己生成的复杂代码时偶尔会“卡壳”。而 Codex,这位老练的“代码老师傅”,虽然在宏大叙事上稍逊一筹,但在具体的代码实现、Bug 修复和遵循精确指令方面却无人能及。
所以,为什么不让它们合作呢?
受到 codexmcp (Python 实现) 的启发,我决定用我更喜欢的 Go 语言,边学 mcp-go-sdk 边重复造了这个轮子,主要目的是练手并打造一个更适合我自己的工具。
现在,你可以用一句话,在任何支持 MCP 的 Vibe Coding 工具中,让 Gemini 或 Claude 这样的“总指挥”去调用 Codex 这个“特种兵”来完成最棘手的编码任务。
主要特性:
- 会话管理:支持
SESSION_ID维持多轮对话上下文。 - 沙箱控制:提供
read-only、workspace-write等安全策略。 - 并发支持:基于 Go 协程,支持多客户端并发调用。
- 单文件部署:编译为单一二进制文件,无运行时依赖。
快速开始
1. 前置要求
本工具依赖 OpenAI 的 codex CLI。请确保您已安装并配置好它。
安装 Codex CLI:
# 使用 npm 安装 (推荐) npm i -g @openai/codex # 或者参考官方仓库 # https://github.com/openai/codex-cli
2. 安装 MCP Server
方式一:使用 npx (推荐)
无需安装 Go 环境,直接运行:
npx @zenfun510/codex-mcp-go
方式二:手动下载
从 Releases 页面下载对应平台的二进制文件。
方式三:源码构建
需要 Go 1.24+ 环境。
git clone https://github.com/w31r4/codex-mcp-go.git cd codex-mcp-go go build -o codex-mcp-go cmd/server/main.go
3. 配置 MCP 客户端
根据您使用的 AI 客户端,选择对应的配置方式。
方式 A:使用 npx (推荐)
Claude Code
490a69166827OBSERVED · 2026-10-08Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control.
claude mcp add codex-mcp-go -- npx -y @zenfun510/[email protected]
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | PASS |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- none-observed
- Network
- none-observed
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (4)
.goreleaser.yaml
axios, tar, unzipper
- "danger-full-access": Full access permission.
Gates applied: no_behavioural_pass.
490a69166827full audit observations/trust-audit/mcp-server/w31r4__codex-3.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-08 | 490a69166827 | SAFE | B | 89 | first audit |
Questions
What is the Codex MCP server?
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.
Is Codex safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B.
What credentials does Codex need?
No credential environment variables were found in its source, so it appears to need none.
How does Codex run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as @zenfun510/codex-mcp-go at 0.2.1.
How current is this page?
The grade is for one exact copy of the source (490a69166827), read on 2026-10-08. The repository is watched and re-audited when it changes.