universal-notebook-mcp

v0.1.0
universal-notebook-mcp Checked 2 days ago Published 5 months ago

Universal Jupyter Notebook MCP server — full cell I/O, kernel execution, and pipeline stages, compatible with Antigravity, Cursor, Windsurf, Claude Desktop…

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

notebook_list_cells

List every cell in a notebook with its index, type, tags, and first line. Call this first to understand the structure before reading or editing specific cells. Args: notebook_path: Path to the .ipynb file, relative to the workspace root.

ParameterTypeDescription
notebook_path *string

notebook_read_cell

Read the full source, type, tags, and saved outputs of a single cell. Args: notebook_path: Path to the .ipynb file, relative to the workspace root. cell_index: Zero-based index of the cell (use notebook_list_cells to find it).

ParameterTypeDescription
cell_index *integer
notebook_path *string

notebook_read_cell_output

Read the saved outputs of a code cell from the last time it was run. Returns stream text, execute_result data, display_data, or error tracebacks. Note: outputs are empty until the cell has been executed at least once. Args: notebook_path: Path to the .ipynb file, relative to the workspace root. cell_index: Zero-based index of a code cell.

ParameterTypeDescription
cell_index *integer
notebook_path *string

notebook_read_metadata

Read the top-level notebook metadata (kernelspec, language_info, etc.). Args: notebook_path: Path to the .ipynb file, relative to the workspace root.

ParameterTypeDescription
notebook_path *string

notebook_list_stages

List every pipeline stage tag present across the notebook's cells. Pipeline stages are cell tags set in JupyterLab via View → Cell Toolbar → Tags (e.g. 'preprocess', 'train', 'evaluate'). Use notebook_run_pipeline to execute all cells in a named stage. Args: notebook_path: Path to the .ipynb file, relative to the workspace root.

ParameterTypeDescription
notebook_path *string

notebook_edit_cell

Replace the source of a cell. A timestamped .checkpoint_*.ipynb backup is written before the change unless checkpoint=false. Args: notebook_path: Path to the .ipynb file, relative to the workspace root. cell_index: Zero-based index of the cell to edit. source: New source code or markdown text. checkpoint: Write a backup before editing (default: true).

ParameterTypeDescription
cell_index *integer
notebook_path *string
source *string
checkpointboolean

notebook_insert_cell

Insert a new cell at the given position. Cells at index and above are shifted down. To append after the last cell, pass index equal to the total number of cells. Args: notebook_path: Path to the .ipynb file, relative to the workspace root. index: Position to insert at (0 = before first cell). source: Source code or text for the new cell. cell_type: 'code', 'markdown', or 'raw' (default: 'code'). checkpoint: Write a backup before editing (default: true).

ParameterTypeDescription
index *integer
notebook_path *string
source *string
cell_typestring
checkpointboolean

notebook_delete_cell

Delete the cell at the given index. A timestamped backup is written first unless checkpoint=false. Args: notebook_path: Path to the .ipynb file, relative to the workspace root. cell_index: Zero-based index of the cell to delete. checkpoint: Write a backup before deleting (default: true).

ParameterTypeDescription
cell_index *integer
notebook_path *string
checkpointboolean

notebook_edit_cell_metadata

Merge a JSON object into a cell's metadata. Useful for adding or removing pipeline stage tags: updates = '{"tags": ["preprocess"]}' Args: notebook_path: Path to the .ipynb file, relative to the workspace root. cell_index: Zero-based index of the target cell. updates: JSON string with metadata keys to merge in. checkpoint: Write a backup before editing (default: true).

ParameterTypeDescription
cell_index *integer
notebook_path *string
updates *string
checkpointboolean

notebook_edit_metadata

Merge a JSON object into the top-level notebook metadata. Args: notebook_path: Path to the .ipynb file, relative to the workspace root. updates: JSON string with top-level metadata keys to merge in. checkpoint: Write a backup before editing (default: true).

ParameterTypeDescription
notebook_path *string
updates *string
checkpointboolean

notebook_run_cell

Execute a single code cell and return its outputs. Kernel state (variables, imports) is preserved between calls on the same notebook, so cells can depend on earlier ones. Args: notebook_path: Path to the .ipynb file, relative to the workspace root. cell_index: Zero-based index of the cell to run. kernel_name: Kernel to use (e.g. 'python3', 'myenv'). Defaults to 'python3'. Run notebook_list_kernels to see options. timeout: Seconds to wait for the cell to finish (default: 60). save_outputs: Write output…

ParameterTypeDescription
cell_index *integer
notebook_path *string
kernel_name
save_outputsboolean
timeoutinteger

notebook_run_range

Execute cells from start to end (inclusive) and return all outputs. Execution stops at the first error by default (stop_on_error=true). Args: notebook_path: Path to the .ipynb file, relative to the workspace root. start: First cell index to run (inclusive). end: Last cell index to run (inclusive). kernel_name: Kernel to use (default: 'python3'). timeout: Per-cell timeout in seconds (default: 60). stop_on_error: Stop at first failing cell (default: true). save_outputs: Write outputs back to the .ip…

ParameterTypeDescription
end *integer
notebook_path *string
start *integer
kernel_name
save_outputsboolean
stop_on_errorboolean
timeoutinteger

notebook_run_all

Execute every cell in the notebook in order and return all outputs. Args: notebook_path: Path to the .ipynb file, relative to the workspace root. kernel_name: Kernel to use (default: 'python3'). timeout: Per-cell timeout in seconds (default: 60). stop_on_error: Stop at first failing cell (default: true). save_outputs: Write outputs back to the .ipynb file (default: true).

ParameterTypeDescription
notebook_path *string
kernel_name
save_outputsboolean
stop_on_errorboolean
timeoutinteger

notebook_run_pipeline

Run all cells tagged with a pipeline stage, in notebook order. Pipeline stage tags are set per-cell in JupyterLab: View → Cell Toolbar → Tags (add e.g. 'preprocess', 'train', 'evaluate') Use notebook_list_stages to see what stages exist in a notebook. Args: notebook_path: Path to the .ipynb file, relative to the workspace root. stage: Tag name of the stage to run (e.g. 'preprocess'). kernel_name: Kernel to use (default: 'python3'). timeout: Per-cell timeout in seconds (default: 60). stop_on_error: Stop at fi…

ParameterTypeDescription
notebook_path *string
stage *string
kernel_name
save_outputsboolean
stop_on_errorboolean
timeoutinteger

notebook_restart_kernel

Restart the kernel for a notebook, clearing all variables and imports. The kernel process stays alive — only its state is reset, so subsequent run_cell calls start from a clean slate without the startup overhead of a fresh kernel. Args: notebook_path: Path to the .ipynb file whose kernel should be restarted.

ParameterTypeDescription
notebook_path *string

notebook_list_kernels

List every Jupyter kernel spec installed on this machine. Returns a dict of {kernel_name: display_name}. Use the kernel_name value as the kernel_name argument to execution tools. If you get ModuleNotFoundError when running a cell, the kernel may not have your packages installed. Install the current virtualenv as a kernel: python -m ipykernel install --user --name myenv

notebook_list_active_kernels

List notebooks that currently have a running kernel in this session. Returns the absolute resolved paths of notebooks with live kernels.