KC

kky42/codex-as-mcp

Developer tools

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요. 원문 보기

175 stars 23 forks 품질 70 트렌드 21

kky42/codex-as-mcp는 https://github.com/kky42/codex-as-mcp.에서 가져온 MCP 서버 후보입니다.

개요

kky42/codex-as-mcp는 https://github.com/kky42/codex-as-mcp.에서 가져온 MCP 서버 후보입니다.

개요(AI 번역)

中文版

codex-as-mcp는 MCP 클라이언트(Claude Code, 커서 등)가 작업을 Codex CLI에 위임할 수 있도록 하는 소형 모델 컨텍스트 프로토콜(MCP) 서버입니다.

서버의 현재 작업 디렉터리에서 Codex를 실행하는 두 가지 도구를 노출합니다:

  • spawn_agent(prompt: str)
  • spawn_agents_parallel(agents: list[dict])

각 에이전트는 다음과 같은 기능을 운영합니다: codex exec --cd --skip-git-repo-check --dangerously-bypass-approvals-and-sandbox -.

프롬프트는 stdin을 통해 전송된 후 닫힙니다. 이렇게 하면 명령줄 인용/길이 문제를 피하고, Codex가 MCP 서버의 JSON-RPC stdin 파이프를 실수로 읽는 것을 방지합니다.

참고: --dangerously-bypass-approvals-and-sandbox는 샌드박싱과 확인 프롬프트를 비활성화합니다. 이 서버는 신뢰할 수 있는 저장소에서만 사용하세요.

클로드 코드로 사용해

코덱스-as-mcp에는 두 가지 도구가 있습니다

프롬프트를 사용하면 병렬 코덱스 서브에이전트를 생성할 수 있습니다.

여기 두 가지 작업을 병행해서 위임하는 코덱스 세션 샘플이 있습니다.

퀵 스타트

1. Codex CLI 설치

Codex CLI >= 0.46.0 필요

Codex CLI가 귀하의 컴퓨터에서 비인터랙티브로 실행될 수 있는지 확인하세요(제공자 + '~/.codex/config’의 자격 증명).

이 페이지는 AI로 자동 번역되었습니다. 기술적인 세부 사항은 원문을 확인하세요.

README

원문 README의 일부입니다. 원문 보기.

codex-as-mcp

中文版

codex-as-mcp is a small Model Context Protocol (MCP) server that lets MCP clients (Claude Code, Cursor, etc.) delegate work to the Codex CLI.

It exposes two tools that run Codex in the server’s current working directory:

  • spawn_agent(prompt: str)
  • spawn_agents_parallel(agents: list[dict])

Under the hood, each agent runs something like: codex exec --cd --skip-git-repo-check --dangerously-bypass-approvals-and-sandbox -.

The prompt is sent through stdin and then closed. This avoids command-line quoting/length issues and prevents Codex from accidentally reading from the MCP server’s JSON-RPC stdin pipe.

Note: --dangerously-bypass-approvals-and-sandbox disables sandboxing and confirmation prompts. Use this server only in repos you trust.

Use it in Claude Code

There are two tools in codex-as-mcp

You can spawn parallel codex subagents using prompt.

Here’s a sample Codex session delegating two tasks in parallel.

Quick start

1. Install Codex CLI

Requires Codex CLI >= 0.46.0

npm install -g @openai/codex@latest
codex login

# Verify installation
codex --version

Make sure Codex CLI can run non-interactively on your machine (provider + credentials in ~/.codex/config.toml, or via the provider-specific env var it references).

Example: third-party provider + env_key

If you’re using a third-party provider, configure it in Codex config.toml and point model_provider at it. When a provider uses env_key, Codex CLI expects that env var to be present when it runs.

Example:

model_provider = "custom_provider"

[model_providers.custom_provider]
name = "custom_provider"
base_url = "https://..."
wire_api = "responses"
env_key = "PROVIDER_API_KEY"
show_raw_agent_reasoning = true

When using codex-as-mcp, make sure the MCP server process has that env var set, so it can pass it through to the spawned codex process. The env var name must match the env_key value above (here: PROVIDER_API_KEY).

Option A (recommended): set env in your MCP client config (if supported)

{
  "mcpServers": {
    "codex-subagent": {
      "type": "stdio",
      "command": "uvx",
      "args": ["codex-as-mcp@latest"],
      "env": {
        "PROVIDER_API_KEY": "KEY_VALUE"
      }
    }
  }
}

Option B: pass env via server args

uvx codex-as-mcp@latest --env PROVIDER_API_KEY=KEY_VALUE

Option C: add via Codex CLI (codex mcp add)

codex mcp add codex-subagent --env PROVIDER_API_KEY=KEY_VALUE -- uvx codex-as-mcp@latest

Security note: passing secrets via command-line args may be visible via process lists on your machine; prefer option A when possible.

2. Configure MCP

Add to your .mcp.json:

{
  "mcpServers": {
    "codex-subagent": {
      "type": "stdio",
      "command": "uvx",
GitHub에서 전체 README 보기

설치

uvx codex-as-mcp@latest
MCP 초보자라면? mcpskill.org 가이드부터 시작하세요 →

설정

{ "mcpServers": { "codex-subagent": { "type": "stdio", "command": "uvx", "args": ["codex-as-mcp@latest"], "env": { "PROVIDER_API_KEY": "KEY_VALUE" } } } }