JJ

jjsantos01/jupyter-notebook-mcp

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

128 stars 26 forks 质量 67 趋势 0MIT

jjsantos01/jupyter-notebook-mcp 是从 https://github.com/jjsantos01/jupyter-notebook-mcp. 导入的 MCP 服务器候选

概览

jjsantos01/jupyter-notebook-mcp 是从 https://github.com/jjsantos01/jupyter-notebook-mcp. 导入的 MCP 服务器候选

概述(AI 翻译)

JupyterMCP 通过模型上下文协议(MCP)将 Jupyter Notebook 与 Claude AI 连接起来,使 Claude 能够直接与 Jupyter Notebook 交互并控制它们。这种集成使得 AI 辅助的代码执行、数据分析、可视化等功能得以实现。

⚠️ 兼容性警告

本工具仅兼容Jupyter Notebook 6.x版本。

它不适用于:

  • Jupyter实验室
  • Jupyter Notebook v7.x
  • VS Code 笔记本
  • 谷歌Colab
  • 任何其他笔记本接口

特色

  • 双向通信:通过基于WebSocket的服务器将Claude AI连接到Jupyter Notebook。
  • 单元操作:插入、执行和管理笔记本单元格
  • 笔记本管理:保存笔记本并检索笔记本信息
  • 单元格执行:运行特定单元格或执行笔记本中的所有单元格
  • 输出检索:通过文本限制选项从执行的单元格获取输出内容

组成部分

该系统由三个主要组成部分组成:

  1. WebSocket 服务器(jupyter_ws_server.py):在 Jupyter 内部搭建一个 WebSocket 服务器,桥接笔记本与外部客户端之间的通信
  2. **Client JavaScript ('client.

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

JupyterMCP - Jupyter Notebook Model Context Protocol Integration

JupyterMCP connects Jupyter Notebook to Claude AI through the Model Context Protocol (MCP), allowing Claude to directly interact with and control Jupyter Notebooks. This integration enables AI-assisted code execution, data analysis, visualization, and more.

⚠️ Compatibility Warning

This tool is compatible ONLY with Jupyter Notebook version 6.x.

It does NOT work with:

  • Jupyter Lab
  • Jupyter Notebook v7.x
  • VS Code Notebooks
  • Google Colab
  • Any other notebook interfaces

Features

  • Two-way communication: Connect Claude AI to Jupyter Notebook through a WebSocket-based server
  • Cell manipulation: Insert, execute, and manage notebook cells
  • Notebook management: Save notebooks and retrieve notebook information
  • Cell execution: Run specific cells or execute all cells in a notebook
  • Output retrieval: Get output content from executed cells with text limitation options

Components

The system consists of three main components:

  1. WebSocket Server (jupyter_ws_server.py): Sets up a WebSocket server inside Jupyter that bridges communication between notebook and external clients
  2. Client JavaScript (client.js): Runs in the notebook to handle operations (inserting cells, executing code, etc.)
  3. MCP Server (jupyter_mcp_server.py): Implements the Model Context Protocol and connects to the WebSocket server

Installation

Prerequisites

Installing uv

If you’re on Mac:

brew install uv

On Windows (PowerShell):

powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"

For other platforms, see the uv installation guide.

Setup

  1. Clone or download this repository to your computer:

    git clone https://github.com/jjsantos01/jupyter-notebook-mcp.git
    
  2. Create virtual environment with required packages an install jupyter-mcp kernel, so it can be recognized by your jupyter installation, if you had one before.

    uv run python -m ipykernel install --name jupyter-mcp
    
  3. (optional) Install additional Python packages for your analysis:

    uv pip install seaborn
    
  4. Configure Claude desktop integration: Go to Claude > Settings > Developer > Edit Config > claude_desktop_config.json to include the following:

       {
        "mcpServers": {
            "jupyter": {
                "command": "uv",
                "args": [
                    "--directory",
                    "/ABSOLUTE/PATH/TO/PARENT/REPO/FOLDER/src",
                    "run",
在 GitHub 查看完整 README

安装

This server does not publish a one-line install command.

Open the repository installation guide 新手?先看 mcpskill.org 教程 →

配置

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