Sponsored by Deepsite.site

Jupyter Mcp Server

Created By
ChengJiale1503 months ago
An MCP service specifically developed for AI to connect and manage Jupyter Notebooks
Content

🪐 Jupyter MCP Server

Jupyter MCP Server

An MCP service specifically developed for AI to connect and manage Jupyter Notebooks

Developed by ChengJiale150

Python License Version pypi mcp-registry

English | 中文

📖 Table of Contents

🎯 Project Introduction

Jupyter MCP Server is a service based on the Model Context Protocol (MCP), providing the most advanced AI IDEs (like Cursor) and CLI tools (like Gemini CLI) with the ability to connect and manage Jupyter Notebooks. This enables AI to operate Notebooks for tasks such as data analysis, visualization, and machine learning.

🤔 Why Jupyter MCP Server?

Jupyter Notebook is one of the most common tools for data scientists, offering an interactive environment for exploratory tasks like data analysis, visualization, and machine learning. However, due to the format limitations of Notebooks, they are not as easily understood by AI as plain text files (like Markdown or Python files).

Existing tools or MCP services for operating Notebooks either only support reading and editing or can only manipulate a single Notebook, making it difficult to meet the complex demands of managing multiple Notebooks simultaneously. Furthermore, most tools do not support multimodal output, failing to fully leverage the powerful image and text understanding capabilities of advanced multimodal large models (like Gemini 2.5).

Jupyter MCP Server was developed to address this issue. Through the MCP protocol, it provides AI with tools to manage Jupyter Kernels and Notebooks, enabling it to handle multiple Notebooks for interactive task execution and output multimodal results, helping data scientists improve their analysis efficiency.

✨ Key Highlights

  • 🔌 MCP Compatible: Can be used in any IDE or CLI tool that supports the MCP protocol.
  • 📚 Multi-Notebook Management: Supports managing multiple Notebooks at the same time.
  • 🔁 Interactive Execution: Can automatically adjust execution strategies based on cell output.
  • 📊 Multimodal Output: Supports outputting multimodal results, such as text, images, tables, etc.

🔧 Tools Overview

Notebook Management Module

NameDescriptionNotes
connect_notebookConnect/create a Notebook at a specified pathTool execution time is long (10s~30s) due to Kernel startup.
list_notebookList all currently connected NotebooksUsed to view currently connected Notebooks for multi-Notebook tasks.
restart_notebookRestart a specified NotebookClears all imported packages and variables.
read_notebookRead the source content (without output) of a connected NotebookUsed to view the source content of the Notebook, only used when the user explicitly instructs to read the full content of the Notebook.

Basic Cell Function Module

NameDescriptionNotes
list_cellList basic information of all cells in a specified NotebookUsed to locate cell index and purpose.
read_cellRead the content of a specific cell in a specified NotebookSupports various outputs like images, tables, text, etc.
delete_cellDelete a specific cell in a specified Notebook
insert_cellInsert a cell above/below a specific index in a specified Notebook
execute_cellExecute a specific cell in a specified NotebookReturns the output of the cell.
overwrite_cellOverwrite the content of a specific cell in a specified NotebookUsed to modify cell content.

Advanced Integrated Cell Function Module

NameDescriptionNotes
append_execute_cellAdd and execute a cell at the end of a NotebookA combination of insert+execute for frequent operations, reducing tool calls.
execute_temporary_cellExecute a temporary code block (not saved to the Notebook)Used for magic commands, code snippet debugging, viewing intermediate variables, etc.

For more details on the tools, please see the Tools Documentation.

🛠️ Quick Start

Prerequisites

Installing Jupyter MCP Server

uvx Quick Installation (Recommended)

After installing uv, configure the MCP JSON format directly, as shown below:

{
    "mcpServers":{
        "Jupyter-MCP-Server":{
            "command": "uvx",
            "args": [
                "better-jupyter-mcp-server"
            ],
            "env": {},
            "transport": "stdio"
        }
    }
}

For specific client integration, please see the Integration Documentation.

Source Code
  1. Clone the project and install dependencies

    git clone https://github.com/ChengJiale150/jupyter-mcp-server
    cd jupyter-mcp-server
    uv sync
    
  2. (Optional) Configure config.toml

    Go to the src/config.toml file and configure parameters as needed (e.g., whether to allow returning image data).

  3. Start Jupyter MCP Server

    uv run fastmcp run src/better_jupyter_mcp_server/server.py
    

    If it starts successfully, you will see output similar to this:

    [09/14/25 20:14:59] INFO     Starting MCP server 'Jupyter-MCP-Server' with transport 'stdio'
    
  4. Configure Standard JSON Format

    {
        "mcpServers":{
            "Jupyter-MCP-Server":{
                "command": "uv",
                "args": [
                    "run",
                    "--directory",
                    "your/path/to/jupyter-mcp-server",
                    "src/better_jupyter_mcp_server/server.py"
                ],
                "env": {},
                "transport": "stdio"
            }
        }
    }
    

    For specific client integration, please see the Integration Documentation.

Starting Jupyter

