Codex Gemini MCP Server

1

Add it to Claude Code

Run this in a terminal.

Run in terminal
claude mcp add codex-gemini-mcp -- npx -y -p @donghae0414/codex-gemini-mcp codex-mcp
README.md

Proxy server for OpenAI Codex and Google Gemini CLI tools via MCP

๐ŸŒ Language: ํ•œ๊ตญ์–ด | English

codex-gemini-mcp

AI ์—์ด์ „ํŠธ(Claude, Cursor ๋“ฑ)๊ฐ€ OpenAI Codex CLI์™€ Google Gemini CLI๋ฅผ MCP ๋„๊ตฌ๋กœ ์ง์ ‘ ํ˜ธ์ถœํ•  ์ˆ˜ ์žˆ๊ฒŒ ํ•ด์ฃผ๋Š” ํ”„๋ก์‹œ ์„œ๋ฒ„์ž…๋‹ˆ๋‹ค.

์ฃผ์š” ๊ธฐ๋Šฅ

  • ask_codex โ€” ์—์ด์ „ํŠธ๊ฐ€ Codex์—๊ฒŒ ์ฝ”๋“œ ์ƒ์„ฑยท๋ฆฌํŒฉํ„ฐ๋งยท๋””๋ฒ„๊น…์„ ์š”์ฒญ
  • ask_gemini โ€” ์—์ด์ „ํŠธ๊ฐ€ Gemini์—๊ฒŒ ๋ถ„์„ยท์š”์•ฝยท์ฝ”๋“œ ๋ฆฌ๋ทฐ๋ฅผ ์š”์ฒญ
  • ๋ฐฑ๊ทธ๋ผ์šด๋“œ ์‹คํ–‰ โ€” ์˜ค๋ž˜ ๊ฑธ๋ฆฌ๋Š” ์ž‘์—…์„ ๋ฐฑ๊ทธ๋ผ์šด๋“œ๋กœ ๋Œ๋ฆฌ๊ณ , ์ƒํƒœ ํ™•์ธ(check_job_status)ยท๋Œ€๊ธฐ(wait_for_job)ยท์ค‘๋‹จ(kill_job)ยท๋ชฉ๋ก ์กฐํšŒ(list_jobs)๋กœ ๊ด€๋ฆฌ
  • ๋ฉ€ํ‹ฐ๋ชจ๋ธ ์˜ค์ผ€์ŠคํŠธ๋ ˆ์ด์…˜ โ€” ํ•˜๋‚˜์˜ ์—์ด์ „ํŠธ๊ฐ€ Codex์™€ Gemini๋ฅผ ๋™์‹œ์— ํ™œ์šฉํ•˜์—ฌ ์ž‘์—… ๋ถ„๋‹ด ๊ฐ€๋Šฅ

ํ•˜๋‚˜์˜ ํŒจํ‚ค์ง€์—์„œ codex-mcp์™€ gemini-mcp ๋‘ ๊ฐœ์˜ MCP ์„œ๋ฒ„ ๋ฐ”์ด๋„ˆ๋ฆฌ๋ฅผ ์ œ๊ณตํ•˜๋ฉฐ, stdio transport ๊ธฐ๋ฐ˜์œผ๋กœ ๋™์ž‘ํ•ฉ๋‹ˆ๋‹ค.

Requirements

  • Node.js 20+
  • codex CLI ์„ค์น˜ (npm i -g @openai/codex)
  • gemini CLI ์„ค์น˜ (npm i -g @google/gemini-cli)

MCP ์„œ๋ฒ„๋Š” ๊ฐ๊ฐ์˜ CLI๋ฅผ ๊ทธ๋Œ€๋กœ ์‹คํ–‰ํ•˜๋ฏ€๋กœ, ๋จผ์ € ๋กœ์ปฌ ํ„ฐ๋ฏธ๋„์—์„œ ๋กœ๊ทธ์ธ/์ธ์ฆ์ด ์™„๋ฃŒ๋˜์–ด codex / gemini CLI๋ฅผ ๋ฐ”๋กœ ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋Š” ์ƒํƒœ์ธ์ง€ ํ™•์ธํ•˜์„ธ์š”.

