IM

ihrpr/mcp-server-jupyter

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

34 stars 5 forks 品質 66 トレンド 12MIT

Jupyter Notebook と JupyterLab 用の MCP サーバー

概要

プログラム的にJuppyterのノートと管理し、相互作用するためのMCPサーバー。 サーバは、ノートブック操作のための6つのツールを提供しています。 1. read notebook with outputs: セル出力を含むノートブックのコンテンツを読み込みます 2. read notebook source only: 出力なしでノートブックコンテンツを読み込みます - 必須: ノートブックパス(文字列) - サイズ制限が出力付きのフルノートブックを読むのを防ぐときに使用 3. read output of cell: 特定のセルの出力を読みます - 必須: - Notebook path (string) - cell id (string) - 必須: - ノートブックパス(文字列) - ソース(文字列) - オプション: - Cell type(string): "code" または "markdown" - 位置(整数): インサートインデックス(-1 を付加)

概要(AI 翻訳)

プログラム的にJuppyterのノートと管理し、相互作用するためのMCPサーバー。

コンポーネント

ツール

サーバは、ノートブック操作のための6つのツールを提供しています。

  1. [read_notebook_with_outputs: セル出力を含むノートブックのコンテンツを読みます
  • 必須: notebook_path (文字列)
  1. [read_notebook_source_only:出力なしでノートブックの内容を読んで下さい
  • 必須: notebook_path (文字列)
  • サイズ制限が出力のフルノートを読むことを防ぐとき使用して下さい
  1. [[read_output_of_cell]: 特定のセルの出力を読みます
  • 必須:
  • [notebook_path (文字列)
  • [cell_id (文字列)
  • 必須:
  • [notebook_path (文字列)
  • source (文字列)
  • 任意:
  • [cell_type (文字列): “code” または “markdown”
  • [position (整数): インサートインデックス (-1 を付加)
  1. [edit_cell: 既存のセルコンテンツの修正
  • 必須:
  • [notebook_path (文字列)
  • [cell_id(文字列):編集するセルのユニークなID
  • [source (文字列)
  1. [execute_cell: 特定のセルを実行し、出力を返す
  • 必須:
  • [notebook_path (文字列)
  • [cell_id (文字列)
  • 細胞の実行および出力を検証するのに有用

Claudeデスクトップでの使用

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

README

以下は原文 README の抜粋です。原文を見る。

mcp-server-jupyter

An MCP server for managing and interacting with Jupyter notebooks programmatically.

Components

Tools

The server provides six tools for notebook manipulation:

  1. read_notebook_with_outputs: Read a notebook’s content including cell outputs

    • Required: notebook_path (string)
  2. read_notebook_source_only: Read notebook content without outputs

    • Required: notebook_path (string)
    • Use when size limitations prevent reading full notebook with outputs
  3. read_output_of_cell: Read output of a specific cell

    • Required:
      • notebook_path (string)
      • cell_id (string)
  4. add_cell: Add new cell to notebook

    • Required:
      • notebook_path (string)
      • source (string)
    • Optional:
      • cell_type (string): “code” or “markdown”
      • position (integer): insertion index (-1 to append)
  5. edit_cell: Modify existing cell content

    • Required:
      • notebook_path (string)
      • cell_id (string): Unique ID of the cell to edit
      • source (string)
  6. execute_cell: Execute a specific cell and return its output

    • Required:
      • notebook_path (string)
      • cell_id (string)
    • Useful for verifying cell execution and output

Usage with Claude Desktop

Step1: Start JupyterLab or Jupyter Notebook

By using uv to run Jupyter notebooks it’s much easier to manage venv and package installations.

Follow uv jupyter docummentation for more details.

uv venv --seed
source .venv/bin/activate
uv pip install jupyterlab
.venv/bin/jupyter lab

NOTE: this environment should be used as UV_PROJECT_ENVIRONMENT env variable in MCP server (next step). Run in the same folder where Jupyter started.

echo $(pwd)/.venv

Step2: Configure Claude Desctop Add this configuration to your Claude Desktop config file:

PyPi package:

// ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "Jupyter-notebook-manager": {
      "command": "uv",
      "args": ["run", "--with", "mcp-server-jupyter", "mcp-server-jupyter"],
      "env": {
        "UV_PROJECT_ENVIRONMENT": "/path/to/venv_for_jupyter/.venv"
      }
    }
  }
}

Git repo fork

// ~/Library/Application Support/Claude/claude_desktop_config.json
{
  "mcpServers": {
    "Jupyter-notebook-manager": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "/Users/inna/mcp-server-jupyter/src/mcp_server_jupyter",
        "mcp-server-jupyter"
      ],
      "env": {
        "UV_PROJECT_ENVIRONMENT": "/path/to/venv_for_jupyter/.venv"
      }
    }
  }
}

Step 3: Open Notebook & Claude Chat

Open or create a notebook in JupyterLab/Jupyter Notebook

Get the full path to your notebook:

GitHub で README 全文を見る

インストール

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

Open the repository installation guide MCP 初心者?mcpskill.org のガイドから始めましょう →

設定

// ~/Library/Application Support/Claude/claude_desktop_config.json { "mcpServers": { "Jupyter-notebook-manager": { "command": "uv", "args": ["run", "--with", "mcp-server-jupyter", "mcp-server-jupyter"], "env": { "UV_PROJECT_ENVIRONMENT": "/path/to/venv_for_jupyter/.venv" } } } }