Guide
Cursor SDK Agents Guide
Cursor's June 2026 SDK update added TypeScript and Python support for custom tools, local auto-review, JSONL and custom stores, nested subagents, request IDs and reliability fixes for local and cloud agent apps.
On this page
- What changed in Cursor SDK, June 2026?
- How should a team use Cursor SDK agents?
- What should stay bounded?
- Who can use the SDK, and how far does it reach?
- Should I use the Python SDK or the TypeScript SDK?
- Which API key should an SDK agent carry?
- Does the local runtime keep code away from hosted models?
- Which SDK version do I need to pin?
- When is the SDK the wrong choice?
What changed in Cursor SDK, June 2026?
Cursor's June 2026 SDK update added TypeScript and Python support for custom tools, local auto-review, JSONL and custom stores, nested subagents, request IDs and reliability fixes for local and cloud agent apps.
- Release fact
- Custom tools
- Why it matters
local.customToolsexposes your functions through the built-incustom-user-toolsMCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. server.
- Release fact
- Auto-review
- Why it matters
local.autoReviewroutes local tool calls through a classifier rather than bypassing review.
- Release fact
- Stores
- Why it matters
- SQLite, JSONL and custom
LocalAgentStorechoices support durable agent state.
- Release fact
- Nested subagents
- Why it matters
- Custom tools are visible through subagents and subagents can nest for delegated work.
- Release fact
- Request IDs
- Why it matters
- Run metadata can carry request IDs for support and debugging.
| Release fact | Why it matters |
|---|---|
| Custom tools | local.customTools exposes your functions through the built-in custom-user-tools MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. server. |
| Auto-review | local.autoReview routes local tool calls through a classifier rather than bypassing review. |
| Stores | SQLite, JSONL and custom LocalAgentStore choices support durable agent state. |
| Nested subagents | Custom tools are visible through subagents and subagents can nest for delegated work. |
| Request IDs | Run metadata can carry request IDs for support and debugging. |
As of July 9, 2026. See the linked Cursor sources for the latest details.
This exact topic is a hands-on lesson: SDK Quickstart in TypeScript and Python — about 5 minutes, free to read.
How should a team use Cursor SDK agents?
Knowing what shipped is the easy part. Turning Cursor SDK agents into something a team relies on takes a few deliberate steps, mapped below.
- 1Define one SDK agent job with explicit input, output and owner.
- 2Expose only the product functions the job needs as custom tools.
- 3Choose SQLite, JSONL or a custom store based on audit and retention needs.
- 4Use auto-review and request IDs so headless runs stay inspectable.
What should stay bounded?
New capability comes with new ways to get it wrong. Keep these boundaries in place as you adopt it.
Validate custom-tool inputs as if the model were an untrusted caller.
Do not persist secrets or full transcripts when a summary is enough.
Use auto-review as a gate, not as proof that a human review is unnecessary.
Who can use the SDK, and how far does it reach?
You do not need an enterprise license - and generally not even a seat - to use the Agent SDKA programmatic interface for running Cursor agents from your own scripts, services or CI, locally or in the cloud. Press Enter for the full definition.. Anyone, personal or enterprise, can generate a Cursor API key, which is what you embed to run an SDK agent.
For enterprise teams it depends on the contract, but usage generally draws from the team's pooled usage. Confirm specifics with your account manager.
It is not just for coding
Because the SDK is just an agent you program, teams build non-coding agents on it across finance, legal, support, design and security. A concrete example: a security-questionnaire app where you upload the questionnaire and it spawns a cloud agent that does a first pass using the company's security docs, privacy policies and trust-center content - getting pretty far and saving a lot of time.
Chaining agents and custom UIs
A prototype software factory that chains specialised agents - plan, then design, then build, then review - into an assembly line with clean handoffs between each stage.
Embed the SDK under your own interface. A favorite example is a Kanban board that shows status across many cloud agents, with custom dashboards, reports and alerting on top.
Should I use the Python SDK or the TypeScript SDK?
Use the language that fits the system calling the agent. Cursor documents both Python and TypeScript SDKs against the same agent runtime, so the bigger decision is runtime placement: local files, Cursor-hosted cloud or a self-hosted cloud pool.
- SDK/runtime choice
- Python SDK
- Use it when
- A data, infra or internal-tools service already runs in Python and wants sync, async or streamed agent calls.
- SDK/runtime choice
- TypeScript SDK
- Use it when
- A Node app, CI bot, dashboard or product workflow needs to call Cursor's agent from TypeScript.
- SDK/runtime choice
- Local runtime
- Use it when
- The caller has a working tree on disk and the job is a dev script or CI check.
- SDK/runtime choice
- Cursor-hosted cloud
- Use it when
- The caller should not keep the repo locally, many agents need to run in parallel or the run must survive disconnection.
- SDK/runtime choice
- Self-hosted cloud
- Use it when
- The same cloud-agent shape is needed, but code, secrets or build artifacts must stay in your environment.
| SDK/runtime choice | Use it when |
|---|---|
| Python SDK | A data, infra or internal-tools service already runs in Python and wants sync, async or streamed agent calls. |
| TypeScript SDK | A Node app, CI bot, dashboard or product workflow needs to call Cursor's agent from TypeScript. |
| Local runtime | The caller has a working tree on disk and the job is a dev script or CI check. |
| Cursor-hosted cloud | The caller should not keep the repo locally, many agents need to run in parallel or the run must survive disconnection. |
| Self-hosted cloud | The same cloud-agent shape is needed, but code, secrets or build artifacts must stay in your environment. |
Pick the SDK by caller language; pick the runtime by where the code and artifacts are allowed to live.
Which API key should an SDK agent carry?
Decide that before you write the agent, because the key decides whose budget the run lands on. User API keys and service-account keys both work for local and cloud runs. A user key bills to that person's plan; a service-account key, created in team settings, bills to the team that owns it. Team Admin API keys are not supported yet.
So the question is not really about authentication. Reuse whichever key was nearest and a nightly job quietly spends against one engineer's allowance for a month, which nobody notices until that engineer runs out of room mid-afternoon.
SDK spend does show up, and it shows up under the SDK tag in the team usage dashboard. Worth knowing that it draws on the same pricing, request pools and Privacy ModeCursor's setting that guarantees code data is not used for training by Cursor or its model providers, and that an admin can enforce org-wide; data-retention terms are a separate, contractual layer. Press Enter for the full definition. rules as a run started from the editor. A script that iterates over a hundred files is competing with your own developers for the same pool.
Which is the argument for setting the spend limit first. The keys do not consume a paid seat, so the usual gate of asking someone for a licence never happens here.
Does the local runtime keep code away from hosted models?
No. Cursor is explicit about this because the word invites the other reading: local describes where the agent loop and filesystem access run, not where the model runs. All inference goes through Cursor's hosted models in both local and cloud modes.
That matters most for the people least likely to read the SDK docs. If a security reviewer has written down that no code leaves your infrastructure for inference, the local runtime does not satisfy it, and picking local because the name sounded right is the sort of mistake that gets discovered late in a review rather than early in a design.
The self-hosted cloud option is about where code, secrets and build artifacts live. Inference still calls out to external model providers there, exactly as the desktop app calls a provider API, so a private worker is a different guarantee rather than a stronger version of the same one.
The runtime choice is honestly easier once you stop treating it as a privacy control. Local is for a caller that already has the working tree, cloud is for a caller that should not keep the repo or needs runs to survive a disconnect, and the SDK reference has the rest of the mechanics.
Which SDK version do I need to pin?
Whichever one shipped the capability you are relying on, which is a duller answer than it sounds. The npm package requires Node.js 22.13 or later and its name starts with an @, so @cursor/sdk; the bare cursor/sdk does not exist. The Python package on PyPI needs Python 3.10 or later.
Per-run token counts are the clearest case. They have existed since 1.0.22 in TypeScript and 1.0.23 in Python, so any cost-attribution script you write has that as its floor. Bun support arrived in stages too: a clean import in 1.0.20, running agents in 1.0.21, no stalled streams in 1.0.23.
There is one wrinkle to know about before you copy a version out of the docs. Cursor's TypeScript page describes the current package as 1.0.23 while the newest changelog entry is 1.0.24, so the prose and the changelog disagree. Check the registry rather than either page.
Pin it. A general claim that some runtime works is not the same as knowing which release made it work.
When is the SDK the wrong choice?
More often than the enthusiasm suggests. If the job is a schedule or an event Cursor already triggers on, an automation covers it with no code for you to own: cron, a GitHub event, a Slack message, a Linear issue, a PagerDuty incident, or a webhook carrying whatever payload you like. That last one absorbs a lot of what people reach for the SDK to do.
The SDK earns its place when the caller is your own software. You want the run's events inside your own interface, its state in your own store, or an agent that something in your product starts. That is where I would draw the line. It moves as the trigger list grows, I will admit.
Fewer moving parts is a feature when the thing moving is an agent.
Frequently asked questions
Who is this guide for?
AI engineers and platform teams building internal tools, CI agents or product workflows on the Cursor SDK.
What should I do next?
Start with one real repo task, capture the prompt and review the result before scaling the workflow.
Do I need a Cursor seat to use the Agent SDK?
Generally no. Anyone can generate a Cursor API key without an enterprise license or even a seat. For enterprise teams it depends on the contract, but SDK usage typically draws from the team's pooled usage - confirm with your account manager.
Sources & last verified
- Cursor changelog: SDK custom stores, tools and auto-review
- Cursor Python SDK
- Cursor TypeScript SDK
- Cursor CLI overview
- Cursor changelog
Cursor ships frequently. Facts verified against primary sources on July 9, 2026.
Keep reading
Rather do it than read about it? Run 11 interactive Cursor walkthroughs in a simulated editor. Free, no account needed.