Skip to main content
Glama
ipynb-mcp
by YmSaki

ipynb-mcp

ローカルの Jupyter Notebook (.ipynb) にセルを追加・編集し、ノートブックで指定されたカーネル上で単一セルを実行する小さな stdio MCP サーバーです。

セットアップ

Python 3.10 以上と uv を使います。

uv sync

ipykernel は依存関係に含まれるため、通常はカーネルの追加インストールは不要です。

対象ノートブックの metadata.kernelspec.name が設定されていれば、そのカーネルを使います。未設定の場合は IPYNB_MCP_DEFAULT_KERNEL、次に python3、最後にインストール済みカーネルの名前順で先頭を選びます。

Related MCP server: notebook-agent-mcp

MCP クライアントへの登録

クライアントからこのコマンドを stdio MCP サーバーとして起動するよう設定します。

{
  "mcpServers": {
    "jupyter-notebook": {
      "command": "uv",
      "args": [
        "--directory",
        "C:\\programing\\ipynb-mcp",
        "run",
        "ipynb-mcp"
      ]
    }
  }
}

ツール

  • notebook_info(path): セル一覧とカーネル情報を取得

  • read_cell(path, index): セル内容を取得

  • add_cell(path, source, cell_type="code", index=null): セルを追加。ファイルがなければ新規作成

  • edit_cell(path, index, source, cell_type=null): セル内容と任意で種類を変更

  • run_cell(path, index, timeout_seconds=120): コードセルを実行し、出力をノートブックへ保存

  • restart_kernel(path): カーネルを再起動して変数などの状態を消去

セル番号はすべて 0 始まりです。カーネルはノートブックごとにサーバープロセス内で維持されるため、セル間で変数を引き継げます。サーバーを終了するとカーネルも終了します。

開発時の確認

uv run pytest

Available Tools

6 tools
add_cellA

Add a cell. Append when index is omitted. Creates a missing notebook.

Inputs: path (required), source (required), index, cell_type. Returns: object

edit_cellB

Replace a cell's source and optionally its type.

Inputs: path (required), index (required), source (required), cell_type. Returns: object

notebook_infoA

Return notebook metadata and compact summaries of all cells.

Inputs: path (required). Returns: object

read_cellA

Read one cell by its zero-based index, including outputs for code cells.

Inputs: path (required), index (required). Returns: object

restart_kernelA

Restart the notebook's kernel, clearing all in-memory variables.

Inputs: path (required). Returns: object

run_cellB

Execute one code cell in the notebook's persistent default kernel and save outputs.

Inputs: path (required), index (required), timeout_seconds. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 6 tools

    Disambiguation5/5

    Each tool targets a distinct operation: reading metadata, reading a cell, adding, editing, running, or restarting the kernel. There is minimal overlap and an agent can clearly select the right tool for the intended action.

    Naming Consistency4/5

    Most tools follow a clear verb_noun pattern: read_cell, add_cell, edit_cell, run_cell, restart_kernel. notebook_info is the only slight deviation, being noun_noun rather than get_notebook_info, but it remains readable and consistent with the overall style.

    Tool Count5/5

    Six tools is a well-scoped set for notebook manipulation. Each tool serves a clear and necessary purpose without unnecessary bloat.

    Completeness3/5

    The core lifecycle of reading, adding, editing, and executing cells is covered, and restart_kernel handles execution-state resets. However, a delete_cell operation is missing, which is a notable gap for editing workflows, and there is no way to reorder cells.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers