Guide
Cursor for Jupyter Notebooks: Setup, Debugging, Limits
Install the Jupyter extension from Cursor's Extensions panel, and Agent works in notebooks as it does in any file. Use Ask mode to understand a notebook, add a failing cell to an Agent chat to fix it, and plan charts in Plan mode. In Cursor's workshop, the agent didn't run cells reliably, so plan to run them by hand.

On this page
- How do I set up Jupyter notebooks in Cursor?
- How do I understand a notebook I didn't write?
- How do I debug a failing cell in Cursor?
- How does Cursor fix local path and dependency errors?
- How do I plan a data visualization before building it?
- Can subagents build several charts in parallel?
- How do I keep a long notebook session from degrading?
- What can't Cursor do with Jupyter notebooks?
- Can Cursor turn an Excel file into a notebook?
How do I set up Jupyter notebooks in Cursor?
Install the Jupyter extension, then open your notebook. Cursor's data science guide names the extension for full notebook support: Jupyter (ms-toolsai.jupyter), published by ms-toolsai.
Check the publisher before you install. Cursor installs extensions from Open VSX, where the same extension name can point to a different publisher than on Microsoft's marketplace. In the demo, the presenter picked the extensions published by Microsoft's tools team and checked the publisher and download count before trusting them.
- 1Open the Extensions panel in Cursor and search for Jupyter.
- 2Install Jupyter (
ms-toolsai.jupyter) after confirming that the publisher is ms-toolsai. - 3Open your .ipynb file. Cursor renders cells inline the way VS Code does, and Agent works inside the notebook as it does in other files.
- 4Keep a terminal pane open at the bottom for shell and git commands, and the Agent panel open for the work.
Cursor publishes role-specific cookbooks, workflow recipes for different jobs. The data science one covers notebook development and two ways to connect databases. MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. servers let the agent query a database (its example connects Postgres), and extensions such as PostgreSQL, BigQuery, SQLite and Snowflake run queries from the editor. Start there if you are working out how to fold Cursor into a data workflow.
This is covered hands-on in Planning, Debugging and Verification — 5 short Units, free to read.
Rather do it than read about it? Run 11 interactive Cursor walkthroughs in a simulated editor. Free, no account needed.
How do I understand a notebook I didn't write?
Switch the agent to Ask modeA read-only mode for asking questions about a codebase without changing files; the safe way to explore unfamiliar or legacy code. Press Enter for the full definition. and point it at the notebook. Ask mode is read-only: it answers questions and explores code without making edits, so it is safe to explore with. The presenter opened an unfamiliar Fitbit-analysis notebook and asked what it did and which charts she could add. Cursor inspected the cells, summarized the SQLite-backed workflow and suggested chart ideas. When one suggestion was unclear, she drilled in with "I don't understand activity composition, explain more" and got a plain-language breakdown.
Because Ask modeA read-only mode for asking questions about a codebase without changing files; the safe way to explore unfamiliar or legacy code. Press Enter for the full definition. never edits, a PM or manager can open a notebook just to understand the data or what engineers are building, with no risk of changes. Stay in Ask while you are learning, and switch to Agent when you want a change made. The switch starts a fresh context window, so add the cells Agent needs after you switch.
How do I debug a failing cell in Cursor?
Run the cell, then copy the cell or its error output into an Agent chat, so the agent gets exactly what you ran. The workshop called this the most effective habit for notebook debugging, because the failing cell is the context the agent needs. If you explored in Ask modeA read-only mode for asking questions about a codebase without changing files; the safe way to explore unfamiliar or legacy code. Press Enter for the full definition. first, switch to Agent before you add the cell. Cursor's help says each mode uses its own context, so switching modes starts a fresh context window.
To skip the copying, select the cell's lines and press ⌘K (CtrlK on Windows and Linux). Agent opens with those lines referenced in the input, ready for your instruction. Older guides describe ⌘K as inline edit, which Cursor has replaced with this workflow.
Interactive diagram. Step through it with the Next and Previous controls below, or Tab to a region to read its detail.
Run, capture the error, switch to Agent, hand it the exact cell, then re-run by hand and review.
A notebook's rendered output doesn't always copy cleanly into chat. When that happens, copy the whole cell instead of the output. The agent can reproduce the failure from the source.
How does Cursor fix local path and dependency errors?
These are the two errors that bite first in a notebook, and in the demo Agent fixed both. A "no such file or directory" error usually means the notebook hard-codes a path from wherever it was authored (a Kaggle path, say) while your files sit in a local workspace. Agent diagnosed exactly that and rewrote the path to detect local versus Kaggle and find the data folder relative to the notebook.
Import failures like "pandas could not be resolved" or "matplotlib not installed" usually come from the virtual-environment trap. The package lives in your system Python but not in the venv the notebook is using. Cursor finds the root cause, installs into the venv and checks the import. The presenter's explanation for why this goes well: Python is heavily represented in models' training data, so pip, version and venv problems are familiar ground.
- Error you see
- No such file or directory
- Real cause
- Notebook hard-codes an author's path; your files are elsewhere
- What Cursor does
- Rewrites the path to detect local vs original and resolve it relative to the notebook
- Error you see
- pandas could not be resolved / module not installed
- Real cause
- Package is in system Python, not the venv the notebook uses
- What Cursor does
- Installs into the active virtual environment and checks the import again
- Error you see
- Stale cell output after a fix
- Real cause
- Notebook is still showing an old run
- What Cursor does
- Tells you to re-run the cell; the fix only lands on execution
| Error you see | Real cause | What Cursor does |
|---|---|---|
| No such file or directory | Notebook hard-codes an author's path; your files are elsewhere | Rewrites the path to detect local vs original and resolve it relative to the notebook |
| pandas could not be resolved / module not installed | Package is in system Python, not the venv the notebook uses | Installs into the active virtual environment and checks the import again |
| Stale cell output after a fix | Notebook is still showing an old run | Tells you to re-run the cell; the fix only lands on execution |
The first errors you hit in a notebook, and how Cursor fixed them in the demo.
When prepping the notebook, Cursor asked whether to install into a virtual environment or the project, and the presenter chose the venv. Make that choice deliberately up front. A venv keeps the notebook's dependencies reproducible and avoids the system-versus-venv import trap later.
How do I plan a data visualization before building it?
Switch to Plan modeA mode that makes no edits: it researches the codebase and produces an editable plan you review before any code changes. Press Enter for the full definition. and work out the visualization before any cells change. In the workshop, the plan opened inside the editor next to the code. Its steps linked to the files and snippets they would touch, so the design didn't sit stranded in Notion or Drive. You edit the plan directly: delete a chart you don't want and the agent drops it, or add a testing step and it picks that up. When the plan is right, click Build.
Plan modeA mode that makes no edits: it researches the codebase and produces an editable plan you review before any code changes. Press Enter for the full definition. asks clarifying questions before it builds. Its clarification tool appears on its own when a prompt is vague, and you can also invoke it explicitly. The presenter went further with a skill that told Cursor to ask six or seven questions before making any plan. Its questions included "How should charts handle multiple user IDs?" and "Which extra domains: sleep, heart rate, active minutes?" Answering those up front beats discovering a wrong assumption after the charts are built.
The workshop's rule of thumb: develop the plan with a high-reasoning model, then implement it with a cheaper, faster in-house ComposerCursor's own fast coding model, tuned for the editor and priced well below frontier models; the recommended day-to-day model for executing a plan. Press Enter for the full definition. model, because the plan already holds the hard decisions. The team's line for overspending on implementation is "taking a Lamborghini to the grocery store." Third-party reasoning models aren't on the Free or Plus plans. Save plans to the workspace or check them into GitHub as a paper trail, and run several plans at once when they don't conflict.
Interactive widget. Tab through its controls; the result updates in the panel below as you change them.
Plan and thorny bugs lean on reasoning models; routine chart implementation runs on Composer. Auto can pick for you if your subscription includes it.
Can subagents build several charts in parallel?
Yes. Subagents are smaller agents, each with its own context and persona, that the main agent launches. The presenter calls them "baby Cursors."
Create one with the built-in /create-subagent skill, which writes a short Markdown file describing the persona, such as a chart-building visualization specialist. The presenter's file ran around 150 lines. Then ask the agent to launch three chart-builder subagents. It starts them side by side, each visible in the subagent UI and each building a different chart.
Choose the model per subagent. A chart builder doesn't need a top-tier model running up a bill, and an in-house ComposerCursor's own fast coding model, tuned for the editor and priced well below frontier models; the recommended day-to-day model for executing a plan. Press Enter for the full definition. model or a mid-tier reasoning model is plenty. Set the model in each subagent's file, or let it inherit the parent's.
In the workshop, subagents only launched when a reasoning model ran the parent chat. A fast standard model could do the work inside a subagent but couldn't launch one. Cursor's current subagent docs list no such requirement and describe subagents running while the parent is on Auto or ComposerCursor's own fast coding model, tuned for the editor and priced well below frontier models; the recommended day-to-day model for executing a plan. Press Enter for the full definition.. If yours won't launch, try a reasoning model as the parent, as the presenter did, and keep cheaper models on the workers.
How do I keep a long notebook session from degrading?
Watch the context ring next to your prompt input, and click it to see what is filling the window. The workshop presenter said performance starts to degrade past roughly 70 to 80 percent, with a slower agent and weaker responses. Long notebook debugging sessions get there, because every error, cell and tool call adds up. Three moves reclaim space without starting from scratch.
- Move
- /summarize
- What it does
- Summarizes the conversation so far to free up context
- When to use it
- Mid-session, when the ring fills and answers slow down
- Move
- @Chats
- What it does
- Brings context from a previous conversation into a new chat
- When to use it
- Starting fresh but needing the gist of an earlier thread
- Move
- Fork the chat
- What it does
- Copies the conversation into a new chat; fork from an earlier message to drop everything after it
- When to use it
- Continuing from a known-good point without the accumulated clutter
| Move | What it does | When to use it |
|---|---|---|
| /summarize | Summarizes the conversation so far to free up context | Mid-session, when the ring fills and answers slow down |
| @Chats | Brings context from a previous conversation into a new chat | Starting fresh but needing the gist of an earlier thread |
| Fork the chat | Copies the conversation into a new chat; fork from an earlier message to drop everything after it | Continuing from a known-good point without the accumulated clutter |
Reclaim context without losing where you were.
The presenter described /summarize as stripping out unnecessary tool calls, such as the exploration and understanding steps.
Interactive widget. Tab through its controls; the result updates in the panel below as you change them.
Quality starts to slip at about 70% full, where the meter's degraded zone begins. Summarize, fork or carry context into a new chat before you get there.
What can't Cursor do with Jupyter notebooks?
Plan your loop around running cells by hand. In the demo, the agent wrote and edited cells well, but the presenter ran every cell herself. She noted there may be a community MCPModel Context Protocol. A standard that lets an AI agent pull in context from outside the repo, like Jira tickets or internal docs. Press Enter for the full definition. server that closes the gap, but nothing built in. Cursor's data science guide describes inline cell execution in the editor but doesn't say the agent can run cells.
- Cell execution is manual. Cursor edits and reasons about cells, and you press run.
- Rendered cell output doesn't always copy into chat. Copy the whole cell instead.
- The agent can't always point to a cell visually inside the notebook, so it may tell you what to search for instead.
Read every agent change, including chart-building edits. Asked about the worry "my ability to write code has decreased," the presenter said reviewing generated code is how you keep learning. In that view, an IDE that keeps the code in front of you does this better than a terminal that hides it. The presenter added that Cursor's verbose "here's the issue, here's the fix, here's why" explanations are deliberate for the same reason.
Can Cursor turn an Excel file into a notebook?
Yes. Point Cursor at the spreadsheet and say what you want built from it. In the demo, the presenter gave it a large California Department of Education funding spreadsheet and asked for a new Jupyter notebook that queries the funding data. For an open-ended task like that, Cursor reached for a brainstorming skill on its own.
The presenter found Cursor strong at importing Excel data into a CSV, dashboard or notebook. Ask it to display a CSV as a table, and it offers options.
The session's closing rule of thumb: if you don't know how to do something, ask Cursor, and implement once it has explained your options. Ask modeA read-only mode for asking questions about a codebase without changing files; the safe way to explore unfamiliar or legacy code. Press Enter for the full definition. makes that cheap, because you learn the move before any edit touches the notebook.
Frequently asked questions
Can Cursor run Jupyter notebook cells for me?
Not reliably, based on the workshop. The agent wrote and edited cells well, but the presenter ran every cell by hand, and Cursor's data science guide doesn't say the agent can execute cells. A community MCP server may add cell execution, but the presenter knew of nothing built in, so plan to run cells yourself.
What extensions do I need for Jupyter in Cursor?
The Jupyter extension (ms-toolsai.jupyter), published by ms-toolsai. Cursor's data science guide names it for full notebook support. Install it from the Extensions panel and check the publisher, because Cursor installs from Open VSX, where an extension name can point to a different publisher than on Microsoft's marketplace.
Why does my notebook say a package isn't installed when it is?
Usually the package is in your system Python but not in the virtual environment the notebook is using. Add the failing cell to chat in Agent mode, and Cursor diagnoses the venv-versus-system mismatch, installs into the active venv and checks the import again.
Which mode should I use to understand a notebook without changing it?
Ask mode. It is read-only: it answers questions and explores code without editing anything, so you can ask what a notebook does and which charts to add with no risk. Switch to Agent mode when you want a change made, such as fixing a broken path.
How do I plan charts before building them in a notebook?
Use Plan mode. It asks clarifying questions, writes a plan you can edit, and starts building when you click Build. Plan with a reasoning model if your subscription includes one, implement with a cheaper Composer model, and answer the questions before any charts are built.
Why does Cursor slow down during a long notebook session?
The context window fills as errors, cells and tool calls pile up, and the workshop presenter saw quality drop past roughly 70 to 80 percent. Run /summarize to condense the conversation, use @Chats to bring an earlier thread into a new chat, or fork the chat from a clean point.
Sources & last verified
- Cursor: documentation
- Cursor: models and pricing
- Cursor: data science guide
- Cursor help: extensions
- Cursor help: Agent mode (Cmd+K)
- Cursor: prompting agents (context ring)
- Cursor help: @ mentions and context
- Cursor: subagents
Cursor ships frequently. Last updated October 28, 2026.