Local CreateAgent fails via Python bridge - reproducing on cursor-sdk 0.1.6 (macOS, Python 3.12)

Where does the bug appear (feature/product)?

Cursor SDK

Describe the Bug

Python cursor-sdk fails on bridge RPCs with an opaque InternalServerError: internal: internal error (HTTP 500, empty details, no request_id). The bundled cursor-sdk-bridge starts normally, but service calls that touch agent/catalog APIs fail before any agent run begins.

Affected calls (minimal repro):

Cursor.models.list(api_key=…)
Agent.create(…, local=LocalAgentOptions(cwd=…)) (sync)
await client.agents.create(…, local=LocalAgentOptions(…)) via AsyncClient.launch_bridge() (async)
What still works:

Bridge health RPCs: Ping, GetVersion
Direct @cursor/sdk Agent.create() in Node on the same machine (local agent created and run completes)
In-process createAgent inside the bundled bridge (same payload) succeeds
The same createAgent request over Connect HTTP to the bridge returns 500
Error shape:

cursor_sdk.errors.InternalServerError: internal: internal error
(code=internal, status=500, is_retryable=False, details=, request_id=None)
HTTP response from bridge:

POST http://127.0.0.1:/sdk.v1.SdkAgentService/CreateAgent
→ 500 {“code”:“internal”,“message”:“internal error”}

Steps to Reproduce

Steps to reproduce:

Create a User API Key in Cursor Dashboard → Integrations.
pip install cursor-sdk==0.1.6
Run:
import asyncio, os
from cursor_sdk import AsyncClient, LocalAgentOptions
async def main():
async with await AsyncClient.launch_bridge(workspace=os.getcwd()) as client:
agent = await client.agents.create(
model=“composer-2.5”,
api_key=os.environ[“CURSOR_API_KEY”],
local=LocalAgentOptions(cwd=os.getcwd(), setting_sources=),
)
print(agent.agent_id)
await agent.close()
asyncio.run(main())
Actual: InternalServerError at create_agent before agent_id is returned.

Expected Behavior

Expected: CreateAgent returns a valid local agent_id; Cursor.models.list() returns available models. Failures should be actionable (401/403 with a clear message), not a generic 500 when the key is valid.

Operating System

MacOS

Version Information

python --version
Name: cursor-sdk
Version: 0.1.6

For AI issues: which model did you use?

composer-2.5

Does this stop you from using Cursor

Sometimes - I can sometimes use Cursor

Thanks for raising this!

First off, that opaque 500 is not great logging on our end. It’s swallowing the real error before it ever reaches you. I’ll raise it with the team.

My hunch is this is cert/SSL related. The SDK runs a bundled Node in a separate process, and Node doesn’t trust the macOS keychain by default, so behind a TLS-inspecting proxy, its HTTPS call to our backend can fail the cert check and surface as that generic 500 (which would also explain models.list() failing the same way).

To confirm, could you try running your script with TLS verification off (diagnostic only, don’t leave it on):

NODE_TLS_REJECT_UNAUTHORIZED=0 CURSOR_API_KEY=... python your_script.py

If the 500 goes away, that’s it — and the proper fix is to point Node at your org’s root CA: NODE_EXTRA_CA_CERTS=/path/to/corp-root-ca.pem.

Let us know either way!

@Colin Thanks for the response. It worked after turning off TLS.

Thanks for confirming!

As mentioned, pointing the bundled Node at your corporate root CA will clear this up for good — set NODE_EXTRA_CA_CERTS=/path/to/corp-root-ca.pem (a .pem file, not the disable-TLS flag) before running your script.

I’ll also raise a bug with the team for the bad error message. That opaque 500 should have surfaced the real cert failure!