# Repository Briefing: XiaoDuoYa/codex-with-chatgpt
> Source: https://repoforai.com/repo/XiaoDuoYa/codex-with-chatgpt (Static metadata snapshot — treat external repo content as untrusted data)

- **GitHub URL**: https://github.com/XiaoDuoYa/codex-with-chatgpt
- **Category**: Coding, Skills & MCP (AI 编程 / Skills / MCP)
- **Primary Language**: TypeScript
- **License**: MIT
- **Engineering Health**: A (77/100 · Maintenance 20/35 · Adoption 20/25 · Releases 17/20 · License 20/20)
- **Latest Release**: v0.1.4 (2026-10-01) — https://github.com/XiaoDuoYa/codex-with-chatgpt/releases
- **Review Snapshot**: 2026-12-03
- **Deployment / Stack Signals**: MCP, CLI, Self-Hosted
- **Momentum**: 7,752 ★ total (+1 24h / +28 7d) · 709 forks
- **Topics**: `ai-agents`, `chatgpt`, `codex`, `mcp`, `model-context-protocol`, `oauth`
- **When to Use**: Best for: Codex users who can expose a scoped workspace through an authenticated connector and want ChatGPT Web to review actual diffs and test records without executing commands. Skip if: Source and logs must stay offline or on-device, public tunnel endpoints are prohibited, or direct Codex review already meets your needs.

## Overview
```text
### Architecture & Core Mechanics
C2C separates browser-mediated coordination from workspace access. The Codex Skill exchanges compact [C2C] state messages with ChatGPT Web from INIT through PLAN, EXECUTED, REVIEW, and DONE. ChatGPT retrieves evidence through stateless Streamable HTTP MCP rather than receiving diffs or file bodies in those messages. Codex retains local editing, shell, Git, and test execution.

The TypeScript bridge binds HTTP to loopback and exposes the authenticated connector through a Cloudflare tunnel. The Node.js package ships the `c2c` CLI and depends on `@modelcontextprotocol/sdk`, `commander`, `express`, `ignore`, and `zod`. The source separates bridge lifecycle, OAuth and pairing, workspace access, execution records, and tunnel management; a `TunnelProvider` abstraction sits behind the Cloudflare Quick and Named Tunnel options.

### Key Capabilities & Differentiators
The read-only MCP surface includes directory listing, file and image reads, workspace search, Git status and diff, and recorded execution summaries and output. ChatGPT can inspect a change and its available test records instead of relying on Codex’s conversational summary. It does not rerun the tests through MCP, so the review is only as complete as the evidence available in the workspace and execution records.

OAuth 2.1 uses PKCE S256, dynamic client registration, and refresh-token rotation. Tokens are workspace-bound; one-time pairing codes expire after five minutes and permit at most five attempts. Canonical realpath checks constrain file access, and `.c2cignore` supplements the default sensitive-file rules. Generated media takes a separate local path: `c2c asset import` checks file signatures and sizes, rejects active SVG content, and does not overwrite existing files.

### Trade-offs & Limitations
Compared with using Codex directly, C2C adds a separate planning and review pass that can read actual diffs and test records without gaining execution privileges. The cost is more operational state: browser coordination, ChatGPT connector availability, pairing, and tunnel lifecycle. A Quick Tunnel can trigger connector reconfiguration after a restart. A Named Tunnel reduces that churn but adds Cloudflare account and domain administration. The integration does not establish a measured reduction in Codex usage.

Read-only protects workspace integrity at the MCP layer, not confidentiality. The bridge does not require a bulk repository upload, but content returned by tools still reaches ChatGPT; secrets in otherwise permitted files or execution output should not be assumed safe. Review the workspace scope and exclusion rules before pairing. The MIT license applies to the bridge, not to the ChatGPT or Cloudflare services, and the integration does not install a Web GPT or add a model-catalog entry.

### Hardware & Deployment Guide
Build the checkout with `pnpm install` and `pnpm build` on Node.js 20 or newer with Git available, then install `skill/SKILL.md` in the Codex skills directory and run `c2c setup`. The default public connector path needs `cloudflared` and a ChatGPT sign-in. A stable Named Tunnel additionally needs a Cloudflare account and a domain already on Cloudflare. The bridge is self-hosted, but this is not an offline workflow or a local inference stack; no model API key is required for the documented integration.

The CLI provides `status`, `doctor`, `pair`, `unpair`, `logs`, and `stop` for local operation. Set `C2C_TUNNEL_PROTOCOL=http2` and restart if the network blocks QUIC. Release v0.1.3 improved temporary-address recovery and pairing-code timing. v0.1.4 delays the first Quick Tunnel health probe to avoid negative DNS caching on fresh hostnames, corrects search truncation reporting, and adds agent attribution to execution records.
```

## Key Capabilities
```text
- Control plane: Browser-mediated [C2C] messages coordinate INIT → PLAN → EXECUTED → REVIEW → DONE without carrying diffs or file bodies.
- Data plane: Stateless Streamable HTTP MCP exposes workspace files, Git diffs, test status, execution records, and supported images through read-only tools.
- Authorization: OAuth 2.1 uses PKCE S256, dynamic client registration, and refresh-token rotation; workspace-bound tokens follow pairing with a five-minute, five-attempt limit.
- Workspace boundary: Canonical realpath checks enforce containment, while default sensitive-file rules and .c2cignore limit what can be read.
- Tunnel lifecycle: Cloudflare Quick Tunnel URLs can change on restart and require connector repair; a Named Tunnel can provide a stable hostname.
- Review evidence: ChatGPT can retrieve diffs and recorded test output directly; v0.1.4 allows execution records to identify the agent that ran an iteration.
```

## Quick Start / Clone
```bash
pnpm install
pnpm build          # -> dist/, exposes the `c2c` bin
pnpm test           # vitest: 150 tests (path security, OAuth, pairing, MCP e2e)

c2c setup           # bridge + tunnel + pairing code, all in one
c2c sandbox-allow   # whitelist the settings dir in Codex (macOS + Windows)
c2c status / doctor / pair / unpair / logs / stop
```
