codex-cursor-bridge
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@codex-cursor-bridgeInvestigate this flaky test in an isolated worktree and hand the fix plan back to Cursor."
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
codex-cursor-bridge
Local-first, two-way delegation between Codex and Cursor agents.
Delegate the hard stuff across editors without copy-pasting context between apps: Cursor hands deep investigation, adversarial review, rescue, planning — and even implementation — to Codex as background jobs; Codex hands validated implementation plans to Cursor. A shared bridge keeps state, enforces permissions, and preserves native session ids so you can always continue where you left off.
Independent project. This tool is not affiliated with, sponsored by, or endorsed by OpenAI or Cursor (Anysphere). "Codex" and "Cursor" are used solely to describe interoperability with those products.
Why two host-specific plugins?
Cursor and Codex have different plugin manifests, different skills formats, and — most importantly — each side must only ever see the opposite host's tools. A single shared manifest would let a Cursor session call Cursor delegation tools (or vice versa) and invite unbounded recursion. Two manifests mean the tool surface itself enforces direction: the Cursor plugin can only start Codex jobs; the Codex plugin can only start Cursor jobs.
Related MCP server: Cross-Project MCP Server
Architecture
flowchart LR
subgraph Cursor["Cursor"]
S1["delegate-to-codex skill"] --> T1["codex_start / status / result / reply / cancel"]
end
subgraph Bridge["codex-cursor-bridge"]
M1["MCP server (--host cursor)"] --> J["JobManager + JobStore"]
M2["MCP server (--host codex)"] --> J
J --> A1["codex app-server adapter"]
J --> A2["codex exec fallback"]
J --> A3["@cursor/sdk adapter"]
J --> A4["cursor-agent acp adapter"]
J --> A5["cursor --print (gated)"]
end
subgraph Codex["Codex"]
S2["plan-and-delegate-to-cursor skill"] --> T2["cursor_start / status / result / reply / cancel"]
end
T1 --> M1
T2 --> M2Details in docs/architecture.md. Wire protocols in docs/protocol.md.
Trust & security model (short version)
Read-only by default. Investigation/review/plan modes cannot modify your repo. Implementation requires an explicit mode + profile.
Isolated worktrees for writes. Implementation jobs run in a temporary git worktree created from a recorded base ref. You get a patch artifact — nothing is merged automatically.
No shell, no network. Agents are spawned with argument arrays, prompts via stdin; Codex runs with
networkAccess=falseby default. The bridge opens no ports and ships no telemetry.Secrets stay put. API keys are read by the CLIs/SDKs from your environment; the bridge never stores or logs them and redacts common secret shapes in everything it persists.
Recursion is capped. Depth 1 by default (hard max 2), and prompts plus tool scoping forbid delegating back to the originating host.
Full threat model: docs/security-model.md.
Requirements
Node.js ≥ 20.19, npm ≥ 10, git ≥ 2.30
For Cursor→Codex: the Codex CLI, installed and logged in (
npm i -g @openai/codex && codex login)For Codex→Cursor, one of:
Cursor CLI + login:
npm i -g cursor-agent && cursor-agent login(ACP; recommended, uses your existing Cursor auth), or@cursor/sdk+CURSOR_API_KEY(Cursor cloud agents; billing applies per Cursor's docs)
OS: macOS, Linux, or Windows
Check everything at once:
codex-cursor-bridge doctorInstallation for Cursor
Release archive (recommended):
Download
codex-cursor-bridge-cli-<ver>.zipfrom GitHub Releases and unzip. Run./install.sh(--dry-runto preview;install.ps1on Windows). This puts the CLI in~/.local/bin(or%LOCALAPPDATA%\Programs\codex-cursor-bridge).Download
codex-cursor-bridge-plugin-cursor-<ver>.zipand unzip into~/.cursor/plugins/local/codex-cursor-bridge(install.sh from the CLI archive can do this too).Restart Cursor. Run the
/setup-checkcommand orcodex-cursor-bridge doctor.
From source:
git clone https://github.com/surveyspark/codex-cursor-bridge.git
cd codex-cursor-bridge
npm ci && npm run build
ln -s "$PWD" ~/.cursor/plugins/local/codex-cursor-bridgeInstallation for Codex
Install the CLI as above (
install.shplaces it).Copy/unzip
codex-cursor-bridge-plugin-codex-<ver>.zipto~/.codex/plugins/codex-cursor-bridge(install.sh does this).Verify:
codex-cursor-bridge doctorandcodex plugin list.
First-run setup
codex-cursor-bridge doctorFix every ✗ using the printed
→remediation.Optional: create
~/.config/codex-cursor-bridge/config.json(or<repo>/.handoff/config.json) — see docs/architecture.md for the full schema. Show the effective config withcodex-cursor-bridge config show.The bridge never modifies your global Cursor/Codex configuration.
Authentication
Who | What |
Codex |
|
Cursor (ACP) |
|
Cursor (SDK) |
|
Check readiness without leaking values: codex-cursor-bridge doctor.
Quick start
Cursor asks Codex to debug a hard bug
In Cursor, ask normally:
The login flow fails when the session cookie expires mid-request. I've spent an hour on it. Delegate this to Codex.
The delegate-to-codex skill kicks in, picks investigate, and calls
codex_start. You'll see the bridge job id (job_…) and the Codex
thread id. CLI equivalent:
codex-cursor-bridge codex start \
--mode investigate \
--task "Login flow fails when the session cookie expires mid-request. Already tried: refreshing in middleware. Trace the root cause through src/auth/ and report." \
--expected-output "root cause, evidence, 2-3 candidate fixes"Cursor asks Codex for an adversarial review
codex-cursor-bridge codex start --mode adversarial-review \
--task "Break the new token refresh logic in src/auth/refresh.ts before we ship. Find races, replay windows, clock skew issues."Or the /adversarial-review-with-codex command in Cursor.
Cursor delegates implementation to Codex (isolated worktree)
codex-cursor-bridge codex start --mode implement \
--task "Add GET /healthz returning {\"status\":\"ok\"} and a route test." \
--constraints "only src/app.ts and test/routes.test.ts" \
--expected-output "files changed, test outcome"Codex runs in a fresh worktree; the result contains changedFiles,
diffStat, and a patch path like .handoff/<job>.patch. Apply it yourself:
git apply .handoff/<job>.patchCodex plans; Cursor executes
In Codex, ask:
Plan a retry wrapper for fetchUser, then delegate execution to Cursor.
The plan-and-delegate-to-cursor skill inspects the repo, produces a
validated handoff plan (facts vs assumptions, steps, acceptance criteria,
allowed paths), and calls cursor_start. Monitor with cursor_status,
retrieve with cursor_result, review the diff, then apply the patch on your
confirmation.
Check a background job
codex-cursor-bridge codex status job_abc… # state, native id, events
codex-cursor-bridge codex result job_abc… # summary, diffs, tests
codex-cursor-bridge cursor status job_def…
codex-cursor-bridge jobs listMCP equivalents: codex_status { jobId }, codex_result { jobId }, etc.
Reply to the same native session
codex-cursor-bridge codex reply job_abc… "Also check what happens when the clock is skewed by 5 minutes."This continues the same Codex thread (via thread/resume) or the same
Cursor session (via session/load), with full prior context.
Cancel a job
codex-cursor-bridge codex cancel job_abc…Terminates the agent process tree (process group on POSIX, taskkill /T on
Windows) and records a cancelled result.
Review Cursor's finished diff
cursor_result returns changedFiles, diffStat, and the patch path. In
Codex, ask "review what Cursor did" — the skill reads the patch, checks it
against the plan's acceptance criteria, and reports
approved / approved-with-notes / changes-required (one optional
auto-correction pass, disabled by default).
Recovering after the editor closes
Job records survive restarts: jobs list, jobs recover. Native sessions
are continuable via *_reply (bridge) or codex resume / cursor-agent --resume <id> (vendor CLIs). The bridge does not claim any particular
editor-history UI integration — resume works through these supported paths.
No SDK key? Use ACP.
If CURSOR_API_KEY is unset, adapter selection falls back to
cursor-agent acp with your local Cursor login. doctor shows which adapter
would be chosen and why.
Commands
Command | Purpose |
| Diagnose environment, adapters, auth (redacted) |
| Run the host-scoped MCP stdio server |
| Codex job operations |
| Cursor job operations |
| Job maintenance |
| Effective configuration (secrets redacted) |
| Reproducible demos against fake agents |
codex start flags: --task, --mode, --profile, --model, --effort,
--base-ref, --timeout, --constraints, --expected-output, --json,
--allow-noninteractive-cli, --repo.
MCP tools
Cursor-facing (exposed to Cursor only): codex_start, codex_status,
codex_result, codex_reply, codex_cancel, codex_list.
Codex-facing (exposed to Codex only): cursor_start, cursor_status,
cursor_result, cursor_reply, cursor_cancel, cursor_list.
Strict JSON Schemas for inputs/outputs; no shell tool. Schemas live in
schemas/.
Permission profiles
Profile | Effect | Default for |
| Agent cannot modify files (Codex read-only sandbox; ACP write requests denied) | investigate / review / adversarial-review / plan |
| Writes inside a temporary git worktree; patch returned | implement |
| Writes to your current tree (your choice, warned when dirty) | — |
Worktree behavior
Created from a verified base ref (explicit
--base-ref> current branch > HEAD) under the state dir — never inside your repo.Branch:
bridge/<repo>-<jobshort>. The bridge never merges, cherry-picks, or pushes.Result carries
worktree.path,branch,diffStat, and a.handoff/*.patchartifact with apply instructions.Cleanup: explicit
git worktree removeby you, or automatic after retention cleanup removes the job record.
Job lifecycle
queued → starting → running → (waiting-for-approval | waiting-for-input) → completed | failed | cancelled | timed-out
States, records, locking, retention, and crash recovery are documented in docs/architecture.md.
Resuming native sessions
Codex: every job preserves the Codex thread id (UUIDv7).
codex_replyresumes it viathread/resume;codex resume/codex exec resume <id>work on the CLI.Cursor: every job preserves the Cursor session id.
cursor_replyre-attaches via ACPsession/loadwhen supported; `cursor-agent --resume
` is the native path.
IDs are distinct on purpose:
Identifier | Example | Owner |
Bridge job id |
| this bridge |
Codex thread/session id | UUIDv7 | Codex |
Cursor agent/session id | opaque string | Cursor |
Worktree path / branch |
| git |
Applying generated changes
# inspect first
cat .handoff/<job>.patch
# then apply (never automatic)
git apply .handoff/<job>.patchOr cherry-pick the worktree branch (bridge/<repo>-<jobshort>) after review.
Troubleshooting
See docs/troubleshooting.md — covers auth failures, adapter selection, stuck jobs, stale locks, recovery after crashes, and plugin discovery.
Uninstall
rm ~/.local/bin/codex-cursor-bridge # or your --bin-dir
rm -rf ~/.cursor/plugins/local/codex-cursor-bridge
rm -rf ~/.codex/plugins/codex-cursor-bridge
rm -rf "$(codex-cursor-bridge doctor --json | jq -r .stateRoot)" # job state (optional)Nothing else was modified: no global editor config, no shell rc files.
Compatibility
Component | Minimum tested |
Node.js | 20.19 |
Codex CLI | 0.145.0 (app-server protocol) |
Cursor CLI | 1.0.x (acp/print) — see notes |
OS | macOS (tested), Linux, Windows (CI) |
Full matrix, verification status, and documented deviations: docs/compatibility.md.
Limitations
Credential-dependent end-to-end runs (real Codex/Cursor API calls) are opt-in (
RUN_CODEX_E2E=1,RUN_CURSOR_E2E=1) and were not executed for this release unless stated in the release notes; all protocol behavior is tested against fake agents implementing the official schemas.cursor-agentand@cursor/sdkevolve; the SDK adapter fails gracefully (falls back to ACP) when its surface changes.The optional post-execution Codex review is one read-only pass; auto- correction is a single follow-up, disabled by default.
Development
npm ci
npm run build # tsc project references + esbuild bundle
npm run lint # eslint
npm run format # prettier
npm test # vitest: unit, protocol, contract, integration, security
npm run validate:manifests
npm run package # release archives + SBOM + checksums
npm run demos # end-to-end demos against fake agentsLayout: packages/* (bridge-core, job-store, adapters, orchestrator,
mcp-server, cli, test-support), plugins/*, schemas/, docs/, tests/.
Release
See docs/release.md. Releases ship prebuilt bundles and plugin archives; no build step is required for users.
License & trademark notice
Apache-2.0 — see LICENSE and NOTICE. This project is independent and not affiliated with, sponsored by, or endorsed by OpenAI or Cursor (Anysphere). Product names are used only for descriptive interoperability. No vendor logos are used.
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Connectors
Cross-agent artifact workspace with provenance across Claude Code, Codex, Cursor, LangGraph.
Coordination hub for AI coding agents: message teammates, ask humans, audit every event.
The team layer for AI coding agents: shared contracts, collision alerts, E2EE sessions.
One identity across Claude Code, Codex, Cursor, Gemini, Windsurf: shared inbox and handoffs.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables AI assistants to delegate specific tasks to specialized sub-agents (e.g., test-writer, code-reviewer). Supports both Cursor and Claude Code with custom agent definitions.189396MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to explore, search, and reference code implementation details across different project repositories. It also supports a task delegation protocol for agents to request and track work between separate codebases.
- AlicenseNot gradedqualityBmaintenanceEnables Codex to delegate tasks to Claude Code, allowing Claude to investigate, edit, and verify changes in the repository with background job management.2MIT
- AlicenseNot gradedqualityBmaintenanceEnables Codex to delegate bounded coding tasks to MiMo Code through a shared local daemon, supporting task boundaries, Git Worktrees, and a collaborative review workflow.2MIT
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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/surveyspark/codex-cursor-bridge'
If you have feedback or need assistance with the MCP directory API, please join our Discord server