Jupyter MCP Server enables real-time AI interaction with Jupyter Notebooks, allowing AI systems to edit, document, and execute code through the Model Context Protocol (MCP). It works with any Jupyter deployment and provides seamless integration with various MCP clients.
Before installing the Jupyter MCP Server, you'll need to set up the required dependencies:
pip install jupyterlab==4.4.1 jupyter-collaboration==4.0.2 ipykernel
pip uninstall -y pycrdt datalayer_pycrdt
pip install datalayer_pycrdt==0.12.17
Launch JupyterLab with the following command:
jupyter lab --port 8888 --IdentityProvider.token MY_TOKEN --ip 0.0.0.0
Replace MY_TOKEN
with your preferred security token.
You'll need to configure your MCP client to communicate with the Jupyter MCP Server. The configuration differs slightly depending on your operating system.
{
"mcpServers": {
"jupyter": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"DOCUMENT_URL",
"-e",
"DOCUMENT_TOKEN",
"-e",
"DOCUMENT_ID",
"-e",
"RUNTIME_URL",
"-e",
"RUNTIME_TOKEN",
"datalayer/jupyter-mcp-server:latest"
],
"env": {
"DOCUMENT_URL": "http://host.docker.internal:8888",
"DOCUMENT_TOKEN": "MY_TOKEN",
"DOCUMENT_ID": "notebook.ipynb",
"RUNTIME_URL": "http://host.docker.internal:8888",
"RUNTIME_TOKEN": "MY_TOKEN"
}
}
}
}
{
"mcpServers": {
"jupyter": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-e",
"DOCUMENT_URL",
"-e",
"DOCUMENT_TOKEN",
"-e",
"DOCUMENT_ID",
"-e",
"RUNTIME_URL",
"-e",
"RUNTIME_TOKEN",
"--network=host",
"datalayer/jupyter-mcp-server:latest"
],
"env": {
"DOCUMENT_URL": "http://localhost:8888",
"DOCUMENT_TOKEN": "MY_TOKEN",
"DOCUMENT_ID": "notebook.ipynb",
"RUNTIME_URL": "http://localhost:8888",
"RUNTIME_TOKEN": "MY_TOKEN"
}
}
}
}
When configuring your MCP client, remember these important details:
port
in DOCUMENT_URL
and RUNTIME_URL
must match the port used in your JupyterLab commandDOCUMENT_ID
is the path to your notebook, relative to the directory where JupyterLab was startedDOCUMENT_URL
and RUNTIME_URL
are identicalDOCUMENT_TOKEN
and RUNTIME_TOKEN
are usually the same as your Jupyter tokenJupyter MCP Server offers several powerful capabilities:
The MCP server provides multiple tools for interacting with Jupyter notebooks:
insert_execute_code_cell
append_markdown_cell
get_notebook_info
read_cell
For a complete list of available tools and their usage, you can visit the tools documentation.
For more detailed instructions, including Streamable HTTP transport configuration and setting up various MCP clients like Claude Desktop, VS Code, Cursor, Cline, and Windsurf, visit the comprehensive documentation.
To add this MCP server to Claude Code, run this command in your terminal:
claude mcp add-json "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"}}'
See the official Claude Code MCP documentation for more details.
There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json
file so that it is available in all of your projects.
If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json
file.
To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".
When you click that button the ~/.cursor/mcp.json
file will be opened and you can add your server like this:
{
"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"
}
}
}
}
To add an MCP server to a project you can create a new .cursor/mcp.json
file or add it to the existing one. This will look exactly the same as the global MCP server example above.
Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.
The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.
You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.
To add this MCP server to Claude Desktop:
1. Find your configuration file:
~/Library/Application Support/Claude/claude_desktop_config.json
%APPDATA%\Claude\claude_desktop_config.json
~/.config/Claude/claude_desktop_config.json
2. Add this to your configuration 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"
}
}
}
}
3. Restart Claude Desktop for the changes to take effect