Claude Code gains powerful Jupyter notebook support via MCP
Claude Code now works well with Jupyter notebooks through two options: the built-in `NotebookEdit` tool for quick edits, or the more capable open-source Jupyter MCP Server by Datalayer for full agentic kernel access.
Score breakdown
Developers doing data science or ML work can now hand off entire notebook workflows to Claude Code — including error-fixing loops and package installation — by spending 10 minutes configuring the Jupyter MCP Server and dropping a `CLAUDE.md` file in their repo.
- 01Two options exist for Claude Code + Jupyter: the built-in `NotebookEdit` tool (zero setup) and the open-source Jupyter MCP Server by Datalayer (recommended).
- 02The Jupyter MCP Server requires approximately 10 minutes of additional configuration.
- 03Jupyter MCP gives Claude full IPython kernel access: edit cells, execute them, read outputs, and install packages into the running kernel.
A post by amirathi on ReviewNB addresses the long-standing perception that Claude Code is incompatible with Jupyter notebooks, arguing that two tools have changed the picture. The simpler option is Claude Code's built-in `NotebookEdit` tool, which can edit, insert, or delete cells deterministically with zero setup. However, `NotebookEdit` has a notable drawback: it writes cell source as a single JSON string with `\n` literals rather than the standard list-of-strings format that Jupyter and JupyterLab use, making every edit appear noisy in `git diff`.
The recommended approach is the Jupyter MCP Server, an open-source project built by Datalayer.
The recommended approach is the Jupyter MCP Server, an open-source project built by Datalayer. Once registered with Claude Code using `claude mcp add jupyter` at user scope, it exposes both the notebook file and the live running Jupyter kernel to Claude. This enables a fully agentic workflow: Claude can create a notebook, execute it top-to-bottom, encounter import errors, `pip install` missing packages directly into the running kernel, re-run cells, and iterate on fixes — all without human intervention. The post notes that the same MCP configuration works with Claude Desktop as well as the CLI.
To guide Claude's behavior on notebook projects, the post provides a `CLAUDE.md` template to place at the repository root. The template instructs Claude to always prefer the Jupyter MCP over `NotebookEdit`, use `%pip install` instead of `!pip install` to target the running kernel, avoid printing secrets or large DataFrames into cell output, read actual tracebacks before attempting fixes, and verify that a notebook runs cleanly from top-to-bottom after a "Restart & Run All" before declaring a task complete.
Key facts
- 01Two options exist for Claude Code + Jupyter: the built-in `NotebookEdit` tool (zero setup) and the open-source Jupyter MCP Server by Datalayer (recommended).
- 02The Jupyter MCP Server requires approximately 10 minutes of additional configuration.
- 03Jupyter MCP gives Claude full IPython kernel access: edit cells, execute them, read outputs, and install packages into the running kernel.
- 04The agentic workflow lets Claude write, run, and fix notebook errors in a continuous loop with no human intervention required.
- 05`NotebookEdit` has a diff-unfriendly flaw: it writes cell source as a single JSON string rather than the standard list-of-strings format.
- 06The post provides a `CLAUDE.md` template with rules covering tool preference, output safety, execution discipline, and data safety.