Cursor Introduces a TypeScript SDK for Building Programmatic Coding Agents With Sandboxed Cloud VMs, Subagents, Hooks, and Token-Based Pricing
Cursor, the AI-powered code editor, is opening up the core know-how behind its coding brokers to builders in every single place. The Cursor staff introduced the general public beta of the Cursor SDK — a TypeScript library that offers engineers programmatic entry to the identical runtime, harness, and fashions that energy Cursor’s desktop app, CLI, and internet interface.
This indicators a significant shift in how AI coding instruments are being positioned: not simply as interactive assistants sitting alongside a developer, however as deployable infrastructure that organizations can wire into their present methods.
From Interactive Tool to Programmable Infrastructure
If you’ve used Cursor earlier than, you already know it as an IDE the place you work together with an agent in actual time — asking it to jot down features, repair bugs, or clarify code. The Cursor SDK adjustments the entry mannequin. Instead of a developer sitting at a keyboard, the agent can now be invoked programmatically: from a CI/CD pipeline set off, a backend service, or embedded instantly inside one other product.
Think of it this fashion: beforehand, you needed to be “in” Cursor to make use of its brokers. Now, you’ll be able to name those self same brokers from wherever in your stack with a few traces of TypeScript.
Getting began is a single command:
npm set up @cursor/sdk
From there, you create an Agent occasion, ship it a activity, and stream the response again — all in TypeScript. Here’s the minimal instance from Cursor’s announcement:
import { Agent } from "@cursor/sdk";
const agent = await Agent.create({
apiKey: course of.env.CURSOR_API_KEY!,
mannequin: { id: "composer-2" },
native: { cwd: course of.cwd() },
});
const run = await agent.ship("Summarize what this repository does");
for await (const occasion of run.stream()) {
console.log(occasion);
}
The Agent.create() name accepts an apiKey, a mannequin area (the place you specify which mannequin to run), and both a native or cloud configuration relying on the place you need execution to occur.
Why Building Your Own Agent Stack is Hard
Before diving into what the SDK presents, it’s price understanding the issue it solves. Building quick, dependable, and succesful coding brokers that run safely in opposition to your knowledge requires significant engineering effort: safe sandboxing, sturdy state and session administration, setting setup, and context administration. And when a new mannequin ships, dev groups usually have to remodel their agent loops fully simply to make the most of it. The Cursor SDK eliminates this complexity so groups can concentrate on constructing helpful brokers as a substitute of sustaining the underlying infrastructure.
The Agent Harness: What “Same Runtime” Actually Means
SDK brokers use the identical harness that powers Cursor’s personal merchandise. ‘Harness’ right here refers back to the full set of supporting infrastructure that makes an agent efficient past simply the LLM name itself. In Cursor’s case, that features:
Intelligent context administration — Codebase indexing, semantic search, and prompt grep so brokers retrieve the correct code context earlier than producing responses. This is important as a result of LLMs are solely pretty much as good because the context they obtain; poor retrieval results in hallucinated or irrelevant outputs.
MCP servers — Agents launched by means of the SDK can connect with exterior instruments and knowledge sources over stdio or HTTP, both through a .cursor/mcp.json config file or handed inline within the API name. MCP (Model Context Protocol) is an open commonplace for wiring instruments into agent runtimes.
Skills — Agents mechanically decide up reusable habits definitions from a .cursor/abilities/ listing within the repository.
Hooks — A .cursor/hooks.json file permits you to observe, management, and prolong the agent loop throughout cloud, self-hosted, and native runtimes — helpful for logging, guardrails, or customized orchestration.
Subagents — The most important agent can delegate subtasks to named subagents with their very own prompts and fashions through the Agent instrument, enabling multi-agent workflows with out customized orchestration code.
Cloud Deployment: Persistent, Sandboxed, and Resumable
One of the extra sensible options of the SDK is cloud execution. When configured to run in Cursor’s cloud, every agent will get its personal devoted VM with sturdy sandboxing, a clone of the goal repository, and a totally configured improvement setting. Critically, the agent retains operating even when the initiating machine goes offline — the developer can reconnect and stream the dialog later.
Cloud brokers combine with Cursor’s present Agents Window and internet app, so a activity began programmatically through the SDK might be inspected or taken over manually contained in the Cursor interface. When the agent finishes, it could actually open a PR, push a department, or connect demos and screenshots — making them appropriate for asynchronous, unattended workflows:
const agent = await Agent.create({
apiKey: course of.env.CURSOR_API_KEY!,
mannequin: { id: "gpt-5.5" },
cloud: {
repos: [{ url: "https://github.com/cursor/cookbook", startingRef: "main" }],
autoCreatePR: true,
},
});
const run = await agent.ship("Fix the auth token expiry bug");
console.log(`Started ${run.id}`);
// ...test again in later, from wherever:
const outcome = await (
await Agent.getRun(run.id, { runtime: "cloud", agentId: run.agentId })
).wait();
console.log(outcome.git?.branches[0]?.prUrl);
For dev groups with safety necessities, the SDK additionally helps self-hosted employees, the place each code and instrument execution stay contained in the group’s personal community.
Model Flexibility and Composer 2
The SDK exposes each mannequin supported in Cursor. Switching fashions is a single area change within the mannequin parameter, letting groups route duties to the perfect mannequin for a given mixture of price and functionality. Cursor’s personal Composer 2 — described as a specialised coding mannequin attaining frontier-level efficiency at a fraction of the price of general-purpose fashions — is positioned because the default advice for most coding agent duties.
Getting Started
To speed up adoption, Cursor has revealed a public cookbook repository on GitHub with 4 starter tasks: a minimal quickstart (a Node.js instance that creates a native agent, sends one immediate, and streams the response), a web-based prototyping instrument for scaffolding new tasks in a sandboxed cloud setting, an agent-powered kanban board that mechanically opens PRs when engineers drag a card, and a light-weight coding agent CLI for spawning Cursor brokers from the terminal.
Cursor has additionally launched a Cursor SDK plugin within the Cursor Marketplace to assist builders begin constructing instantly from inside the editor.
Key Takeaways
- Cursor SDK is now in public beta — Cursor has launched a TypeScript SDK (
npm set up @cursor/sdk) that offers builders programmatic entry to the identical runtime, harness, and fashions that energy the Cursor desktop app, CLI, and internet interface. - Eliminates the arduous elements of constructing coding brokers — Teams now not have to engineer safe sandboxing, sturdy state and session administration, setting setup, and context administration from scratch — and gained’t want to remodel agent loops each time a new mannequin ships.
- Runs domestically or on Cursor’s cloud — Agents can execute on a developer’s native machine for quick iteration, on Cursor’s cloud in opposition to a devoted VM with sturdy sandboxing, or on self-hosted employees for groups with strict community safety necessities.
- Full harness included out of the field — SDK brokers inherit Cursor’s full infrastructure: clever context administration (codebase indexing, semantic search, prompt grep), MCP server assist, Skills, Hooks, and Subagents — the identical stack powering Cursor’s personal merchandise.
Check out the Cookbook and Technical details. Also, be happy to observe us on Twitter and don’t overlook to hitch our 130k+ ML SubReddit and Subscribe to our Newsletter. Wait! are you on telegram? now you can join us on telegram as well.
Need to companion with us for selling your GitHub Repo OR Hugging Face Page OR Product Release OR Webinar and many others.? Connect with us
The submit Cursor Introduces a TypeScript SDK for Building Programmatic Coding Agents With Sandboxed Cloud VMs, Subagents, Hooks, and Token-Based Pricing appeared first on MarkTechPost.
