Jupyter MCP Server: Let AI Assistants Add Code and Text to Your Jupyter Notebooks
What is Jupyter MCP Server?
Jupyter MCP Server is an MCP-based server implementation that interacts with Jupyter notebooks running in JupyterLab. Its main function is to provide AI assistants (such as Claude) with the ability to interact with Jupyter notebooks, including reading, modifying, and executing cells within them.
For example, when you are analyzing a dataset with Python and want to calculate its mean and standard deviation, you only need to make the request to Claude in natural language: "Calculate the mean and standard deviation of this dataset." Claude can then generate the results, and even directly add the Python code for calculating the mean and standard deviation in the Jupyter Notebook, run that code, and visualize the results.

Main Features of Jupyter MCP Server
Cell Management: Add, delete, move, split, and edit cell contents.
Execute Cells: Execute specific cells or all cells, and retrieve outputs.
File System Operations: List directory contents, retrieve file contents (with image scaling support).
Kernel Introspection: List kernel variables and installed packages.
Package Management: Install packages within the kernel environment.
Notebook State Management: Search cells, retrieve all cell information and outputs, set the target notebook path.
Installing and Configuring Jupyter MCP Server
1. Install Dependencies: Make sure the following dependencies are installed:
pip install jupyterlab jupyter-collaboration ipykernel pip uninstall -y pycrdt datalayer_pycrdt pip install datalayer_pycrdt
2. Start JupyterLab:
jupyter lab --port 8888 --IdentityProvider.token MY_TOKEN --ip 0.0.0.0
The --ip 0.0.0.0 option allows the MCP server inside a Docker container to access the local JupyterLab instance.
3. Configure Claude Desktop:
Download and install Claude Desktop.
Add the Jupyter MCP Server configuration in the claude_desktop_config.json file:
{
"mcpServers": {
"jupyter": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"SERVER_URL",
"-e",
"TOKEN",
"-e",
"NOTEBOOK_PATH",
"datalayer/jupyter-mcp-server:latest"
],
"env": {
"SERVER_URL": "http://host.docker.internal:8888",
"TOKEN": "MY_TOKEN",
"NOTEBOOK_PATH": "notebook.ipynb"
}
}
}
}Use Cases for Jupyter MCP Server
Jupyter MCP Server is primarily used to integrate AI assistants (such as Claude) with Jupyter notebooks, enabling automation and interactive operations within data science workflows. For example, an AI assistant can automatically read, modify, and execute code in notebooks based on user needs, thereby improving work efficiency.
GitHub address:https://github.com/datalayer/jupyter-mcp-server
Script Planner Assistant▸
AI Apps
AI News 