Install

npm์—์„œ ์„ค์น˜(๋ฐฐํฌ๋œ ๊ฒฝ์šฐ):

npm i -g @donghae0414/codex-gemini-mcp

์ „์—ญ ์„ค์น˜ ์—†์ด npx ์‚ฌ์šฉ:

npx -y -p @donghae0414/codex-gemini-mcp codex-mcp
npx -y -p @donghae0414/codex-gemini-mcp gemini-mcp

์†Œ์Šค์—์„œ ์„ค์น˜(๊ฐœ๋ฐœ/ํ…Œ์ŠคํŠธ):

npm install
npm run build
npm link

ํด๋ผ์ด์–ธํŠธ๋ณ„ MCP ์„ค์ • ์˜ˆ์‹œ

์ „์—ญ ์„ค์น˜ ๊ธฐ์ค€:

{
  "mcpServers": {
    "codex-mcp": {
      "command": "codex-mcp",
      "args": []
    },
    "gemini-mcp": {
      "command": "gemini-mcp",
      "args": []
    }
  }
}

์ „์—ญ ์„ค์น˜ ์—†์ด npx ๊ธฐ์ค€:

{
  "mcpServers": {
    "codex-mcp": {
      "command": "npx",
      "args": ["-y", "-p", "@donghae0414/codex-gemini-mcp", "codex-mcp"]
    },
    "gemini-mcp": {
      "command": "npx",
      "args": ["-y", "-p", "@donghae0414/codex-gemini-mcp", "gemini-mcp"]
    }
  }
}

opencode (opencode.json):

{
  "mcp": {
    "codex-mcp": {
      "type": "local",
      "command": ["npx", "-y", "-p", "@donghae0414/codex-gemini-mcp", "codex-mcp"]
    },
    "gemini-mcp": {
      "type": "local",
      "command": ["npx", "-y", "-p", "@donghae0414/codex-gemini-mcp", "gemini-mcp"]
    }
  }
}

ํด๋ผ์ด์–ธํŠธ๋ณ„ ์„ค์ • ํŒŒ์ผ ์œ„์น˜(์ฐธ๊ณ ):

  • Claude Code: ํ”„๋กœ์ ํŠธ ๋ฃจํŠธ .mcp.json (ํ”„๋กœ์ ํŠธ๋ณ„) ๋˜๋Š” ~/.claude.json (์ „์—ญ)
  • Claude Desktop (macOS): ~/Library/Application Support/Claude/claude_desktop_config.json
  • Claude Desktop (Windows): %APPDATA%\Claude\claude_desktop_config.json
  • Claude Desktop (Linux): ~/.config/Claude/claude_desktop_config.json
  • opencode: ~/.config/opencode/opencode.json

ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋Š” ์…ธ ํ”„๋กœํ•„(.zshrc ๋“ฑ)์—์„œ ์ž๋™์œผ๋กœ ์ฃผ์ž…๋˜์ง€ ์•Š์„ ์ˆ˜ ์žˆ์œผ๋ฏ€๋กœ, ๊ฐ€๋Šฅํ•˜๋ฉด ์„ค์ • ํŒŒ์ผ์˜ env ๋ธ”๋ก์œผ๋กœ ์ „๋‹ฌํ•˜์„ธ์š”.

Default Models

๊ธฐ๋ณธ ๋ชจ๋ธ์€ src/config.ts์— ํ•˜๋“œ์ฝ”๋”ฉ๋˜์–ด ์žˆ์œผ๋ฉฐ, ํ™˜๊ฒฝ ๋ณ€์ˆ˜๋กœ overrideํ•  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.

Provider ๊ธฐ๋ณธ ๋ชจ๋ธ ํ™˜๊ฒฝ ๋ณ€์ˆ˜ override
codex gpt-5.3-codex MCP_CODEX_DEFAULT_MODEL
gemini gemini-3-pro-preview MCP_GEMINI_DEFAULT_MODEL

