Skip to main content

Cursor Integration

Beta CCS integrates with Cursor IDE to route its AI models through a local daemon proxy — no API key required. The daemon exposes both OpenAI-compatible and Anthropic-compatible endpoints so Claude-native clients can reuse the same local Cursor credentials.
Beta Feature — Use at Your Own Risk
  • Uses Cursor’s internal ConnectRPC API (reverse-engineered, may break on IDE updates)
  • Tokens expire every 24h and must be re-imported
  • Windows users must use manual auth (--manual flag)

Quick Start

ccs cursor enable        # Enable in config
ccs cursor auth          # Auto-detect credentials from Cursor SQLite
ccs cursor start         # Start local daemon
ccs cursor status        # Verify everything is running
ccs cursor models        # List available models
On macOS and Linux, auto-detect requires sqlite3 in your PATH. Windows does not support auto-detect.

Authentication

CCS auto-detects credentials from Cursor’s local SQLite database.
PlatformSQLite Path
macOS~/Library/Application Support/Cursor/User/globalStorage/state.vscdb
Linux~/.config/Cursor/User/globalStorage/state.vscdb
WindowsManual only — see below
# Auto-detect (macOS/Linux)
ccs cursor auth

# Manual import
ccs cursor auth --manual --token <access-token> --machine-id <32-hex-id>
Credentials are stored at ~/.ccs/cursor/credentials.json (mode 0o600).
Auto-detect uses the sqlite3 CLI on macOS and Linux. If sqlite3 is missing, use manual import.
Token validation: access token must be >50 chars, machine ID must be exactly 32 hex characters. Tokens expire after 24h (or per JWT exp claim).

CLI Subcommands

SubcommandDescription
authImport token (auto-detect or --manual)
statusShow integration, auth, and daemon status
modelsList available models with 5-min cache
startStart local daemon
stopStop daemon gracefully
enableEnable integration in config.yaml
disableDisable integration in config.yaml
helpShow help

Configuration

# ~/.ccs/config.yaml
cursor:
  enabled: false # Must be true to use
  port: 20129 # Daemon port (default: 20129)
  auto_start: false # Auto-start daemon with CCS
  ghost_mode: true # Disable Cursor telemetry (recommended)
  model: gpt-5.3-codex # Default model
  opus_model: "" # Optional: override opus tier
  sonnet_model: "" # Optional: override sonnet tier
  haiku_model: "" # Optional: override haiku tier

Available Models

Model list is discovered dynamically from api2.cursor.sh/v1/models with a 5-minute TTL cache. The list below reflects typical available models, but may change as Cursor updates their offering.
GPT-5.3 Codex (default), GPT-5.2, GPT-5.1, GPT-5, GPT-5 Fast, GPT-5 Mini
Claude 4.6 Opus, Claude 4.5 Sonnet, Claude 4.5 Haiku
Gemini 3 Pro, Gemini 3 Flash, Gemini 2.5 Flash, Grok Code
Model fallback: If the requested model is unavailable in Cursor’s catalog, CCS falls back to the catalog-resolved default model for the current available model list and logs a debug message.

Dashboard Controls

Open ccs config, then navigate to Cursor IDE in the sidebar.
  • Import auth automatically or manually
  • Start/stop the daemon
  • Save runtime config (port, auto-start, ghost mode)
  • Use searchable model pickers for large live catalogs
  • Edit raw ~/.ccs/cursor.settings.json when needed

Daemon Management

The daemon spawns as a detached process and uses a settled-once pattern for startup — health is polled until the daemon signals ready or the timeout is reached (30s). Proper 413 (payload too large) responses are returned for oversized requests, and the daemon aborts cleanly on client disconnect. Daemon API surface:
  • POST /v1/chat/completions for OpenAI-compatible clients
  • POST /v1/messages for Anthropic-compatible clients
  • GET /v1/models for dynamic model discovery
PathPurpose
~/.ccs/cursor/credentials.jsonAuth credentials
~/.ccs/cursor/daemon.pidDaemon PID file
~/.ccs/cursor.settings.jsonSettings override
~/.ccs/config.yamlMain config (cursor: key)
Stop behavior: sends SIGTERM, waits 5s, escalates to SIGKILL if still running. Health check: GET /health — expects { "service": "cursor-daemon" } in response.

Dashboard API

The CCS dashboard exposes REST endpoints for managing the integration:
EndpointMethodPurpose
/api/cursor/statusGETDaemon + auth status
/api/cursor/auth/auto-detectPOSTImport from SQLite
/api/cursor/auth/importPOSTManual token import
/api/cursor/modelsGETList available models
/api/cursor/daemon/startPOSTStart daemon
/api/cursor/daemon/stopPOSTStop daemon
/api/cursor/settingsGET / PUTRead/write config

Troubleshooting

Ensure Cursor IDE has been launched and logged in at least once. The SQLite DB is only created after first login. On macOS/Linux, confirm sqlite3 is installed and in PATH. Try ccs cursor auth --manual if auto-detect continues to fail.
Check if port 20129 is in use: lsof -i :20129. Change cursor.port in config.yaml if needed, then restart with ccs cursor start.
Tokens expire every 24h. Re-run ccs cursor auth to refresh credentials from your local Cursor installation.
Auto-detect is not available on Windows. Use manual import:
ccs cursor auth --manual --token <token> --machine-id <id>
Find your token in Cursor’s developer tools or Keychain equivalent.