Jupyter MCP Server
The Jupyter MCP Server enables AI assistants to connect to and control Jupyter Notebooks in real-time through the Model Context Protocol, providing comprehensive notebook management, code execution, and multimodal output handling.
Core Capabilities:
File System Management: Browse files/directories with filtering, pagination, and depth control; search using glob patterns
Kernel Management: List available and running kernels with state, connection details, and specifications; monitor kernel resources and restart kernels as needed
Multi-Notebook Operations: Connect to existing or create new notebooks, switch between multiple notebooks seamlessly, list managed notebooks with status, restart kernels, and disconnect to release resources
Cell-Level Operations: Read cells with metadata and outputs (brief or detailed with pagination), insert new cells (code/markdown) at any position, delete cells individually or in batches, overwrite cell source with diff-style tracking, and execute cells with configurable timeouts and progress streaming
Direct Code Execution: Execute code in kernels without saving to notebooks, including Jupyter magic commands (
%timeit,%pip install), shell commands (!git status), quick calculations, and debuggingMultimodal Support: Handle diverse output types including text, images, and plots; return image data in base64 format when
ALLOW_IMG_OUTPUTis enabledJupyterLab Integration: Access additional commands like run-all-cells and get-selected-cell when running in JupyterLab mode (enabled by default)
AI-Driven Features: Context-aware interactions understanding entire notebook context, smart execution with automatic adjustment based on cell output feedback, and the
jupyter-citeprompt for citing specific cellsFlexible Deployment: Compatible with local Jupyter, JupyterHub, Google Colab, Datalayer hosted notebooks, and works with any MCP client (Claude Desktop, Cursor, Windsurf, etc.)
Provides interaction with Jupyter notebooks running in JupyterLab, allowing adding and executing code cells, creating markdown cells, and interacting with notebook content programmatically.
Offers functionality to download Earth data granules from NASA Earth Data, supporting parameters for folder name, dataset short name, count, temporal range, and bounding box.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Jupyter MCP Serverinsert a markdown cell at the top with the title 'Data Analysis Report'"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
πͺπ§ Jupyter MCP Server
An MCP server developed for AI to connect and manage Jupyter Notebooks in real-time β and scale your Code Sandbox from local to the cloud (Datalayer, Kaggle, Google Colab, Modal...)
Developed by Datalayer - Join our Discord
π Documentation Β· π§ Tools Β· π¬ Community
No process to run. Datalayer now hosts this server for you at
https://mcp.datalayer.run/mcp β one endpoint for every agent and every notebook.
Sign in from your browser, approve what the agent may do, and your work keeps running
on the server after the agent disconnects.
One command to connect Claude Code, with /datalayer:notebook, /datalayer:run and
/datalayer:status on top:
/plugin marketplace add datalayer/jupyter-mcp-server
/plugin install datalayerβ Datalayer plugin for Claude Code
Free and open source, BSD 3-Clause β point it at any Jupyter you already run, local or JupyterHub, no account needed.
Built and maintained by Datalayer, where the same server drives always-on Notebooks with GPU Code Sandboxes and durable execution β so your agent keeps working on your data when your laptop does not.
--provider is now --document-provider (env var PROVIDER β DOCUMENT_PROVIDER).
It only ever chose where the notebook documents live β jupyter for the collaboration
API of a Jupyter Server, datalayer for the Datalayer spacer β while the old name and its
help text suggested it also chose where code runs. Execution is picked separately, with
--sandbox-variant (jupyter, datalayer, kaggle, colab, monty, modal).
Nothing breaks in v1.3.2: --provider is still accepted as an alias, PROVIDER is still
read, and a /connect payload carrying "provider" is still understood. Move to the new
names when convenient β the old ones are deprecated, not removed.

