AI EngineerGuide

Cursor SDK

by Ashik Nesin Ashik Nesin

Cursor has now has SDK which you can wire it up with your apps to build agentic flows easily.

Under the hood it uses same agentic harness that powers the Cursor IDE

How to get started?

Just install the package

npm install @cursor/sdk

And then use it like this

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(JSON.stringify(event, null, 4));
}

Make sure to set the CURSOR_API_KEY env variable as well.

2026-04-29-at-23.50.242x.png

They’ve published cookbooks as well which you can use as reference as well.

Reference

Stay Updated

Get the latest AI engineering insights delivered to your inbox.

No spam. Unsubscribe at any time.