home / mcp / jupyter mcp server
🪐 🔧 Model Context Protocol (MCP) Server for Jupyter.
Configuration
View docs{
"mcpServers": {
"datalayer-jupyter-mcp-server": {
"command": "uvx",
"args": [
"jupyter-mcp-server@latest"
],
"env": {
"JUPYTER_URL": "http://localhost:8888",
"DOCUMENT_URL": "http://localhost:8888",
"JUPYTER_TOKEN": "MY_TOKEN",
"ALLOW_IMG_OUTPUT": "true"
}
}
}
}The Jupyter MCP Server lets you manage and control Jupyter notebooks from MCP clients in real time. It provides a bridge between your MCP-enabled assistant and the notebook environment, enabling real-time collaboration, multimodal outputs, and smooth notebook switching across multiple workbooks.
Connect with an MCP client to control notebooks, run code, and read outputs. You can switch between notebooks, read and edit cells, execute code, and receive rich multimodal results such as images and plots. The server supports both local (stdio) and remote (http) deployment methods, so you can run it directly on your machine or in a container. Use the client prompts to select a notebook, issue commands, and view results in real time.
Prerequisites: ensure you have Python and pip installed, and you can install optional tooling for MCP client connectivity. You will also install a small set of packages to enable Jupyter real-time collaboration.
pip install jupyterlab==4.4.1 jupyter-collaboration==4.0.2 jupyter-mcp-tools>=0.1.4 ipykernel
pip uninstall -y pycrdt datalayer_pycrdt
pip install datalayer_pycrdt==0.12.17Start a JupyterLab session on your host, configuring the port and token for MCP access.
jupyter lab --port 8888 --IdentityProvider.token MY_TOKEN --ip 0.0.0.0Choose your preferred MCP client connection method. You can use uvx for a quick start or Docker for production-grade isolation.
The MCP server can be connected through two main methods. The first uses a lightweight, local client (uvx). The second uses Docker to run the MCP server in a container. You provide the notebook server URL and authentication token via environment variables, and you can enable image outputs if your client supports multimodal results.
# uvx quick-start example already shown below in the configuration snippetFor local development or containerized production, you’ll configure the MCP server connection as shown in the following two examples. Adapt JUPYTER_URL and JUPYTER_TOKEN to your environment.
Use a MCP client that can handle image data and multimodal outputs to take full advantage of the server’s capabilities. Break complex tasks into smaller steps, and provide clear context to your assistant so it can operate across notebooks and cells efficiently.
If you encounter authentication or connectivity issues, verify that the token you supply matches the token configured in JupyterLab and that the URL points to the correct notebook server. Ensure the port in your JUPYTER_URL matches the port you started JupyterLab with.
Below are the two explicit connection methods shown for MCP clients. Use these exact configurations to connect your MCP client to the Jupyter MCP Server.
json
{
"mcpServers": {
"jupyter": {
"command": "uvx",
"args": ["jupyter-mcp-server@latest"],
"env": {
"JUPYTER_URL": "http://localhost:8888",
"JUPYTER_TOKEN": "MY_TOKEN",
"ALLOW_IMG_OUTPUT": "true"
}
}
}
}json
{
"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"
}
}
}
}The server also supports prompts for MCP, including a tool to cite specific cells from a notebook.
Real-time notebook interaction, smart execution that adapts when runs fail, context-aware interactions, multimodal output support, and seamless multi-notebook management across Jupyter deployments.
List files and directories in the Jupyter server file system.
List all available and running kernel sessions on the Jupyter server.
Connect to a Jupyter server dynamically without restarting the MCP server.
Connect to a notebook file, create a new one, or switch between notebooks.
List all notebooks on the Jupyter server and their status.
Restart the kernel for a specific managed notebook.
Disconnect from a notebook and release its resources.
Read notebook cells content with brief or detailed formats.
Read full content of a single cell including metadata, source, and outputs.
Insert a new code or markdown cell at a specified position.
Delete a cell at a specified index.
Overwrite the source code of an existing cell.
Execute a cell with timeout and multimodal outputs.
Insert a new code cell and execute it in one step.
Execute code directly in the kernel, including magic and shell commands.
Execute all cells in the current notebook sequentially.
Get information about the currently selected cell.
Cite specific cells from a notebook for prompt-based workflows.