πŸš€ Jupyter MCP Server

by JosephLin11

283 downloads
Not rated
GitHub

About

Jupyter MCP (Model Context Protocol) Server - Connect Jupyter notebooks with MCP-enabled applications

Details

Author
JosephLin11
Downloads
283
Categories
Search

- 18 comprehensive MCP tools for code execution, cell manipulation, and notebook operations.
- Real‑time Jupyter integration via WebSocket for live code execution and kernel management.
- Advanced image extraction – supports PNG and JPEG from matplotlib, seaborn, plotly.
- Full notebook file operations – create, delete, switch, and list notebooks; CRUD on cells.
- Automatic XSRF token management and token‑based authentication for Jupyter servers.
- Robust error handling with fallback modes, logging, and resource cleanup.

Setting up with Highlight

This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name πŸš€ Jupyter MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Prerequisites: Python 3.11+, Jupyter Notebook, and a compatible MCP client (e.g., Claude Desktop).
Install: Clone the repository, run pip install -r requirements.txt, then start Jupyter with the provided script (./scripts/start_jupyter.sh).
Configure Claude Desktop by adding the following to claude_desktop_config.json:

{
"mcpServers": {
"jupyter": {
"command": "python",
"args": ["/path/to/your/jupyter-mcp-server/src/jupyter_mcp_server.py"]
}
}
}

Run python3 scripts/get_claude_config.py to generate the correct configuration with current paths.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "\ud83d\ude80 jupyter mcp server": {
            "jupyter-mcp-server-josephlin11": {
                "command": "python",
                "args": [
                    "tests/test_image_extraction.py"
                ]
            }
        }
    }
}

McpServers

{
    "jupyter-mcp-server-josephlin11": {
        "command": "python",
        "args": [
            "tests/test_image_extraction.py"
        ]
    }
}

πŸš€ Jupyter MCP Server

Python 3.11+
License: BSD
MCP Compatible
Code Style

> A comprehensive Model Context Protocol (MCP) server that bridges AI agents with Jupyter notebooks, enabling real-time code execution, visualization generation, and advanced image extraction capabilities.

🎯 About This Project

This project is a fork and enhancement of the original Jupyter MCP Server developed by Datalayer, Inc.. Special thanks to the Datalayer team for their foundational work on integrating Jupyter with the Model Context Protocol ecosystem.

Key Enhancements in This Fork:
- Improved documentation and setup process
- Enhanced error handling and robustness
- Additional example configurations
- Streamlined installation and configuration
- Updated dependencies and compatibility

🌟 Key Features

🎯 Real-Time Jupyter Integration

- Live Code Execution: Execute Python code in real-time through WebSocket connections - Kernel Management: Automatic kernel creation, lifecycle management, and cleanup - Session Persistence: Maintain state across multiple operations

πŸ–ΌοΈ Advanced Image Extraction

- Multi-Format Support: Extract PNG and JPEG images from matplotlib, seaborn, plotly - Base64 Encoding: Ready-to-use image data for AI processing - Comprehensive Output Handling: Text, images, errors, and execution results

πŸ“š Complete Notebook Management

- File Operations: Create, delete, switch between multiple notebooks - Cell Manipulation: Add, modify, move, delete cells with full CRUD operations - Content Management: Support for both markdown and code cells

πŸ›‘οΈ Enterprise-Ready Security

- Smart XSRF Handling: Automatic token detection and management - Authentication Support: Compatible with tokenized Jupyter servers - Error Recovery: Graceful fallbacks for connection issues

πŸ—οΈ Architecture

graph TD
    A[AI Agent/Claude] --> B[MCP Server]
    B --> C[Jupyter Server API]
    B --> D[WebSocket Channels]
    C --> E[Kernel Management]
    D --> F[Real-time Execution]
    F --> G[Output Capture]
    G --> H[Image Extraction]
    G --> I[Text Processing]
    B --> J[Notebook Files]

πŸ› οΈ 18 Comprehensive Tools

πŸ“ Cell Content Management

- add_execute_code_cell - Execute Python code with real-time output - add_markdown_cell - Add formatted documentation - modify_cell - Edit existing cell content - change_cell_type - Convert between markdown and code cells

πŸ–ΌοΈ Output Extraction

- get_cell_image_output - Extract base64-encoded images (PNG/JPEG) - get_cell_text_output - Get all text outputs including errors and tracebacks

πŸ—‚οΈ Notebook File Operations

- create_notebook - Create new notebook files - delete_notebook - Remove notebook files safely - switch_notebook - Change active notebook - list_notebooks - Browse available notebooks

πŸ” Data Discovery

- list_cells - Overview of all cells with preview - read_cell - Full content of specific cells - get_notebook_info - Comprehensive notebook metadata

View complete tool documentation β†’

πŸš€ Quick Start

Prerequisites

- Python 3.11+ - Jupyter Notebook - Claude Desktop or compatible MCP client

Installation

1. Clone the repository

   git clone https://github.com/JosephLin11/jupyter-mcp-server.git
cd jupyter-mcp-server

2. Install dependencies

   pip install -r requirements.txt

3. Start Jupyter Server

   ./scripts/start_jupyter.sh

4. Configure Claude Desktop
Add to your claude_desktop_config.json:

   {
"mcpServers": {
"jupyter": {
"command": "python",
"args": ["/path/to/your/jupyter-mcp-server/src/jupyter_mcp_server.py"]
}
}
}


πŸ’‘ Tip: Run python3 scripts/get_claude_config.py to generate the correct configuration with current paths!

πŸ’‘ Example Use Cases

πŸ“Š Data Visualization Pipeline

```python
No reviews yet β€” be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.