codex-mcp
MCP server wrapping the Codex CLI for code reviews and queries.
Prerequisites
Install the Codex CLI:
npm install -g @openai/codexInstallation
Option 1: Clone and build
git clone git@github.com:jnew00/my-codex-mcp.git
cd my-codex-mcp
npm install
npm run buildThen add to your Claude Code config (~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"codex": {
"command": "node",
"args": ["/path/to/my-codex-mcp/dist/index.js"]
}
}
}Option 2: npx (after publishing to npm)
{
"mcpServers": {
"codex": {
"command": "npx",
"args": ["codex-mcp"]
}
}
}Tool
codex
Send a prompt to Codex CLI.
Parameters:
| Name | Type | Required | Description |
|---|---|---|---|
prompt | string | Yes | Instructions for Codex |
code | string | No | Code to analyze |
model | string | No | Model to use |
context | string | No | Additional context |
Example:
{
"prompt": "Review this code for security issues",
"code": "function login(user) { db.query(`SELECT * FROM users WHERE name='${user}'`); }",
"context": "Node.js backend, security-critical"
}Development
npm test # Unit tests
npm run test:integration # Integration tests (calls Codex CLI)
npm run build # Build TypeScript