This guide explains how to deploy, run, and use Cursor CLI API Proxy on a server (for example, LNVPS).
| Item | Details |
|---|---|
| OS | Linux (Ubuntu / Debian, examples assume Ubuntu) |
| Node.js | v24.14.0 (Active LTS recommended, npm 10.x) |
| Cursor | Pro or Business subscription |
| Network | Client machines (Cursor IDE, etc.) can reach the server port |
# Ubuntu example (skip if already installed)
sudo apt update
sudo apt install -y nodejs npm
node -v # confirm v24.14.0 (or latest 24.x LTS)
npm -vcurl https://cursor.com/install -fsS | bashAfter installation, reload your shell or run source ~/.bashrc, then confirm that agent is available:
agent --versionRun this once on the server that will run the proxy:
agent loginIf a browser opens, that machine must have browser access.
For headless servers, you can also authenticate on another machine and copy the Cursor CLI auth files to the server (check official Cursor CLI docs for the exact file location).
Check authentication state:
agent statusGenerate an API key in Cursor Dashboard and pass it as an environment variable.
- Generate key: Cursor Dashboard > Integrations > User API Keys
- Set
CURSOR_API_KEYat startup (see section 2)
In the cloned repository:
cd /path/to/cursor-cli-api-proxy
npm install
npm run buildIf JavaScript files are generated under dist/, the build succeeded.
- By default, the proxy listens on port 3457.
- If clients are on different machines, open that port.
Example (ufw):
sudo ufw allow 3457/tcp
sudo ufw statuscd /path/to/cursor-cli-api-proxy
npm startOr:
node dist/server/standalone.js- By default it listens on
0.0.0.0:3457(reachable from other hosts). - To change the port, pass it as the first argument:
node dist/server/standalone.js 8080- To skip CLI/auth checks temporarily (for example, testing health endpoint first):
node dist/server/standalone.js 3457 --skip-cli-checkIn this mode, startup does not validate agent or authentication, so chat requests may still fail later.
cd /path/to/cursor-cli-api-proxy
nohup node dist/server/standalone.js 3457 > proxy.log 2>&1 &
echo $! # save PID, stop with: kill <PID>Example service file:
# /etc/systemd/system/cursor-cli-proxy.service
[Unit]
Description=Cursor CLI API Proxy
After=network.target
[Service]
Type=simple
User=ubuntu
WorkingDirectory=/home/ubuntu/cursor-cli-api-proxy
ExecStart=/usr/bin/node dist/server/standalone.js 3457
Restart=on-failure
RestartSec=5
# Keep this as-is for session auth. If using API key:
# Environment=CURSOR_API_KEY=your_key_here
[Install]
WantedBy=multi-user.targetEnable and start:
sudo systemctl daemon-reload
sudo systemctl enable cursor-cli-proxy
sudo systemctl start cursor-cli-proxy
sudo systemctl status cursor-cli-proxyView logs:
journalctl -u cursor-cli-proxy -fRun on the server, or from a client against SERVER_IP:3457:
# Health check
curl http://localhost:3457/health
# List models
curl http://localhost:3457/v1/models
# Chat (non-streaming)
curl -X POST http://localhost:3457/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "cursor-default",
"messages": [{"role": "user", "content": "Hello, reply in one word."}]
}'
# Chat (streaming)
curl -N -X POST http://localhost:3457/v1/chat/completions \
-H "Content-Type: application/json" \
-d '{
"model": "cursor-default",
"messages": [{"role": "user", "content": "Count from 1 to 3."}],
"stream": true
}'For remote access, replace localhost with the server IP or FQDN.
- Open Cursor Settings (Settings > Models or equivalent model settings screen).
- Add a custom model with these values:
| Field | Value |
|---|---|
| Display name | Any (example: Cursor Proxy) |
| baseUrl | http://<SERVER_IP_OR_FQDN>:3457/v1 |
| apiKey | Any string (ignored by this proxy; empty or not-needed works) |
| Model ID | cursor-default or cursor-opus / cursor-sonnet / cursor-haiku |
Example JSON:
{
"models": {
"cursor-proxy": {
"name": "Cursor (Proxy)",
"apiKey": "not-needed",
"baseUrl": "http://192.168.1.100:3457/v1",
"contextLength": 200000,
"temperature": 0.7
}
}
}Select that model and requests will route through this proxy while using your Cursor subscription.
For clients that speak OpenAI format API (for example Continue.dev or custom scripts), configure:
- Base URL:
http://<SERVER>:3457/v1 - API Key: any value (not validated by this proxy)
- model:
cursor-default/cursor-opus/cursor-sonnet/cursor-haiku
Example (Python):
from openai import OpenAI
client = OpenAI(
base_url="http://your-server:3457/v1",
api_key="not-needed"
)
r = client.chat.completions.create(
model="cursor-default",
messages=[{"role": "user", "content": "Hello"}]
)
print(r.choices[0].message.content)| model | Description |
|---|---|
| cursor-default | Default model |
| cursor-opus | Opus family |
| cursor-sonnet | Sonnet family |
| cursor-haiku | Haiku family |
Actual backend mapping depends on Cursor Agent CLI --model behavior.
| Symptom | Check / Fix |
|---|---|
| "Cursor Agent CLI not found" at startup | Confirm agent --version works, verify PATH, reinstall CLI if needed |
| "Not authenticated" at startup | Run agent status; if not logged in, run agent login or set CURSOR_API_KEY |
| Cannot connect | Confirm firewall allows 3457 and test curl http://<server>:3457/health from client |
| No chat response / timeout | Check whether agent is stuck on heavy work; inspect logs and agent status |
| Streaming stops immediately | Disable client-side buffering (-N for curl) |
For debugging, start with DEBUG=1 to emit request logs to stderr:
DEBUG=1 node dist/server/standalone.js 3457- Setup: Install Node.js and Cursor Agent CLI, authenticate (
agent loginorCURSOR_API_KEY), and build. - Run: Use
npm startornode dist/server/standalone.js [port]. For production, prefer a long-running service such assystemd. - Use: Verify
/healthand/v1/models, then point Cursor IDE or other clients tohttp://<server>:3457/v1with model IDs such ascursor-default.