Cursor, the AI-powered code editor, is opening up the core technology behind its coding agents to developers everywhere. The Cursor team announced the public beta of the Cursor SDK — a TypeScript library that gives engineers programmatic access to the same runtime, harness, and models that power Cursor’s desktop app, CLI, and web interface.
This signals a meaningful shift in how AI coding tools are being positioned: not just as interactive assistants sitting alongside a developer, but as deployable infrastructure that organizations can wire into their existing systems.
From Interactive Tool to Programmable Infrastructure
If you’ve used Cursor before, you know it as an IDE where you interact with an agent in real time — asking it to write functions, fix bugs, or explain code. The Cursor SDK changes the access model. Instead of a developer sitting at a keyboard, the agent can now be invoked programmatically: from a CI/CD pipeline trigger, a backend service, or embedded directly inside another product.
Think of it this way: previously, you had to be “in” Cursor to use its agents. Now, you can call those same agents from anywhere in your stack with a few lines of TypeScript.
Getting started is a single command:
From there, you create an Agent instance, send it a task, and stream the response back — all in TypeScript. Here’s the minimal example from Cursor’s announcement:
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 Agent.create() call accepts an apiKey, a model field (where you specify which model to run), and either a local or cloud configuration depending on where you want execution to happen.
Why Building Your Own Agent Stack is Hard
Before diving into what the SDK offers, it’s worth understanding the problem it solves. Building fast, reliable, and capable coding agents that run safely against your data requires meaningful engineering effort: secure sandboxing, durable state and session management, environment setup, and context management. And when a new model ships, dev teams often have to rework their agent loops entirely just to take advantage of it. The Cursor SDK eliminates this complexity so teams can focus on building useful agents instead of maintaining the underlying infrastructure.
The Agent Harness: What “Same Runtime” Actually Means
SDK agents use the same harness that powers Cursor’s own products. ‘Harness’ here refers to the full set of supporting infrastructure that makes an agent effective beyond just the LLM call itself. In Cursor’s case, that includes:
Intelligent context management
— Codebase indexing, semantic search, and instant grep so agents retrieve the right code context before generating responses. This is critical because LLMs are only as good as the context they receive; poor retrieval leads to hallucinated or irrelevant outputs.
MCP servers
— Agents launched through the SDK can connect to external tools and data sources over stdio or HTTP, either via a .cursor/mcp.json config file or passed inline in the API call. MCP (Model Context Protocol) is an open standard for wiring tools into agent runtimes.
Skills
— Agents automatically pick up reusable behavior definitions from a .cursor/skills/ directory in the repository.
Hooks
— A .cursor/hooks.json file lets you observe, control, and extend the agent loop across cloud, self-hosted, and local runtimes — useful for logging, guardrails, or custom orchestration.
Subagents
— The main agent can delegate subtasks to named subagents with their own prompts and models via the Agent tool, enabling multi-agent workflows without custom orchestration code.

Top comments (0)