/ Каталог / Песочница / jupyter-mcp-server
● Сообщество datalayer ⚡ Сразу

jupyter-mcp-server

автор datalayer · datalayer/jupyter-mcp-server

Let Claude run and read your Jupyter notebooks in real time — execute cells, see plots, recover from errors, all without leaving the chat.

jupyter-mcp-server (Datalayer) connects MCP clients to a live JupyterLab/Jupyter Server instance. Supports multiple notebooks, image/plot outputs, kernel management, and error-recovery loops. Useful for data exploration, reproducible analysis, or letting agents operate a notebook like a teammate.

Зачем использовать

Ключевые функции

Живое демо

Как выглядит на практике

jupyter.replay ▶ готово
0/0

Установка

Выберите клиент

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "jupyter": {
      "command": "uvx",
      "args": [
        "jupyter-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Откройте Claude Desktop → Settings → Developer → Edit Config. Перезапустите после сохранения.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "jupyter": {
      "command": "uvx",
      "args": [
        "jupyter-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Cursor использует ту же схему mcpServers, что и Claude Desktop. Конфиг проекта приоритетнее глобального.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "jupyter": {
      "command": "uvx",
      "args": [
        "jupyter-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Щёлкните значок MCP Servers на боковой панели Cline, затем "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "jupyter": {
      "command": "uvx",
      "args": [
        "jupyter-mcp-server"
      ],
      "_inferred": true
    }
  }
}

Тот же формат, что и Claude Desktop. Перезапустите Windsurf для применения.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "jupyter",
      "command": "uvx",
      "args": [
        "jupyter-mcp-server"
      ]
    }
  ]
}

Continue использует массив объектов серверов, а не map.

~/.config/zed/settings.json
{
  "context_servers": {
    "jupyter": {
      "command": {
        "path": "uvx",
        "args": [
          "jupyter-mcp-server"
        ]
      }
    }
  }
}

Добавьте в context_servers. Zed перезагружается автоматически.

claude mcp add jupyter -- uvx jupyter-mcp-server

Однострочная команда. Проверить: claude mcp list. Удалить: claude mcp remove.

Сценарии использования

Реальные сценарии: jupyter-mcp-server

How to run exploratory data analysis with Claude + Jupyter

👤 Data scientists, analysts ⏱ ~30 min intermediate

Когда использовать: You've got a new dataset and want to poke at it without writing boilerplate cells yourself.

Предварительные требования
  • Running JupyterLab with token auth — jupyter lab --no-browser; copy the token from the URL
  • JUPYTER_URL + JUPYTER_TOKEN env vars — Set to your lab URL and token
Поток
  1. Load the notebook and data
    Use use_notebook to open analysis.ipynb. Insert a cell that loads ./data/events.parquet into a DataFrame named df.✓ Скопировано
    → Cell executes; df.head() preview returned
  2. Iterate on analysis
    What does the distribution of event_type look like? Plot it, show me the image.✓ Скопировано
    → Histogram image rendered in chat
  3. Save a clean notebook
    Clean the notebook: delete error cells, add markdown headers, restart-run-all to verify it runs top-to-bottom.✓ Скопировано
    → Notebook that reproduces end-to-end

Итог: A publishable notebook with narrative, charts, and verified reproducibility.

Подводные камни
  • Kernel state drifts from notebook cell order — Use notebook_run-all-cells after edits to catch hidden-state bugs
  • Data files aren't visible to the kernel — Kernel's CWD is the notebook's dir, not where you started Jupyter — use absolute paths
Сочетать с: filesystem

Self-healing notebooks with Claude and jupyter-mcp

👤 Researchers iterating on pipelines ⏱ ~45 min advanced

Когда использовать: A long notebook fails halfway; you want the agent to fix the cell and resume rather than restart.

Поток
  1. Run with error catching
    Execute all cells in pipeline.ipynb. When a cell errors, read the traceback, fix the code, and retry before moving on.✓ Скопировано
    → Notebook continues past the first error with a fix applied
  2. Log the fixes for review
    Summarize every fix you made as markdown cells above the changed code✓ Скопировано
    → Audit trail of agent edits

Итог: Pipeline completes with visible repair history.

Generate teaching notebooks from natural-language lesson outlines

👤 Educators, technical writers ⏱ ~30 min beginner

Когда использовать: You want to produce a worked-example notebook for students or a blog post.

Поток
  1. Outline → scaffold
    From this lesson outline [paste], create lesson.ipynb with sections as markdown cells and code cells scaffolded.✓ Скопировано
    → Notebook with structure
  2. Fill code cells and verify
    Flesh out each code cell with runnable examples. Execute top-to-bottom and ensure zero errors.✓ Скопировано
    → Clean notebook students can run

Итог: A teaching-ready notebook created in minutes, not hours.

Комбинации

Сочетайте с другими MCP — эффект x10

jupyter + filesystem

Move artifacts in/out of the notebook's working directory

Copy the plots saved by the notebook to ./reports/<date>/ via the filesystem MCP.✓ Скопировано
jupyter + postgres

Pull data from Postgres inside the notebook

In a new cell, use pandas.read_sql with my DB connection to load last month's events; then do EDA.✓ Скопировано

Инструменты

Что предоставляет этот MCP

ИнструментВходные данныеКогда вызыватьСтоимость
use_notebook path: str Open/attach a notebook 0
list_notebooks Find available notebooks 0
execute_cell notebook_id, cell_index Run a specific cell kernel time
insert_execute_code_cell notebook_id, code, position? Add new code and run it kernel time
read_cell notebook_id, cell_index Inspect existing cells 0
list_kernels See what's running; find zombie kernels 0
restart_notebook notebook_id Reset kernel state cleanly 0

Стоимость и лимиты

Во что обходится

Квота API
None from MCP; Jupyter is yours to run
Токенов на вызов
Outputs can be large — images and DataFrame heads especially
Деньги
Free (self-hosted)
Совет
Use df.head() and df.info() not print(df) — full DataFrames bloat token usage

Безопасность

Права, секреты, радиус поражения

Хранение учётных данных: JUPYTER_TOKEN in env — treat like a password; anyone with it can run code on your kernel
Исходящий трафик: MCP talks to your Jupyter server URL only

Устранение неполадок

Частые ошибки и исправления

401 Unauthorized connecting to Jupyter

JUPYTER_TOKEN stale — copy fresh from jupyter server list

Проверить: curl -H 'Authorization: token <TOKEN>' $JUPYTER_URL/api
Kernel busy / never returns

Previous cell is still running. Use restart_notebook to recover; watch for infinite loops

Проверить: list_kernels shows state=busy
Plots don't appear in Claude

Ensure %matplotlib inline is set and you're returning the figure, not just calling plt.show() at end

Альтернативы

jupyter-mcp-server в сравнении

АльтернативаКогда использоватьКомпромисс
nteract/papermillYou want scripted/parameterized notebook runs without interactive chatNo agent loop; batch-style
marimoYou want reactive notebooks with less hidden stateDifferent tool entirely; no MCP yet

Ещё

Ресурсы

📖 Читать официальный README на GitHub

🐙 Открытые задачи

🔍 Все 400+ MCP-серверов и Skills