home / mcp / jupyter mcp server

Jupyter MCP Server

Connects Jupyter Notebook 6.x to Claude AI to enable AI-assisted notebook control and execution.

Installation
Add the following to your MCP client configuration file.

Configuration

View docs
{
  "mcpServers": {
    "jjsantos01-jupyter-notebook-mcp": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/PARENT/REPO/FOLDER/src",
        "run",
        "jupyter_mcp_server.py"
      ]
    }
  }
}

You can run an MCP (Model Context Protocol) server to connect a local Jupyter Notebook to Claude AI, enabling AI-assisted notebook control. This setup allows Claude to insert and execute cells, save notebooks, and retrieve outputs, turning your notebook into an interactive AI-powered workspace.

How to use

You start the Jupyter Notebook server, then initialize the MCP integration inside a notebook cell. Once Claude is connected, you can prompt it to insert and run cells, save the notebook, and fetch cell outputs or notebook information. The available actions let Claude manage the notebook lifecycle and interact with code and results programmatically.

How to install

Prerequisites you must have installed before proceeding: Python 3.12 or newer, the uv package manager, and Claude AI desktop application.

Install uv on Mac with Homebrew, or use the Windows PowerShell script, then proceed with Python tooling as shown.

Configuration and usage notes

Configure Claude to load the MCP server by adding a dedicated MCP server entry that points to the local Python MCP server runner. The following defines the local stdio MCP server entry named jupyter.

{
  "mcpServers": {
    "jupyter": {
      "command": "uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/PARENT/REPO/FOLDER/src",
        "run",
        "jupyter_mcp_server.py"
      ]
    }
  }
}

Starting the server and connecting Claude

1) Start Jupyter Notebook server with the classic interface (version 6.x) enabled.

2) Create or switch to a notebook that uses the jupyter-mcp kernel.

3) In a notebook cell, initialize the WebSocket integration from within the Jupyter environment so Claude can communicate with the notebook.

Available tools and actions (Claude side)

After connection, Claude can perform a set of operations on your notebook, including inserting and executing cells, saving notebooks, inspecting cell information, running specific or all cells, retrieving outputs, editing cells, and configuring slideshow options.

Troubleshooting

If you encounter connection timeouts or execution problems, restart the WebSocket server or reinitialize the MCP integration. If port conflicts occur, the server selects an available port automatically. Ensure you are using Jupyter Notebook 6.x and that the kernel in use is the jupyter-mcp kernel.

Notes and limitations

This integration is experimental and executes arbitrary Python code on your machine. Always back up important work before enabling AI-driven notebook operations. Follow best practices for data security and code review when running code issued by Claude.

Example prompts you can use with Claude

Ask Claude to insert a new cell at a specific position and run it, or to save the current notebook after updating a visualization.

Available tools

ping

Check server connectivity from Claude to the MCP server.

insert_and_execute_cell

Insert a new cell at a specified position and execute it.

save_notebook

Save the current Jupyter notebook.

get_cells_info

Retrieve information about all cells in the notebook.

get_notebook_info

Get information about the current notebook.

run_cell

Run a specific cell by its index.

run_all_cells

Run all cells in the notebook.

get_cell_text_output

Fetch the text output from a specific cell.

get_image_output

Fetch image outputs from a specific cell.

edit_cell_content

Edit the content of an existing cell.

set_slideshow_type

Set the slideshow type for a cell.