Before formal use, you need to connect to a Jupyter Server. Here is how to start a Jupyter Server locally:

  1. Open a terminal and activate the environment:

    Open your computer's terminal command line and activate the environment.

    For conda (Anaconda) users, you can use the following command to activate the environment:

    conda activate your_environment_name
    

    For convenience, you can use the base environment (conda activate base).

    Then switch to your current project directory for easier file operations.

    cd your/path/to/your/project
    
  2. Install necessary dependencies:

    pip uninstall -y pycrdt datalayer_pycrdt
    pip install jupyter nbformat datalayer_pycrdt jupyter-collaboration
    
  3. Start Jupyter Server:

    Use the following command to start the Jupyter Server, where YOUR_TOKEN is the authentication token, which you can change.

    jupyter lab --port 8888 --IdentityProvider.token YOUR_TOKEN
    

    After a successful start, a browser window will pop up. You can check if the root path is your project directory.

Using Jupyter MCP Server

Before formal use, you must add the following prompt to your rules file to provide the necessary connection information for Jupyter MCP Server:

Here are the Jupyter server connection parameters:
URL = http://localhost:8888
Token = YOUR_TOKEN

Additionally, it is recommended to add key Notebook path information to the prompt to help the AI quickly locate the target Notebook and improve the execution efficiency of the connect_notebook tool. You can right-click the target Notebook file in Jupyter Lab and select Copy Path to get the relative path.

After providing the above content, you can start using Jupyter MCP Server!

✅ Best Practices

  • Interact with a large model that supports multimodal input (like Gemini 2.5 Pro) to fully utilize advanced multimodal understanding capabilities.
  • Use a client that supports returning image data via the MCP protocol and can parse it (like Cursor, Gemini CLI, etc.), as some clients may not support this feature.
  • Break down complex tasks (like data science modeling) 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. You can refer to the Prompt and Rules Documentation.
  • Incorporate expert experience and wisdom (such as data cleaning and feature engineering techniques) into your prompts, as this is what AI lacks most and needs to be supplemented.
  • Provide as much context as possible (such as field explanations for existing datasets, file paths, detailed task requirements, etc.).
  • Provide Few Shot examples, provide Baseline or existing Workflow as a reference.

Examples

🤝 Contribution Guidelines

We welcome community contributions! If you would like to contribute to the Jupyter MCP Server project, please:

  1. Fork this repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Types of Contributions

  • 🐛 Bug fixes
  • 📝 Improvements to existing features
  • ✨ New feature development
  • 📚 Documentation improvements
  • 🌍 Internationalization support

Development Help Documentation

🤗 Acknowledgements

This project has been helped by the following projects, and we would like to express our gratitude:

  • DataLayer: Thanks to DataLayer for open-sourcing the jupyter_nbmodel_client and jupyter_kernel_client libraries, which greatly helped the rapid development of Jupyter MCP.
  • FastMCP: Thanks to the developers of FastMCP. Without FastMCP, the rapid integration of Jupyter MCP would not have been possible.

In addition, this project also referenced the implementations of the following existing Jupyter MCP services, and we would like to thank them as well:


If this project is helpful to you, please give us a ⭐️

Made with ❤️ by ChengJiale150

Server Config

{
  "mcpServers": {
    "Jupyter-MCP-Server": {
      "command": "uvx",
      "args": [
        "better-jupyter-mcp-server"
      ],
      "env": {},
      "transport": "stdio"
    }
  }
}
Recommend Servers
TraeBuild with Free GPT-4.1 & Claude 3.7. Fully MCP-Ready.
Serper MCP ServerA Serper MCP Server
Context7Context7 MCP Server -- Up-to-date code documentation for LLMs and AI code editors
Amap Maps高德地图官方 MCP Server
DeepChatYour AI Partner on Desktop
Zhipu Web SearchZhipu Web Search MCP Server is a search engine specifically designed for large models. It integrates four search engines, allowing users to flexibly compare and switch between them. Building upon the web crawling and ranking capabilities of traditional search engines, it enhances intent recognition capabilities, returning results more suitable for large model processing (such as webpage titles, URLs, summaries, site names, site icons, etc.). This helps AI applications achieve "dynamic knowledge acquisition" and "precise scenario adaptation" capabilities.
BlenderBlenderMCP connects Blender to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Blender. This integration enables prompt assisted 3D modeling, scene creation, and manipulation.
AiimagemultistyleA Model Context Protocol (MCP) server for image generation and manipulation using fal.ai's Stable Diffusion model.
Jina AI MCP ToolsA Model Context Protocol (MCP) server that integrates with Jina AI Search Foundation APIs.
MCP AdvisorMCP Advisor & Installation - Use the right MCP server for your needs
MiniMax MCPOfficial MiniMax Model Context Protocol (MCP) server that enables interaction with powerful Text to Speech, image generation and video generation APIs.
TimeA Model Context Protocol server that provides time and timezone conversion capabilities. This server enables LLMs to get current time information and perform timezone conversions using IANA timezone names, with automatic system timezone detection.
CursorThe AI Code Editor
Playwright McpPlaywright MCP server
Tavily Mcp
Baidu Map百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
EdgeOne Pages MCPAn MCP service designed for deploying HTML content to EdgeOne Pages and obtaining an accessible public URL.
Visual Studio Code - Open Source ("Code - OSS")Visual Studio Code
ChatWiseThe second fastest AI chatbot™
Howtocook Mcp基于Anduin2017 / HowToCook (程序员在家做饭指南)的mcp server,帮你推荐菜谱、规划膳食,解决“今天吃什么“的世纪难题; Based on Anduin2017/HowToCook (Programmer's Guide to Cooking at Home), MCP Server helps you recommend recipes, plan meals, and solve the century old problem of "what to eat today"
WindsurfThe new purpose-built IDE to harness magic