`@cursor/sdk` local Agent fails under pnpm due to missing `@connectrpc/connect-node` dependency

Where does the bug appear (feature/product)?

Cursor SDK

Describe the Bug

@cursor/[email protected] local Agent runs fail under pnpm because @connectrpc/connect-node is imported at runtime but is not installed as a runtime dependency of @cursor/sdk.

Steps to Reproduce

  1. Create a pnpm project that depends on @cursor/[email protected].
  2. Run a local Agent and call agent.send().
  3. The run fails with:

Cannot find package @connectrpc/connect-node imported from .../node_modules/@cursor/sdk/dist/esm/index.js

  1. Adding the latest @connectrpc/[email protected] is not a clean workaround, because it pulls @connectrpc/[email protected] and then fails against @bufbuild/[email protected] with a codegenv2 export error.
  2. Adding @connectrpc/[email protected] works around the issue.

Expected Behavior

@cursor/sdk should declare @connectrpc/connect-node as a runtime dependency or optional dependency when it is imported at runtime, so local Agent runs work in strict package-manager environments such as pnpm without consumers adding undeclared transitive dependencies manually.

Operating System

Windows 10/11

Version Information

@cursor/sdk: 1.0.19
Package manager: pnpm
Node.js: 24.17.0
Runtime: local Agent

For AI issues: which model did you use?

N/A - this fails before model behavior is relevant.

For AI issues: add Request ID with privacy disabled

N/A - the failure occurs locally during agent.send() dependency loading.

Additional Information

Workaround: pnpm add @connectrpc/[email protected]

This looks like a package dependency declaration issue rather than an application-level peer dependency requirement.

Does this stop you from using Cursor

No - Cursor works, but with this issue

Hey, thanks for the detailed report, your diagnosis is correct. The published @cursor/[email protected] really does not declare @connectrpc/connect-node as a dependency, not in dependencies or optionalDependencies, even though it’s needed at runtime. With npm this often gets hidden because of flat hoisting, but pnpm with strict node_modules fails, which is what you hit.

Your workaround is correct, I’d stick to the 1.x line:

pnpm add @connectrpc/[email protected]

2.x pulls in @connectrpc/[email protected] and breaks with the pinned @bufbuild/[email protected], so 1.7.0 is the right choice.

This is a bug on our side, I reported it internally. I can’t share an ETA for the fix yet, but I’ll reply in the thread once there’s an update.