How Notion used the Cursor SDK to embed coding agents · Cursor

Peter Bubenik · Cursor · · Source
How Notion used the Cursor SDK to embed coding agents · Cursor

I'll teach you the concepts from this article step by step, building from foundational ideas to more complex ones.


Concept 1: What is an AI Coding Agent?

An AI coding agent is a software program powered by AI that can autonomously perform coding tasks from start to finish.

Think of it like hiring a developer who can:

  • Read a task description
  • Plan how to solve it
  • Write the code
  • Test it
  • Submit it for review (a Pull Request / PR)

Key word: autonomous — it does this on its own, without you writing every line.


Concept 2: The Problem with Building Agents Yourself

Building an autonomous coding agent is extremely complex. It requires:

ComponentWhat it does
Cloud sandboxesSafe isolated environments to run code
Model routingChoosing the right AI model for each task
Tool useLetting the AI use real tools (search, run code, etc.)
Agent environmentsInfrastructure to keep the agent running

This would take a company months to build and requires ongoing maintenance. Most companies don't want to spend engineering time on this infrastructure — they want to focus on their own product.


Concept 3: What is an SDK?

SDK = Software Development Kit

An SDK is a pre-built toolkit that developers can plug into their own product. Instead of building something from scratch, you use the SDK to get that functionality immediately.

Simple analogy:

Instead of building your own payment system, you use Stripe's SDK. You get payment processing in days, not years.

Similarly, the Cursor SDK lets companies plug in a full coding agent without building one themselves.


Concept 4: What is the Cursor SDK Specifically?

The Cursor SDK gives developers:

  • ✅ The same agent Cursor uses in production
  • ✅ The same models (AI brains)
  • ✅ The same runtime (execution environment)
  • ✅ A full-stack coding agent out of the box

The result: A company like Notion can embed a powerful coding agent into their product in weeks instead of months.


Concept 5: How Notion Used the Cursor SDK (The Integration Pattern)

Notion built a thin adapter — meaning they wrote very little custom code because the Cursor SDK's structure matched Notion's own structure almost perfectly.

Here's how the mapping worked:

Notion Concept          →    Cursor SDK Concept
─────────────────────────────────────────────
A Notion thread         →    A Cursor Agent
Each message in thread  →    An Agent Run

Step-by-step flow:

  1. User tags Cursor in a Notion doc or thread
  2. First message → Creates the agent (with repo, model, settings)
  3. Each follow-up message → Starts a new agent run
  4. Results stream live to the user

Concept 6: What is SSE (Server-Sent Events)?

The article mentions results are "streamed over SSE".

SSE = Server-Sent Events — a technology that lets a server continuously push updates to a user's screen in real time.

Why it matters here:

Instead of waiting for the agent to finish and showing you the result all at once, you watch the work happen live — like watching someone type in real time.

Bonus feature: If your connection drops, it resumes from the last event — you don't lose progress.


Concept 7: What is MCP (Model Context Protocol)?

MCP = Model Context Protocol — a way for AI agents to connect to external tools and data sources.

In this case:

  • Notion has a custom MCP server
  • The Cursor SDK supports remote MCPs
  • This means Cursor can read and write into Notion's workspace in real time

Without MCP: The agent codes "in a vacuum" — it has no awareness of your actual workspace data.

With MCP: The agent has full state awareness — it knows what's in your Notion workspace and can interact with it.


Concept 8: Cloud Sandboxing

A cloud sandbox is an isolated, safe environment in the cloud where code can be executed.

Why it's important:

  • The agent can run and test code without affecting your real systems
  • It's like a virtual playground — mistakes stay contained
  • Cursor manages this infrastructure so Notion doesn't have to

Concept 9: Customizing the Agent

The Cursor SDK isn't one-size-fits-all. You can shape the agent for specific tasks:

CustomizationWhat it means
TemplatesPre-built setups for common tasks (bug triage, Q&A, etc.)
Custom instructionsWrite your own rules from scratch
MCP server selectionChoose which tools/data the agent can access
Custom triggersAutomatically start Cursor based on events in your product

Summary: The Big Picture

WITHOUT Cursor SDK:
Company → Builds sandboxes + models + routing + tools → Months of work

WITH Cursor SDK:
Company → Writes thin adapter → Weeks of work → Full agent ready

The core idea of this article:

The Cursor SDK is a plug-and-play coding agent engine. Companies like Notion provide the surface (where users interact) and the context (workspace data via MCP), while Cursor provides the agent engine (the hard infrastructure). Together, they deliver a powerful product without either side having to do everything alone.

More to study