MCP Connector Featured

Control Jupyter Notebooks with AI

Datalayer's MCP server for real-time Jupyter notebook control - edit and execute cells, multimodal output, multi-notebook support.

Works with jupytergithubdockerpypi

91
Spark score
out of 100
Status Verified Official
Updated last month
Version 1.0.2
Models
universal

Add to Favorites

Why it matters

Integrate AI models with your Jupyter notebooks for real-time control and automated execution. This asset enables AI to interact with notebooks, manage cells, and adapt to execution feedback.

Outcomes

What it gets done

01

Connect to and manage multiple Jupyter notebooks.

02

Execute cells and code directly within notebooks.

03

Automate notebook operations based on AI interactions.

04

View and process multimodal notebook outputs.

Install

Add it to your toolbox

Run in your project directory:

curl -fsSL https://spark.entire.vc/get/vb-jupyter-mcp-server | bash

Capabilities

Tools your agent gets

list_files

List files and directories in the Jupyter server's file system.

list_kernels

List all available and running kernel sessions on the Jupyter server.

connect_to_jupyter

Connect to a Jupyter server dynamically without restarting the MCP server.

use_notebook

Connect to a notebook file, create a new one, or switch between notebooks.

list_notebooks

List all notebooks available on the Jupyter server and their status.

restart_notebook

Restart the kernel for a specific managed notebook.

unuse_notebook

Disconnect from a specific notebook and release its resources.

read_notebook

Read notebook cells source content with brief or detailed format options.

+9 tools

Overview

Jupyter MCP Server

Jupyter MCP Server by Datalayer gives an AI assistant real-time control of Jupyter notebooks - editing and executing cells, multimodal output, and multi-notebook management. Use it for active, real-time notebook editing and execution; requires MCP_TOKEN (v1.0.0+) and jupyter-collaboration set up for the integration to work correctly.

What it does

Jupyter MCP Server, developed by Datalayer, connects an AI assistant to Jupyter notebooks in real time. Changes appear instantly in the notebook, execution automatically adapts based on cell output feedback, and the server understands full notebook context across multiple open notebooks simultaneously. It supports multimodal outputs (images, plots, text), integrates with JupyterLab UI (e.g. auto-opening notebooks), and includes a hook system with OpenTelemetry integration for tracing tool calls and kernel executions. It works with any Jupyter deployment - local, JupyterHub, or Datalayer-hosted notebooks - and any MCP client (Claude Desktop, Cursor, Windsurf, VS Code).

As of v1.0.0, MCP_TOKEN must be configured in your MCP client setup - this is a breaking change from earlier versions.

When running in JupyterLab mode (enabled by default), it also exposes additional JupyterLab commands as MCP tools via jupyter-mcp-tools, such as running all cells or getting the currently selected cell.

When to use - and when NOT to

Use this connector when you want an assistant to actively read, write, and execute Jupyter notebook cells - running a data science workflow step by step, debugging a failing cell with output feedback, or switching between multiple open notebooks.

Do not use it without setting MCP_TOKEN (required since v1.0.0) or without real-time collaboration configured (jupyter-collaboration) - the auto-save/collaboration behavior is essential for the MCP integration to work correctly. If your LLM or MCP client doesn't support multimodal image output, set ALLOW_IMG_OUTPUT to false.

Inputs and outputs

Tools take notebook paths, cell indices, cell source code, or execution parameters (timeout, code to run). Outputs are cell content/metadata/outputs (including images), execution results, notebook/kernel lists, or file listings from the Jupyter server's filesystem.

Capabilities

  • Server management: list_files, list_kernels, connect_to_jupyter
  • Multi-notebook management: use_notebook, list_notebooks, restart_notebook, unuse_notebook, read_notebook
  • Cell operations: read_cell, insert_cell, delete_cell, move_cell, overwrite_cell_source, edit_cell_source (surgical find-and-replace), execute_cell, insert_execute_code_cell, execute_code (supports magic/shell commands)
  • JupyterLab integration (enabled by default): notebook_run-all-cells, notebook_get-selected-cell, with more customizable via allowed_jupyter_mcp_tools
  • Prompt: jupyter-cite to cite specific notebook cells

How to install

Set up JupyterLab with collaboration support:

pip install jupyterlab==4.4.1 jupyter-collaboration==4.0.2 jupyter-mcp-tools>=0.1.4 ipykernel pycrdt
jupyter lab --port 8888 --IdentityProvider.token MY_TOKEN --ip 0.0.0.0

Then configure your MCP client (quick start via uvx):

