cursor opens a cookbook for its agent sdk
TL;DR: cursor published a repository with examples for @cursor/sdk — a typescript wrapper around their coding agent. The sdk runs the agent locally (reading files from disk) or in a cloud vm with a cloned repository, streams run events, and supports model selection, cancellation, mcp, and persistent conversation state across runs. The cookbook ships four examples: quickstart, a prototyping tool, a kanban for cloud agents, and a terminal launcher.
What is in the repository
- quickstart — a minimal node script: create a local agent, send a request, iterate over the event stream.
- prototyping tool — a web app for scaffolding projects and iterating in a cloud sandbox.
- kanban board — an interface for browsing cloud agents grouped by status or repository, plus creating new ones.
- coding agent cli — running agents from the terminal.
sdk in short
npm install @cursor/sdk
import { Agent } from "@cursor/sdk";
const agent = await Agent.create({
apiKey: process.env.CURSOR_API_KEY!,
model: { id: "composer-2" },
local: { cwd: process.cwd() },
});
const run = await agent.send("Summarize what this repository does");
for await (const event of run.stream()) {
console.log(event);
}
The CURSOR_API_KEY comes from the cursor dashboard. One interface for three runtimes: local node, cursor cloud, self-hosted cloud. A single run is the unit of work for one prompt; the agent keeps context between them. There is Cursor.models.list(), run cancellation that aborts in-flight tool calls, and mcp servers (via inline config, a file, or the cursor dashboard).
Context
The cookbook ships against the backdrop of cursor’s broader pivot to agents as a first-class primitive: in april 2026 they shipped cursor 3 with an agent-first interface — parallel agents across repositories and environments, durable canvases in the side panel. In march came cursor automations — agent triggers from a commit, a slack message, or a timer. The sdk is the logical next step: what a button does inside the editor can now be invoked from ci, scripts, and third-party apps.
The closest comparisons are claude agent sdk and openai’s assistants/agents api. Cursor’s distinction is the primary binding to code and repositories: the cloud runtime clones the repository into an isolated vm, the local one reads the working directory. This fits batch tasks over a codebase (refactors, lint auto-fixes, generating a pr from a ticket) where the agent needs a real workspace, not just textual context.