๋ชจ๋ธ ์„ ํƒ ์šฐ์„ ์ˆœ์œ„: ์š”์ฒญ ํŒŒ๋ผ๋ฏธํ„ฐ model > ํ™˜๊ฒฝ ๋ณ€์ˆ˜ > ํ•˜๋“œ์ฝ”๋”ฉ ๊ธฐ๋ณธ๊ฐ’

Local development

npm install
npm run build
npm run start:codex
npm run start:gemini

๊ฐœ๋ฐœ ๋ชจ๋“œ:

npm run dev:codex
npm run dev:gemini

Runtime Files

  • ๊ธฐ๋ณธ ๋Ÿฐํƒ€์ž„ ๋””๋ ‰ํ† ๋ฆฌ: <cwd>/.codex-gemini-mcp/
    • background job ์ƒํƒœ: jobs/
    • background job ์ž…์ถœ๋ ฅ(content): prompts/
    • ๊ตฌ์กฐํ™” ๋กœ๊น…(JSONL): logs/
  • ๋Ÿฐํƒ€์ž„ ๊ฒฝ๋กœ override:
    • MCP_RUNTIME_DIR: ๋Ÿฐํƒ€์ž„ ๋ฃจํŠธ ๋””๋ ‰ํ† ๋ฆฌ
    • MCP_LOG_DIR: ๋กœ๊ทธ ๋””๋ ‰ํ† ๋ฆฌ

์ •๋ฆฌ(๊ธฐ๋ณธ ๊ฒฝ๋กœ ์‚ฌ์šฉ ์‹œ):

rm -rf .codex-gemini-mcp