{
  "mcpServers": {
    "jupyter": {
      "command": "uvx",
      "args": ["jupyter-mcp-server@latest"],
      "env": {
        "JUPYTER_URL": "http://localhost:8888",
        "JUPYTER_TOKEN": "MY_TOKEN",
        "ALLOW_IMG_OUTPUT": "true"
      }
    }
  }
}

Docker deployment is also supported for production use.

Who it's for

Data scientists and analysts who want an AI assistant to actively read, edit, and run Jupyter notebook cells in real time, including multimodal output like plots and images.

Source README

Datalayer

Become a Sponsor

๐Ÿช๐Ÿ”ง Jupyter MCP Server

An MCP server developed for AI to connect and manage Jupyter Notebooks in real-time

Developed by Datalayer

PyPI - Version
Total PyPI downloads
Docker Pulls
License

Jupyter MCP Server Demo

๐Ÿ“– Table of Contents

๐Ÿš€ Key Features

  • โšก Real-time control: Instantly view notebook changes as they happen.
  • ๐Ÿ” Smart execution: Automatically adjusts when a cell run fails thanks to cell output feedback.
  • ๐Ÿง  Context-aware: Understands the entire notebook context for more relevant interactions.
  • ๐Ÿ“Š Multimodal support: Support different output types, including images, plots, and text.
  • ๐Ÿ“š Multi-notebook support: Seamlessly switch between multiple notebooks.
  • ๐ŸŽจ JupyterLab integration: Enhanced UI integration like automatic notebook opening.
  • ๐Ÿค MCP-compatible: Works with any MCP client, such as Claude Desktop, Cursor, Windsurf, and more.
  • ๐Ÿ” Observability: Built-in hook system with OpenTelemetry integration for tracing tool calls and kernel executions.

Compatible with any Jupyter deployment (local, JupyterHub, ...) and with Datalayer hosted Notebooks.

๐Ÿ”ง MCP Overview

๐Ÿ”ง Tools Overview

The server provides a rich set of tools for interacting with Jupyter notebooks, categorized as follows.
For more details on each tool, their parameters, and return values, please refer to the official Tools documentation.

Server Management Tools
Name Description
list_files List files and directories in the Jupyter server's file system.
list_kernels List all available and running kernel sessions on the Jupyter server.
connect_to_jupyter Connect to a Jupyter server dynamically without restarting the MCP server. Not available when running as Jupyter extension. Useful for switching servers dynamically or avoiding hardcoded configuration. Read more
Multi-Notebook Management Tools
Name Description
use_notebook Connect to a notebook file, create a new one, or switch between notebooks.
list_notebooks List all notebooks available on the Jupyter server and their status
restart_notebook Restart the kernel for a specific managed notebook.
unuse_notebook Disconnect from a specific notebook and release its resources.
read_notebook Read notebook cells source content with brief or detailed format options.
Cell Operations and Execution Tools
Name Description
read_cell Read the full content (Metadata, Source and Outputs) of a single cell.
insert_cell Insert a new code or markdown cell at a specified position.
delete_cell Delete a cell at a specified index.
move_cell Move a cell from one position to another within a notebook.
overwrite_cell_source Overwrite the source code of an existing cell.
edit_cell_source Apply surgical find-and-replace edits to a cell's source without full rewrite.
execute_cell Execute a cell with timeout, supports multimodal output including images.
insert_execute_code_cell Insert a new code cell and execute it in one step.
execute_code Execute code directly in the kernel, supports magic commands and shell commands.
JupyterLab Integration

Available only when JupyterLab mode is enabled. It is enabled by default.

When running in JupyterLab mode, Jupyter MCP Server integrates with jupyter-mcp-tools to expose additional JupyterLab commands as MCP tools. By default, the following tools are enabled:

Name Description
notebook_run-all-cells Execute all cells in the current notebook sequentially
notebook_get-selected-cell Get information about the currently selected cell
๐Ÿ“š Learn how to customize additional tools

You can now customize which tools from jupyter-mcp-tools are available using the allowed_jupyter_mcp_tools configuration parameter. This allows you to enable additional notebook operations, console commands, file management tools, and more.

# Example: Enable additional tools via command-line
jupyter lab --port 4040 --IdentityProvider.token MY_TOKEN --JupyterMCPServerExtensionApp.allowed_jupyter_mcp_tools="notebook_run-all-cells,notebook_get-selected-cell,notebook_append-execute,console_create"

For the complete list of available tools and detailed configuration instructions, please refer to the Additional Tools documentation.

๐Ÿ“ Prompt Overview

The server also supports prompt feature of MCP, providing a easy way for user to interact with Jupyter notebooks.

Name Description
jupyter-cite Cite specific cells from specified notebook (like @ in Coding IDE or CLI)

