Use your Claude subscription in Cursor — zero API keys, zero config files.
CursorBridge is a local proxy that translates Cursor's OpenAI-format requests into Anthropic format and routes them through your existing Claude subscription. It auto-detects your Claude Code login, so there's nothing to paste or configure on the backend side.
Result: Claude models in Cursor, using the subscription you already pay for.
git clone https://github.com/Huntehhh/cursor-bridge.git
cd cursor-bridge
./setup.shThat's it. The setup script will:
- Check for Node.js 18+
- Install dependencies
- Auto-detect your Claude Code OAuth token
- Verify the connection to Claude
- Print your Cursor settings
- Node.js 18+ —
brew install nodeif needed - Claude Code CLI — installed and logged in (
npm install -g @anthropic-ai/claude-code, then runclaudeonce to log in)
CursorBridge reads your existing Claude Code credentials automatically. No API keys to generate or paste.
After CursorBridge is running, open Cursor:
- Settings → Models → OpenAI API Key — paste the local token printed in your terminal
- Toggle ON "Override OpenAI Base URL"
- Set Base URL to
http://localhost:4101/v1 - Click Verify — you should see a green checkmark
- Start chatting — Claude is now powering your Cursor
The local token is just for Cursor ↔ CursorBridge auth. Your real credentials never leave your machine.
cd cursor-bridge
./setup.shOr if you've already run setup once:
cd cursor-bridge
npm run devStart this before opening Cursor. Stop with Ctrl+C when done.
npm run dev -- --port 4200 # Custom port
npm run dev -- --reset # Re-run setup (re-detect token)
npm run dev -- --version # Show versionCursor → localhost:4101 (OpenAI format)
→ CursorBridge translates request
→ Anthropic API (your Claude subscription, via OAuth)
→ CursorBridge translates response → OpenAI format
→ Back to Cursor
On first run, CursorBridge reads ~/.claude/.credentials.json (created when you log into Claude Code), extracts your OAuth token, and stores a local config in ~/.cursor-bridge/config.json. Your OAuth token stays local — Cursor only sees a randomly-generated local token.
"Claude Code not found"
- Install it:
npm install -g @anthropic-ai/claude-code - Then run
claudeonce in your terminal to log in
"No Claude login found"
- Run
claudein your terminal — this creates the credentials file CursorBridge reads - Make sure you complete the login flow (browser opens, you authorize)
"Token expired"
- Run
claudein your terminal to refresh your OAuth session - Then restart CursorBridge:
./setup.sh
Cursor "Verify" fails
- Make sure CursorBridge is running in a terminal
- Check the port matches (default: 4101)
- The local token in Cursor must match what CursorBridge printed
Responses are slow?
- Normal Claude API latency — same as using Claude directly
- Streaming is on by default, so you'll see tokens as they arrive
./update.shOn macOS, this pulls the latest code, reinstalls dependencies, and restarts the LaunchAgent. On other platforms, restart manually after the update.
CursorBridge automatically refreshes your OAuth token:
- Every 4 hours — re-reads Claude Code credentials from disk and hot-swaps the token (no restart needed)
- On 401 errors — if Claude rejects a request, CursorBridge retries once with a fresh token
- macOS notification — if the token is expired and can't be refreshed, you'll get a notification prompting you to run
claudein Terminal
If Cursor shows persistent auth errors, run claude in your terminal to refresh your OAuth session. CursorBridge will pick up the new token automatically within 4 hours (or immediately on the next 401).