π Table of Contents
Related MCP server: mcp-server-jupyter
π 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, where the Code Sandboxes come with GPUs and the execution survives a disconnect.
π§ 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 and Code Sandbox Management Tools
Name | Description |
| List files and directories in the Jupyter server's file system. |
| List all available and running kernel sessions on the Jupyter server. |
| Launch a code sandbox (eval/docker/jupyter/datalayer/kaggle/google_colab/google-colab/colab/monty/modal) as an alternative execution backend for |
| List launched code sandboxes and their state (active flag, variant, status, and selected code sandbox options). Requires the |
| Select or clear the active sandbox used by |
| Stop and unregister a launched code sandbox. Requires the |
| 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. |
Multi-Notebook Management Tools
Name | Description |
| 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 source content with brief or detailed format options. |
Cell Operations and Execution Tools
Name | Description |
| Read the full content (Metadata, Source and Outputs) of a single cell. |
| Insert a new code or markdown cell at a specified position. |
| Delete a cell at a specified index. |
| Move a cell from one position to another within a notebook. |
| Clear the outputs and execution count of a single code cell. |
| Overwrite the source code of an existing cell. |
| Apply surgical find-and-replace edits to a cell's source without full rewrite. |
| Execute a cell with timeout, supports multimodal output including images. |
| Insert a new code cell and execute it in one step. |
| Execute code directly in the active backend (kernel by default, or active sandbox if selected), supports magic commands and shell commands. When the selected sandbox supports streaming execution, progress/output events are consumed and returned in order. |
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 |
| Execute all cells in the current notebook sequentially |
| Get information about the currently selected cell |
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 |
| Cite specific cells from specified notebook (like |
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 jupyter-collaboration jupyter-mcp-tools ipykernelTo confirm your environment is correctly configured:
Open a notebook in JupyterLab
Type some content in any cell (code or markdown)
Observe the tab indicator: you should see an "Γ" appear next to the notebook name, indicating unsaved changes
Wait a few secondsβthe "Γ" should automatically change to a "β" without manually saving
This automatic saving behavior confirms that the real-time collaboration features are working properly, which is essential for MCP server integration.
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.0If you are running notebooks through JupyterHub instead of JupyterLab as above, refer to our JupyterHub setup guide.
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 usinguv. 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.
First, install uv:
pip install uv
uv --version
# should be 0.6.14 or higherSee 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"
}
}
}
}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"
}
}
}
}Port Configuration: Ensure the
portin your Jupyter URLs matches the one used in thejupyter labcommand. For simplified config, set this inJUPYTER_URL.Server Separation: Use
JUPYTER_URLwhen both services are on the same server, or set individual variables for advanced deployments. The different URL variables exist because some deployments separate notebook storage (DOCUMENT_URL) from kernel execution (CODE_SANDBOX_URL).Authentication: In most cases, document and code sandbox services use the same authentication token. Use
JUPYTER_TOKENfor simplified config or setDOCUMENT_TOKENandCODE_SANDBOX_TOKENindividually for different credentials.Notebook Path: The
DOCUMENT_IDparameter specifies the path to the notebook the MCP client default to connect. It should be relative to the directory where JupyterLab was started. If you omitDOCUMENT_ID, the MCP client can automatically list all available notebooks on the Jupyter server, allowing you to select one interactively via your prompts.Image Output: Set
ALLOW_IMG_OUTPUTtofalseif your LLM does not support mutimodel understanding.
For detailed instructions on configuring various MCP clientsβincluding Claude Desktop, VS Code, Cursor, Cline, and Windsurf β see the Clients documentation.
π§© Sandbox Variants
By default, code executes through the code-sandboxes jupyter variant against
a Jupyter Server (SANDBOX_VARIANT=jupyter). Setting SANDBOX_VARIANT to any
other value uses another code-sandboxes
engine via the sandbox's plain kernel client when the selected variant exposes
one, so the same notebook tools can run code on additional backends.
Sandbox features are provided by the optional jupyter_mcp_sandboxes extension.
To expose sandbox lifecycle tools (launch_sandbox, list_sandboxes,
use_sandbox, terminate_sandbox) or run any non-jupyter sandbox variant,
install it with pip install jupyter_mcp_sandboxes.
Engine |
| Extra install | Key variables |
Jupyter Server (default) |
| β |
|
JupyterHub |
| β |
|
Datalayer |
|
|
|
Kaggle |
|
| Default batch mode: Kaggle credentials ( |
Google Colab |
|
|
|
Monty |
|
| β |
Modal |
|
| Modal credentials |
1. Jupyter Server
The default engine. Point the server at a running Jupyter Server:
pip install jupyter-mcp-server"env": {
"JUPYTER_URL": "http://localhost:8888",
"JUPYTER_TOKEN": "MY_TOKEN"
}2. JupyterHub
JupyterHub uses the same jupyter engine, targeting a user's single-user server.
Authenticate with a JupyterHub API token that has the access:servers scope:
"env": {
"CODE_SANDBOX_URL": "https://your-jupyterhub.domain/user/<username>",
"CODE_SANDBOX_TOKEN": "your-jupyterhub-api-token",
"DOCUMENT_URL": "https://your-jupyterhub.domain/user/<username>",
"DOCUMENT_TOKEN": "your-jupyterhub-api-token"
}See the JupyterHub setup guide for full details.
3. Datalayer
Execute on the Datalayer cloud code sandbox with GPU support and persistence:
pip install "jupyter-mcp-server[datalayer]""env": {
"SANDBOX_VARIANT": "datalayer",
"CODE_SANDBOX_URL": "https://prod1.datalayer.run",
"CODE_SANDBOX_TOKEN": "your-datalayer-token",
"SANDBOX_ENVIRONMENT": "python-cpu-env"
}4. Kaggle
Execute against Kaggle. By default, when no code sandbox URL/channels are provided,
the server uses the transparent Kaggle batch path from code-sandboxes.
If code sandbox values are provided, it uses Kaggle interactive kernel mode.
pip install "jupyter-mcp-server[kaggle]""env": {
"SANDBOX_VARIANT": "kaggle",
"KAGGLE_API_TOKEN": "...",
"SANDBOX_GPU": "T4"
}To force interactive code sandbox mode, provide CODE_SANDBOX_URL and either:
KAGGLE_API_TOKEN/CODE_SANDBOX_TOKEN(create kernel), orCODE_SANDBOX_ID/CODE_SANDBOX_CHANNELS_URL(connect existing kernel).
Supported Kaggle accelerator values include:
NvidiaTeslaP100, NvidiaTeslaT4, NvidiaTeslaT4Highmem, NvidiaL4,
NvidiaL4X1, NvidiaTeslaA100, NvidiaH100, and NvidiaRtxPro6000.
Aliases such as P100 and T4 are accepted.
Note: Kaggle free-tier availability usually includes
P100andT4. Other accelerators are commonly restricted to specific competitions or internal Kaggle workloads.
5. Google Colab
Execute against a Google Colab code sandbox. Install Jupyter MCP Server and provide the values from an active Colab notebook session:
pip install jupyter-mcp-server"env": {
"SANDBOX_VARIANT": "google-colab",
"CODE_SANDBOX_URL": "https://8080-m-s-kkb-...-d.us-east1-0.prod.colab.dev",
"CODE_SANDBOX_ID": "a1b2c3d4-....",
"CODE_SANDBOX_PROXY_TOKEN": "ya29...."
}The proxy token (
colab-runtime-proxy-token) is short-lived; refresh it when it expires.
You can also pass CODE_SANDBOX_CHANNELS_URL with the Colab channels WebSocket URL
and let the server derive CODE_SANDBOX_URL and CODE_SANDBOX_ID.
6. Monty
Execute in Monty, a secure in-process Python interpreter β ideal for short, safe LLM snippets. No credentials required.
pip install "jupyter-mcp-server[monty]""env": {
"SANDBOX_VARIANT": "monty"
}Monty supports only a subset of Python; third-party libraries and rich display outputs are not available.
7. Modal
Execute in a Modal cloud sandbox. Install the extra and configure Modal credentials:
pip install "jupyter-mcp-server[modal]"
modal token newFor local development, modal token new is usually enough because the Modal SDK
loads credentials from ~/.modal.toml.
If you run in CI/CD, containers, or hosted runners, set both environment variables below.
"env": {
"SANDBOX_VARIANT": "modal",
"MODAL_TOKEN_ID": "ak-...",
"MODAL_TOKEN_SECRET": "as-..."
}Why both variables? Modal uses a token pair for environment-based auth:
MODAL_TOKEN_ID: public token identifier.MODAL_TOKEN_SECRET: secret half paired with that id.
Providing only one is insufficient for authentication.
If needed, export both values from your local Modal config:
python - <<'PY'
import pathlib
import tomllib
cfg = tomllib.loads(pathlib.Path("~/.modal.toml").expanduser().read_text())
profile = cfg.get("default", cfg)
token_id = profile.get("token_id")
token_secret = profile.get("token_secret")
if token_id and token_secret:
print(f"export MODAL_TOKEN_ID={token_id}")
print(f"export MODAL_TOKEN_SECRET={token_secret}")
else:
raise SystemExit("Could not find token_id/token_secret in ~/.modal.toml")
PYYou can also select the engine on the command line with
--sandbox-variant,--code-sandbox-proxy-token, and--sandbox-environment.
π§ͺ Testing
Run the test suite:
pytest tests/Required environment variables for tests:
None for the default local suite.
Optional environment variables:
TEST_MCP_SERVER:true/falsetoggle for standalone MCP server mode tests (defaulttrue).TEST_JUPYTER_SERVER:true/falsetoggle for Jupyter extension mode tests (defaulttrue).DATALAYER_API_KEY: required only for Datalayer cloud smoke/integration tests.DATALAYER_RUN_URL: optional custom Datalayer code sandbox URL for datalayer engine tests.SANDBOX_ENVIRONMENT: optional cloud environment override (for exampleai-agents-env).
β 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
π Resources
Looking for blog posts, videos, or other materials about Jupyter MCP Server?
π Visit the Resources section in our documentation for more!
If this project is helpful to you, please give us a βοΈ
Made with β€οΈ by Datalayer
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceA Model Context Protocol server for comprehensive Jupyter notebook manipulation, featuring position-based cell operations and bulk editing. It includes specialized integration for VS Code to synchronize notebook changes and trigger file reloads.2
- AlicenseAqualityCmaintenanceEnables programmatic interaction with Jupyter notebooks, allowing reading, editing, and executing cells via Claude.632MIT
- AlicenseAqualityCmaintenanceEnables AI agents to create, read, edit, and execute Jupyter notebook cells, manage kernels, and connect to remote Jupyter servers.21MIT
- FlicenseAqualityDmaintenanceEnables LLMs to interact with Python environments, execute code, manage files, and handle packages through the Model Context Protocol.9
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yoβ¦
Connect AI agents to Replynodes over the Model Context Protocol.
A Model Context Protocol server for Wix AI tools
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/datalayer/jupyter-mcp-server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server