For more details on each prompt, their input parameters, and return content, please refer to the official Prompt documentation.

๐Ÿ Getting Started

For comprehensive setup instructions-including Streamable HTTP transport, running as a Jupyter Server extension and advanced configuration-check out our documentation. Or, get started quickly with JupyterLab and STDIO transport here below.

1. Set Up Your Environment

pip install jupyterlab==4.4.1 jupyter-collaboration==4.0.2 jupyter-mcp-tools>=0.1.4 ipykernel pycrdt

2. Start JupyterLab

# Start JupyterLab on port 8888, allowing access from any IP and setting a token
jupyter lab --port 8888 --IdentityProvider.token MY_TOKEN --ip 0.0.0.0

3. Configure Your Preferred MCP Client

Next, configure your MCP client to connect to the server. We offer two primary methods-choose the one that best fits your needs:

  • ๐Ÿ“ฆ Using uvx (Recommended for Quick Start): A lightweight and fast method using uv. Ideal for local development and first-time users.
  • ๐Ÿณ Using Docker (Recommended for Production): A containerized approach that ensures a consistent and isolated environment, perfect for production or complex setups.
๐Ÿ“ฆ Using uvx (Quick Start)

First, install uv:

pip install uv
uv --version
# should be 0.6.14 or higher

See more details on uv installation.

Then, configure your client:

{
  "mcpServers": {
    "jupyter": {
      "command": "uvx",
      "args": ["jupyter-mcp-server@latest"],
      "env": {
        "JUPYTER_URL": "http://localhost:8888",
        "JUPYTER_TOKEN": "MY_TOKEN",
        "ALLOW_IMG_OUTPUT": "true"
      }
    }
  }
}
๐Ÿณ Using Docker (Production)

On macOS and Windows:

{
  "mcpServers": {
    "jupyter": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "JUPYTER_URL",
        "-e", "JUPYTER_TOKEN",
        "-e", "ALLOW_IMG_OUTPUT",
        "datalayer/jupyter-mcp-server:latest"
      ],
      "env": {
        "JUPYTER_URL": "http://host.docker.internal:8888",
        "JUPYTER_TOKEN": "MY_TOKEN",
        "ALLOW_IMG_OUTPUT": "true"
      }
    }
  }
}

On Linux:

{
  "mcpServers": {
    "jupyter": {
      "command": "docker",
      "args": [
        "run", "-i", "--rm",
        "-e", "JUPYTER_URL",
        "-e", "JUPYTER_TOKEN",
        "-e", "ALLOW_IMG_OUTPUT",
        "--network=host",
        "datalayer/jupyter-mcp-server:latest"
      ],
      "env": {
        "JUPYTER_URL": "http://localhost:8888",
        "JUPYTER_TOKEN": "MY_TOKEN",
        "ALLOW_IMG_OUTPUT": "true"
      }
    }
  }
}

For detailed instructions on configuring various MCP clients-including Claude Desktop, VS Code, Cursor, Cline, and Windsurf - see the Clients documentation.

โœ… Best Practices

  • Interact with LLMs that supports multimodal input (like Gemini 2.5 Pro) to fully utilize advanced multimodal understanding capabilities.
  • Use a MCP client that supports returning image data and can parse it (like Cursor, Gemini CLI, etc.), as some clients may not support this feature.
  • Break down complex task (like the whole data science workflow) into multiple sub-tasks (like data cleaning, feature engineering, model training, model evaluation, etc.) and execute them step-by-step.
  • Provide clearly structured prompts and rules (๐Ÿ‘‰ Visit our Prompt Templates to get started)
  • Provide as much context as possible (like already installed packages, field explanations for existing datasets, current working directory, detailed task requirements, etc.).

๐Ÿค Contributing

We welcome contributions of all kinds! Here are some examples:

  • ๐Ÿ› Bug fixes
  • ๐Ÿ“ Improvements to existing features
  • ๐Ÿ”ง New feature development
  • ๐Ÿ“š Documentation improvements and prompt templates

For detailed instructions on how to get started with development and submit your contributions, please see our Contributing Guide.

Our Contributors

Contributors

๐Ÿ“š Resources

Looking for blog posts, videos, or other materials about Jupyter MCP Server?

๐Ÿ‘‰ Visit the Resources section in our documentation for more!

Star History Chart


If this project is helpful to you, please give us a โญ๏ธ

Made with โค๏ธ by Datalayer

Hosted deployment

A hosted deployment is available on Fronteir AI.

FAQ

Common questions

Discussion

Questions & comments ยท 0

Sign In Sign in to leave a comment.