Connects a locally-signed-in Cursor desktop app to dsh as a native LlmAdapter — reads the Cursor login token from state.vscdb or auth.json, drives the private agent.v1.AgentService/Run HTTP/2 bidi stream, and translates InteractionUpdate deltas into dsh StreamChunks. No loopback proxy. macOS, Windows and Linux.
Install
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:greatyao/dsh-connect-cursor
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
This plugin publishes its README in Chinese only.
把本机已登录的 Cursor 桌面应用的模型接入 DeepSeek Harness(dsh),在 dsh 的模型选择器里直接使用 Cursor 账号能调用的模型。
非官方。逆向自 Cursor 的
agent.v1.AgentService/Run私有协议(ConnectRPC + Protobuf + HTTP/2 双向流),与 Cursor(Ansysphere)、DeepSeek 均无关联。仅供个人学习研究。
工作原理
- 读 Cursor 桌面应用的登录态(
state.vscdb里的 JWT),不启动额外 OAuth - 通过 HTTP/2 双向流调用
agent.v1.AgentService/Run,用原生LlmAdapter把 Cursor 的流式增量翻成 dsh 的StreamChunk(不走 loopback 代理) - 模型目录通过
AvailableModelsunary 调用实时拉取
凭据来源(按优先级)
CURSOR_ACCESS_TOKEN环境变量- 桌面应用
state.vscdb(SQLite,需 Node 22.5+ 内置node:sqlite) - CLI 的
auth.json(macOS/Linux~/.config/cursor/,Windows%APPDATA%\Cursor\) CURSOR_API_KEY(crsr_开头,换取短期 token)
均为只读,不写入桌面应用文件。JWT 约 1 小时有效,由运行中的桌面应用刷新;过期时重新打开 Cursor 即可。
已知限制
- 协议私有、版本门控:
x-cursor-client-version过期会被上游以误导性限流错误拒绝,用CURSOR_CLI_VERSION跟一个真实 CLI 版本号 model_details.model_id必须是默认 variant 的 slug(如claude-sonnet-5-thinking-high),基础 id 会被拒为ERROR_BAD_MODEL_NAMEUserMessageAction必须带request_context(缺了服务端只发心跳不产出)lib/schema.js从 Cursor 自带的workbench.desktop.main.js提取 protobuf schema(约 800 个类型),供 Cursor 升级后重新核对字段号;编码本身不依赖它- token 用量统计:Cursor 不总发
turn_ended,usage可能为空
安装
dsh plugin --profile web add github:greatyao/dsh-connect-cursor
安装后重启 dsh,模型选择器出现 cursor 分组。
开发
node --test test/*.test.js # 46 个单测
平台支持
macOS / Windows / Linux。插件按平台探测 Cursor 桌面应用的安装位置:
- macOS:
/Applications/Cursor.app/Contents/Resources/app - Windows:
%LOCALAPPDATA%\Programs\cursor\resources\app - Linux:
/usr/share/cursor/resources/app、/opt/Cursor/resources/app
非默认安装位置用 CURSOR_APP_PATH 指向应用根目录,或用 CURSOR_WORKBENCH_BUNDLE 直接指向 workbench.desktop.main.js。
凭据按平台读取:macOS ~/Library/Application Support/Cursor/User/globalStorage/state.vscdb、Windows %APPDATA%\Cursor\User\globalStorage\state.vscdb、Linux ~/.config/Cursor/User/globalStorage/state.vscdb。需 Node 22.5+(内置 node:sqlite)。
Windows 上未实测;如遇问题请提 issue。
免责声明
仅供个人学习研究使用。使用者需遵守 Cursor 的服务条款,因使用本项目产生的后果由使用者自行承担。
许可证
MIT
Links
More in this category
Ebony-Vinyl/dsh-our-free-model★ 92328
Adds free model lanes to DeepSeek Harness — DeepSeek V4.1 Flash, Kimi K3 and others — with no login, sign-up or API key, plus a local OpenAI-compatible gateway, fallback routing and a usage dashboard.
dingminhua/dsh-connect-workbuddy★ 2184
Connects locally signed-in WorkBuddy models, CN and international alike, to DSH, reading each model's credit multiplier from the upstream catalog on every refresh, with per-model image input toggles, account switching backed by an auto-failing-over pool, manual daily check-in, and read-only credit overviews shown as compact pills on the card and in the composer.
Alice-Marx/dsh-model-router★ 1032
Routes DeepSeek Harness work across configured model APIs and supported vendor CLIs with dependency-aware packages and cost previews.
V1ki/dsh-plugin-subscriptions★ 653
Use ChatGPT (Codex), Claude, and Grok subscriptions as DeepSeek Harness LLM providers, with Settings login, model catalogs, usage, plus image_generate, video_generate, and x_search tools.
XDTrees/dsh-workbuddy-xdpool★ 650
Merge every locally signed-in WorkBuddy account into DeepSeek Harness as one auto-failing-over model pool (multi-account rotation, live credits, and a model catalog showing per-model credit multipliers and free/night-discount tags).
XDTrees/dsh-xdpool★ 650
Merge every locally signed-in WorkBuddy account into DeepSeek Harness as one auto-failing-over model pool: multi-account rotation, 429 cooldowns, live credits, a model catalog with per-model credit multipliers and free/night-discount tags, QR-code login for 13 vendors, and aggregate free-tier channels. Accounts persist across restarts.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.