dsh-connect-cursor
Manifest validConnects 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 str
dsh-connect-cursor
把本机已登录的 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
Comments
Loading…
Similar plugins
by NinjaSln-labs
DeepSeek Harness 插件:Cursor-as-subagent 提供方——一次本地 @cursor/sdk one-shot 运行、摘要优先结果、可无人值守的 Profile Bundle
★ 0
↓ 353/wk
MIT
TypeScript
Oct 2, 2026
dsh plugin --profile web add dsh-subagent-cursorby TBChaos
把本机 / WSL / 虚拟机 / SSH 远端上另一套 DSH 的 WebUI 镜像进桌面版 DSH,用同一套界面和体验管理它们。DSH 插件,MIT。
★ 0
MIT
TypeScript
Oct 17, 2026
dsh plugin --profile web add dsh-remote-desksby webkubor
给 DSH 模型页补上官方适配器缺的那半:网关可达性探测、模型目录拉取、DeepSeek 余额常驻。零运行时依赖,不改动 DSH 安装。
★ 50
↓ 21/wk
MIT
JavaScript
Oct 12, 2026
dsh plugin --profile web add dsh-llm-hubby donoteatme
Browser-first, LAN-only access to the current DeepSeek Harness Web UI with one-time QR pairing, revocable devices, event-driven diagnostics, and a slot-preserving mobile layout; no companion app, clou
★ 1
↓ 588/wk
MIT
TypeScript
Sep 12, 2026
dsh plugin --profile web add dsh-local-linkby whitefirer
dsh(DeepSeek Harness)插件:让 agent 读写浏览器所在机器的本地文件——File System Access 授权 + WS 中继,含非安全上下文兼容模式
★ 4
↓ 204/wk
MIT
JavaScript
Aug 23, 2026
dsh plugin --profile web add dsh-browser-fsA dsh web plugin that wraps the running Harness in a native Windows desktop window: it bundles a Wails v3 desktop client (so installing the plugin is enough), probes the web port and writes the ~/.dsh
★ 1
↓ 430/wk
NOASSERTION
JavaScript
dsh plugin --profile web add @zerorigin-studio/dsh-desktop-shell