Introduction¶
DeepSeek Harness (DSH) is a plugin-centric agent development framework that supports extending model capabilities through plugins. In local development scenarios, developers often already have the Cursor desktop application configured, but reusing Cursor’s models within DSH typically requires an additional API key or a complex middleware layer. The dsh-connect-cursor-pro plugin reverse-engineers Cursor’s internal protocol to directly expose locally logged-in Cursor models to DSH, eliminating the need for a separate API key.
Plugin Positioning¶
dsh-connect-cursor-pro is the Pro branch of the community plugin greatyao/dsh-connect-cursor, designed specifically for the DSH 0.2 kernel and newer versions of Cursor. Instead of using the official API, it communicates with Cursor’s servers by reverse-engineering the private agent.v1.AgentService/Run protocol (ConnectRPC + Protobuf + HTTP/2 bidirectional streaming). The plugin reads local Cursor login credentials (JWT), automatically decrypts state.vscdb or reads auth.json, and maps model lists, conversation state, image input, and file tool capabilities into DSH’s StreamChunk data structures.
Core Capabilities¶
- Zero-key startup: By default, the plugin reads local Cursor login and requires no manual API key configuration. Supported credential sources in priority order:
1.CURSOR_ACCESS_TOKENenvironment variable (JWT)
2. Desktopstate.vscdb(auto-decrypted)
3. CLIauth.json(plaintext JWT)
4.CURSOR_API_KEY(crsr_prefix, exchanged for a token viaauth/exchange_user_api_key) - Multi-turn conversation continuity: Reuses Cursor’s
conversation_stateto maintain context across turns within a session, rather than restarting each turn from scratch. - Image input: Forwards images from the Composer as
SelectedImagethrough the Run protocol to the Cursor model, supporting all models (including those markedsupports_images: falsein the Catalog). - File tools: Executes Cursor’s built-in
read/write/ls/shelltool calls within the DSH workspace, enabling agents to create, edit files, and run commands. - Automatic version detection: Reads Cursor’s
cursor-agentbuild tag (cli-YYYY.MM.DD-sha) asx-cursor-client-version, avoiding rejections caused by hardcoded versions. - Settings page: Provides a “Connect Cursor” page displaying credential status, model catalog, diagnostic information, and a one-click refresh function.
Installation and Enablement¶
After cloning the plugin directory from GitHub, install it using the following command:
dsh plugin --profile web add /path/to/dsh-connect-cursor-pro
Or in the DSH UI: Plugins → Add plugin, then select the directory. After installation, a cursor group will appear in the model selector (requires restarting DSH or refreshing the UI).
Credential Configuration¶
Automatic Credential Reading¶
- Desktop app logged in: Automatically reads
state.vscdb(encrypted in Cursor 3.27+, the plugin decrypts it automatically) - CLI logged in: Automatically reads
auth.json
Manual Credential Configuration¶
When no local login exists (remote, headless, or CI scenarios) or when switching accounts, configure via the following methods:
- Settings page: Navigate to Settings → Connect Cursor → Credentials (optional), fill in
CURSOR_ACCESS_TOKENorCURSOR_API_KEY, and save. - Environment variables: Set the system/user environment variable
CURSOR_ACCESS_TOKENorCURSOR_API_KEY, then completely quit and restart DSH.
Credentials are JWTs with an exp expiration time and must be re-obtained once expired. API keys use the crsr_ prefix, and the plugin exchanges them for short-lived tokens via auth/exchange_user_api_key.
Obtaining Credentials¶
- JWT: Copy
accessTokenfrom the CLIauth.json, or obtainAuthorization: Bearer <JWT>from requests on cursor.com via browser DevTools. - API key: Generate a
crsr_prefixed key from the Cursor account dashboard.
Typical Usage¶
In DSH, the model selector will display a cursor group listing the model catalog for the current account. After selecting a model, the agent can converse using Cursor’s models, supporting multi-turn context and file operations. For image input, simply upload an image in the Composer, and the plugin forwards it to the model.
Use Cases and Caveats¶
- Ideal for developers who already have Cursor desktop or CLI login and want to reuse local models without an additional API key.
- Suitable for scenarios requiring Cursor model integration, image input, and file tools within DSH.
- The plugin runs with the current DSH process permissions and reads local Cursor login credentials (JWT). Ensure your environment is secure.
- The protocol is reverse-engineered and unofficial. Cursor updates may change the wire format or field numbers, causing the plugin to malfunction or behave unexpectedly.
- Plugin calls to Cursor’s servers consume account quota. Use within the scope of Cursor’s Terms of Service.
- The plugin marketplace (DSHX) does not audit plugin behavior. Review the source code and license (MIT) before use.
Summary¶
dsh-connect-cursor-pro reverse-engineers Cursor’s internal protocol to directly connect locally logged-in Cursor models to DSH, enabling zero-key startup, multi-turn conversation, image input, and file tool capabilities. The plugin is well-adapted to the DSH 0.2 kernel and provides a settings page for management and diagnostics. When in use, be mindful that the protocol is unofficial, credential security is important, and quota consumption applies. It is well-suited for reusing Cursor models in local development scenarios.