Security / Privacy Notes

  • background: true(๊ธฐ๋ณธ๊ฐ’) ์š”์ฒญ์€ .codex-gemini-mcp/prompts/*content*.json์— prompt/response๋ฅผ ์ €์žฅํ•ฉ๋‹ˆ๋‹ค.
  • ํ”„๋กฌํ”„ํŠธ์— ์‹œํฌ๋ฆฟ(ํ† ํฐ, ๋น„๋ฐ€๋ฒˆํ˜ธ, ๊ฐœ์ธ ์ •๋ณด ๋“ฑ)์„ ๋„ฃ์œผ๋ฉด ๋กœ์ปฌ ํŒŒ์ผ์— ๋‚จ์„ ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค.
  • ๋กœ๊น…์€ ๊ธฐ๋ณธ์ ์œผ๋กœ ๋ณธ๋ฌธ ๋ฏธ์ €์žฅ์ด์ง€๋งŒ, ์•„๋ž˜ ํ”Œ๋ž˜๊ทธ๋ฅผ ์ผœ๋ฉด ๋กœ๊ทธ์— ํ…์ŠคํŠธ๊ฐ€ ํฌํ•จ๋  ์ˆ˜ ์žˆ์Šต๋‹ˆ๋‹ค:
    • MCP_LOG_PREVIEW=1
    • MCP_LOG_FULL_TEXT=1

Tool Schemas

ask_codex

  • prompt (string, required)
  • model (string, optional)
  • model์€ [A-Za-z0-9][A-Za-z0-9._:-]* ํŒจํ„ด(์ตœ๋Œ€ 128์ž)๋งŒ ํ—ˆ์šฉ
  • working_directory (string, optional): CLI ํ”„๋กœ์„ธ์Šค์˜ ์‹คํ–‰ ๋””๋ ‰ํ† ๋ฆฌ(cwd)
  • background (boolean, optional, default true)
  • reasoning_effort (string, optional: minimal | low | medium | high | xhigh)

ask_gemini

  • prompt (string, required)
  • model (string, optional)
  • model์€ [A-Za-z0-9][A-Za-z0-9._:-]* ํŒจํ„ด(์ตœ๋Œ€ 128์ž)๋งŒ ํ—ˆ์šฉ
  • working_directory (string, optional): CLI ํ”„๋กœ์„ธ์Šค์˜ ์‹คํ–‰ ๋””๋ ‰ํ† ๋ฆฌ(cwd)
  • background (boolean, optional, default true)

wait_for_job

  • job_id (string, required, 8์ž๋ฆฌ hex)
  • timeout_ms (number, optional, default 3600000, max 3600000; 3600000 ์ดˆ๊ณผ ๊ฐ’์€ 3600000์œผ๋กœ cap)

check_job_status

  • job_id (string, required, 8์ž๋ฆฌ hex)

kill_job

  • job_id (string, required, 8์ž๋ฆฌ hex)
  • signal (string, optional: SIGTERM | SIGINT, default SIGTERM)

list_jobs

  • status_filter (string, optional: active(spawned/running) | completed | failed(failed/timeout) | all, default active)
  • limit (number, optional, default 50)

Runtime Notes

  • ask_codex: codex exec --ephemeral ํ˜ธ์ถœ (reasoning_effort ์ง€์ • ์‹œ -c model_reasoning_effort=... ์ถ”๊ฐ€)
  • ask_gemini: gemini --prompt <text> ํ˜ธ์ถœ
  • ask_*๋Š” background ๋ฏธ์ง€์ • ์‹œ ๊ธฐ๋ณธ true๋กœ ์‹คํ–‰
  • background: true ํ˜ธ์ถœ ์‹œ .codex-gemini-mcp/jobs, .codex-gemini-mcp/prompts์— ์ƒํƒœ/์ž…์ถœ๋ ฅ(content) ํŒŒ์ผ ์ €์žฅ
  • ๊ตฌ์กฐํ™” ๋กœ๊น…(JSONL): .codex-gemini-mcp/logs/mcp-YYYY-MM-DD.jsonl
    • ๊ธฐ๋ณธ: ๋ฉ”ํƒ€๋ฐ์ดํ„ฐ๋งŒ ์ €์žฅ (๋ณธ

Tools (6)

ask_codexRequest code generation, refactoring, or debugging from Codex.
ask_geminiRequest analysis, summarization, or code review from Gemini.
wait_for_jobWait for a background job to complete.
check_job_statusCheck the status of a background job.
kill_jobTerminate a running background job.
list_jobsList background jobs with optional status filtering.

Environment Variables

MCP_CODEX_DEFAULT_MODELOverride the default Codex model.
MCP_GEMINI_DEFAULT_MODELOverride the default Gemini model.
MCP_RUNTIME_DIROverride the runtime root directory.
MCP_LOG_DIROverride the log directory.

Configuration

claude_desktop_config.json
{"mcpServers": {"codex-mcp": {"command": "npx", "args": ["-y", "-p", "@donghae0414/codex-gemini-mcp", "codex-mcp"]}, "gemini-mcp": {"command": "npx", "args": ["-y", "-p", "@donghae0414/codex-gemini-mcp", "gemini-mcp"]}}}

Try it

โ†’Use ask_codex to refactor the current file to improve performance.
โ†’Ask Gemini to review the code in the current directory and suggest improvements.
โ†’List all my active background jobs to see which ones are still running.
โ†’Ask Codex to generate a unit test for the function I just wrote.
โ†’Check the status of job ID 12345678 and wait for it to finish.

Frequently Asked Questions

What are the key features of Codex Gemini MCP?

Direct integration with OpenAI Codex and Google Gemini CLIs. Background job management for long-running AI tasks. Multi-model orchestration allowing agents to use both providers. Configurable model selection and timeout settings. Structured JSONL logging for task tracking.

What can I use Codex Gemini MCP for?

Automating code refactoring tasks using Codex directly from the IDE. Performing deep code reviews and summarization using Gemini. Managing long-running AI analysis tasks without blocking the agent. Switching between different AI models for specific coding or analysis needs.

How do I install Codex Gemini MCP?

Install Codex Gemini MCP by running: npm i -g @donghae0414/codex-gemini-mcp

What MCP clients work with Codex Gemini MCP?

Codex Gemini MCP works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep Codex Gemini MCP docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare