Back to MCP Servers

Jupyter

Model Context Protocol (MCP) Server for Jupyter.

data-science-tools
By datalayer
1.3k192Updated 2 days agoPythonBSD-3-Clause

Installation

npx -y jupyter-mcp-server

Configuration

{
  "mcpServers": {
    "jupyter-mcp-server": {
      "command": "npx",
      "args": ["-y", "jupyter-mcp-server"]
    }
  }
}

How to use

  1. Run the installation command above (if needed)
  2. Open your Claude Code settings file (~/.claude/settings.json)
  3. Add the configuration to the mcpServers section
  4. Restart Claude Code to apply changes
<!-- ~ Copyright (c) 2024- Datalayer, Inc. ~ ~ BSD 3-Clause License -->

<a href="https://datalayer.ai"><img alt="Datalayer" src="https://images.datalayer.io/brand/logos/datalayer-horizontal.svg" height="22"/></a>

Become a Sponsor

<div align="center"> <!-- omit in toc -->

๐Ÿช๐Ÿ”ง 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, Daytona, E2B, CoreWeave, Cloudflare...)

Developed by Datalayer - Join our Discord

PyPI - Version Total PyPI downloads Docker Pulls License

Built and maintained by Datalayer

</div>

๐Ÿ“– Documentation ย ยทย  ๐Ÿ”ง Tools ย ยทย  ๐Ÿ’ฌ Community

HOT NEWS

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.

โ†’ Hosted Jupyter MCP Server

Claude Code plugin

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.

Discover Datalayer


New: OAuth 2.1

No token to copy and paste. An agent that meets this server unauthenticated is told where to authenticate, opens your browser, and you sign in to Datalayer as yourself. The agent never sees your password โ€” it receives a token scoped to what you approved, and you can disconnect one agent without touching the others.

What each agent may do is two separate decisions: the scopes you approve (notebooks:read, notebooks:write, code:execute, data:read) say what kind of operation it may perform, and your own Datalayer permissions still say which notebooks it may touch. An agent can never reach a notebook you cannot.

Personal access tokens keep working, and remain the simpler path for a CLI or a script. โ†’ OAuth and identity

Hot fix

Pin code-sandboxes to match your jupyter-mcp-server. The sandbox variant jupyter was renamed to jupyter-server in code-sandboxes 1.1.1, and the two packages have to agree on the name.

Your jupyter-mcp-serverInstall
>= 1.5.0code-sandboxes >= 1.1.1
< 1.5.0code-sandboxes <= 1.0.9
# On 1.5.0 or later
pip install "jupyter-mcp-server>=1.5.0" "code-sandboxes>=1.1.1"

# Staying on an earlier jupyter-mcp-server
pip install "jupyter-mcp-server<1.5.0" "code-sandboxes<=1.0.9"

An older server with a newer code-sandboxes installs cleanly and then fails on the first execution with Unknown sandbox variant: jupyter. โ†’ Release notes


Renamed in v1.3.2

--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-server, datalayer, daytona, e2b, coreweave, cloudflare, kaggle, google-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.


<div align="center">

Jupyter MCP Server Demo

</div>

๐Ÿ“– Table of Contents

๐Ÿš€ 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

NameDescription
list_filesList files and directories in the Jupyter server's file system.
list_kernelsList all available and running kernel sessions on the Jupyter server.
launch_sandboxLaunch a code sandbox (eval/docker/jupyter-server/datalayer/daytona/e2b/coreweave/cloudflare/kaggle/google-colab/monty/modal) as an alternative execution backend for execute_code. Supports variant-specific options including GPU flavor for supported backends. Requires the jupyter_mcp_sandboxes extension.
list_sandboxesList launched code sandboxes and their state (active flag, variant, status, and selected code sandbox options). Requires the jupyter_mcp_sandboxes extension.
use_sandboxSelect or clear the active sandbox used by execute_code, enabling dynamic routing between kernel-backed and sandbox-backed execution. Requires the jupyter_mcp_sandboxes extension.
terminate_sandboxStop and unregister a launched code sandbox. Requires the jupyter_mcp_sandboxes extension.
connect_to_jupyterConnect 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

NameDescription
use_notebookConnect to a notebook file, create a new one, or switch between notebooks.
list_notebooksList all notebooks available on the Jupyter server and their status
restart_notebookRestart the kernel for a specific managed notebook.
unuse_notebookDisconnect from a specific notebook and release its resources.

โ€ฆ

View source on GitHub