Home / MCP / Jupyter MCP Server
Provides real-time Jupyter notebook control and multimodal interactions via MCP clients across local and hosted deployments.
Configuration
View docs{
"mcpServers": {
"jupyter": {
"command": "uvx",
"args": [
"jupyter-mcp-server@latest"
],
"env": {
"JUPYTER_URL": "http://localhost:8888",
"JUPYTER_TOKEN": "MY_TOKEN",
"ALLOW_IMG_OUTPUT": "true"
}
}
}
}You can connect to and manage Jupyter Notebooks in real time using the Jupyter MCP Server. It enables real-time notebook collaboration, smart execution, context-aware interactions, multimodal outputs, and seamless MCP client integration across local or hosted Jupyter deployments.
Connect your MCP client to the Jupyter MCP Server to start controlling notebooks. You can connect to a specific notebook, switch between multiple notebooks, or list available notebooks and kernels. Use the client’s prompts to read notebook content, insert or modify cells, execute code, and receive multimodal outputs such as images and plots.
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.17
```
```bash
# 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
```
```json
{
"mcpServers": {
"jupyter": {
"command": "uvx",
"args": ["jupyter-mcp-server@latest"],
"env": {
"JUPYTER_URL": "http://localhost:8888",
"JUPYTER_TOKEN": "MY_TOKEN",
"ALLOW_IMG_OUTPUT": "true"
}
}
}
}Two MCP connection methods are shown. Use the one that best fits your environment. Both options use the same environment variables to connect to your Jupyter instance.
{
"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"
}
}
}
}
```
```
{
"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"
}
}
}
}
```
Note: Ensure the notebook URL and token match your Jupyter deployment. The port used by JupyterLab should align with the URL you supply in JUPYTER_URL.The server exposes a rich set of tools for interacting with Jupyter notebooks, including server management, multi-notebook control, cell operations, execution, and a JupyterLab integration mode for convenient UI interactions.
Work with clients that can handle multimodal outputs and provide image data when needed. Break complex tasks into sub-tasks, such as data preparation, model work, and evaluation, to keep interactions clear and actionable. Provide well-structured prompts and share context like current workspace and notebook state to improve results.
Contributions are welcome. You can suggest bug fixes, feature improvements, or new documentation. Follow established guidelines for submitting changes and ensure compatibility with MCP client integrations.
Explore additional resources for examples, tutorials, and community materials related to the Jupyter MCP Server to expand your integration and usage knowledge.
List files and directories in the Jupyter server file system.
List all available and running kernel sessions on the Jupyter server.
Connect to a notebook file, create a new one, or switch between notebooks.
List all notebooks available on the Jupyter server and their status.
Restart the kernel for a specific managed notebook.
Disconnect from a specific notebook and release its resources.
Read notebook cells content with brief or detailed format options.
Read the 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, supporting magic and shell commands.
Execute all cells in the current notebook sequentially.
Cite specific cells from a specified notebook via prompts.