Jupyter Notebook MCP server

Integrates Jupyter notebooks with MCP to enable code execution, content manipulation, and interactive data exploration within notebook environments.
Back to servers
Provider
Datalayer
Release date
Feb 14, 2025
Language
Python
Package
Stats
314 stars

Jupyter MCP Server is a Model Context Protocol (MCP) implementation that lets you interact with Jupyter notebooks running in any JupyterLab environment, including your local installation. It provides real-time notebook monitoring, intelligent cell execution handling, and compatibility with various MCP clients like Claude Desktop, Cursor, and Windsurf.

Installation

Install the Jupyter MCP Server package using pip:

pip install jupyter-mcp-server

For the latest development version, you can install directly from GitHub:

pip install git+https://github.com/datalayer/jupyter-mcp-server.git

Getting Started

Prerequisites

  • Python 3.8 or higher
  • A running JupyterLab instance
  • An MCP-compatible client (Claude Desktop, Cursor, Windsurf, etc.)

Running the Server

Start the Jupyter MCP Server with the following command:

jupyter-mcp-server

By default, the server runs on port 8000. You can specify a different port using the --port option:

jupyter-mcp-server --port 8080

Configuration

Server Configuration

The server can be configured with several options:

jupyter-mcp-server --help

Common configuration options:

  • --port PORT: Specify the server port (default: 8000)
  • --host HOST: Specify the server host (default: localhost)
  • --jupyter-server-url URL: URL of the Jupyter server to connect to

Connecting to JupyterLab

To connect to a specific JupyterLab instance, use the --jupyter-server-url option:

jupyter-mcp-server --jupyter-server-url http://localhost:8888

Make sure your JupyterLab instance is running and accessible at the specified URL.

Using with MCP Clients

Claude Desktop

  1. Start the Jupyter MCP Server
  2. Open Claude Desktop
  3. Go to Settings > Advanced > Custom Tools
  4. Add a new tool with the MCP endpoint URL (e.g., http://localhost:8000)
  5. Start a conversation with Claude and use the Jupyter tool

Cursor

  1. Start the Jupyter MCP Server
  2. Open Cursor
  3. Configure the MCP endpoint in Cursor's settings
  4. Use Cursor to interact with your Jupyter notebooks

Supported Features

Real-time Notebook Control

The server provides real-time visibility into notebook changes as they happen.

Smart Cell Execution

The server intelligently handles cell execution, including:

  • Automatic adjustment when a cell execution fails
  • Sequential cell execution management
  • Real-time feedback on execution status

Tool Commands

The MCP server supports various tool commands:

  • Create new notebooks
  • Open existing notebooks
  • Execute specific cells
  • Insert, modify, and delete cells
  • Save notebooks

Troubleshooting

Connection Issues

If you're having trouble connecting to your JupyterLab instance:

  • Verify your JupyterLab is running
  • Check that the specified URL is correct
  • Ensure network connectivity between the MCP server and JupyterLab

Authentication Issues

If authentication is required for your JupyterLab instance:

jupyter-mcp-server --jupyter-server-url http://localhost:8888 --jupyter-token YOUR_TOKEN

Replace YOUR_TOKEN with your actual Jupyter server token.

How to add this MCP server to Cursor

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.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > MCP and click "Add new global MCP server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

Adding an MCP server to a project

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.

How to use the MCP server

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later