Skip to main content
Glama

Claude to Codex (C2C)

English | Bahasa Indonesia | 简体中文

Use Claude Web to plan, reason, and review. Let Codex execute — connected through a secure, read-only MCP bridge.

No Claude API key. No reverse proxy. Claude connects to an OAuth-protected remote MCP endpoint and reads only the workspace data it needs.

  • One connector, many projects. Connect Claude once. Adding, switching, or closing projects requires no new connector, OAuth flow, or pairing.

  • Read-only by construction. Claude gets no write, shell, commit, or execution tools. Codex remains the sole executor and mutator.

  • Workspace-isolated. Projects are registered locally. Claude sees opaque workspace IDs, not arbitrary filesystem roots, and every file operation is confined to the granted workspace.

  • Local-first. Your source code stays on your machine and is exposed only through explicit, read-only MCP requests.

Based on codex-with-chatgpt.

How it works

Claude Web (plan · reason · review)
    │
    │  OAuth once · one connector
    ▼
C2C Broker ─────── stable /mcp endpoint
    │
    │  opaque workspace capabilities
    │
    ├── Project A   ◄── Codex session
    ├── Project B   ◄── Codex session
    └── Project C
              ▲
              │  edit · shell · git · tests
              │
        Codex (execute · repair)

Claude inspects code, diffs, git state, and recorded test results through the broker, then gives Codex a plan. Codex is the only component that changes anything.

Every Claude-facing capability is read-only. Workspaces are registered locally by Codex/C2C and addressed through opaque IDs. Filesystem paths are canonicalized and confined to the granted workspace, while sensitive files such as .env, private keys, and credentials are denied.

Related MCP server: Claude Code MCP Bridge

Quick start

Requirements: Node.js ≥ 20, git, cloudflared, and Claude Web with custom connector support.

git clone https://github.com/willio/claude-to-codex.git
cd claude-to-codex
pnpm install
pnpm build
npm install -g .

Install the Codex skill:

mkdir -p ~/.codex/skills/claude-to-codex
cp skill/SKILL.md ~/.codex/skills/claude-to-codex/

Connect Claude — once

From your first project:

cd ~/Projects/your-project
c2c setup

C2C starts the broker and gives you the MCP endpoint and a one-time pairing code.

In Claude Web:

Customize → Connectors → Add custom connector

Paste the /mcp URL, complete OAuth, and enter the pairing code.

Pairing codes expire after approximately five minutes. If necessary, generate another while the authorization page is open:

c2c pair

That's the only Claude-side setup.

Add another project

cd ~/Projects/another-project
codex

The Codex skill registers the workspace with the existing C2C installation. No new Claude connector, OAuth authorization, or pairing is required.

For a permanent connector URL, use a named Cloudflare tunnel:

c2c tunnel choose --mode named --zone <domain>

A stable endpoint is recommended for the single connector you keep in Claude. Quick Tunnels remain useful for development and temporary testing.

The loop

INIT → PLAN → EXECUTED → REVIEW → DONE

Claude retrieves the context it needs through MCP rather than requiring files and diffs to be pasted into the conversation.

Codex executes the plan and records the result:

c2c record --task <id> --iteration <n> --tests "27 passed"

Claude can then independently inspect the resulting diff, git state, and recorded outcome before concluding the task.

MCP tools

All tools are read-only:

list_workspaces
workspace_info
list_directory
read_file
search_workspace
git_status
git_diff
test_status
execution_summary

test_status and execution_summary only read results previously recorded by Codex. They cannot run commands or tests.

Security model

No mutation surface. The MCP server exposes no file-write, shell, execution, commit, or other mutation tools. Codex retains exclusive execution authority.

Installation-level authorization. Claude authorizes one C2C installation rather than individual projects. OAuth uses Dynamic Client Registration, PKCE with S256, short-lived pairing codes, refresh-token rotation, and revocation.

Workspace capabilities. Claude can address only workspaces registered locally with C2C. Unknown, missing, or revoked workspace IDs fail closed. Path traversal and symlink escapes are rejected through canonical-path containment.

No arbitrary filesystem roots. Claude works with opaque workspace identities. It cannot nominate another directory on the machine and turn it into a workspace.

Untrusted repository content. Source files, documentation, issues, and other workspace content are treated as data, never as authorization.

Short-lived pairing. Pairing establishes authorization without exposing a long-lived credential in the browser.

See docs/security.md for the threat model, docs/multi-workspace.md for the workspace architecture, and docs/local-e2e.md for end-to-end validation.

CLI

c2c setup
c2c start
c2c status
c2c doctor
c2c pair
c2c unpair
c2c record
c2c tunnel
c2c session
c2c logs
c2c sandbox-allow
c2c stop

Every command supports --json for tooling.

c2c doctor diagnoses and repairs the local side where possible. If the public endpoint changes and Claude requires the connector to be re-added, it reports the required action explicitly.

For compatibility, doctor --json exposes the canonical connectorRepair field while retaining chatgptRepair as a deprecated alias.

Compatibility

Claude to Codex began from the ideas and architecture of codex-with-chatgpt and has since evolved into an independent implementation.

The current architecture uses one installation-level Claude connector serving multiple locally registered Codex workspaces.

Compatibility with earlier C2C installations is intentionally non-destructive:

  • Existing per-project bridges remain supported during migration.

  • Legacy codex-with-chatgpt state directories can be adopted.

  • Compatibility fields and aliases are removed only through explicit, versioned changes.

See docs/migration.md.

Development

pnpm install
pnpm typecheck
pnpm test
pnpm build

CI runs typecheck, tests, and build on every push.

Key source areas:

src/broker/       installation endpoint and routing
src/mcp/          read-only MCP tools
src/auth/         OAuth 2.1
src/workspaces/   workspace registry and sessions
src/bridge/       per-project bridge compatibility
src/cli/          C2C command-line interface
docs/             architecture, protocol, security and migration

Credits

Claude to Codex builds on the original idea and architecture of codex-with-chatgpt by @XiaoDuoYa.

The project has since diverged into an independent Claude Web implementation, while preserving attribution to the upstream work and its MIT copyright in LICENSE.

Claude to Codex is an unofficial community project and is not affiliated with or endorsed by Anthropic or OpenAI.

License

MIT

A
license - permissive license
Not graded
quality - not tested
B
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Servers

View all related MCP servers

Related MCP Connectors

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/willio/claude-to-codex'

If you have feedback or need assistance with the MCP directory API, please join our Discord server