jupyter-notebook-mcp
Provides tools for loading, editing, searching, and saving Jupyter notebooks (.ipynb) through an MCP interface.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@jupyter-notebook-mcp load my notebook experiments.ipynb"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
jupyter-notebook-mcp
A FastMCP server for loading, editing, searching, and saving Jupyter notebooks (.ipynb) through MCP tools.
The server keeps one notebook open at a time and uses live cell indices that update as cells are inserted or removed.
Features
Single active notebook session with in-memory state (
path, notebook object, dirty flag)Autosave current notebook before loading a different notebook
Real insert/remove semantics: indices shift immediately after edits
Return full notebook as plain-text blocks when loading
Save/import notebook content in markdown block format
Case-insensitive keyword search with contextual snippets
Actionable
ToolErrormessages for common failure cases
Related MCP server: jupyter-editor-mcp
Tool API
The server exposes the following MCP tools:
load_notebook(path: str)Loads and validates a notebook
Autosaves the currently open notebook first (if any)
Returns active cells as plain-text blocks:
[index:N type:...]+ full content
save_notebook(path: str | None = None)Saves current notebook (optionally to a new path)
read_cell(index: int)Returns full source for one active cell
add_cell(content: str, cell_type: str = "code", index: int | None = None)Appends a new cell when
indexis omittedInserts below the referenced cell when
indexis provided (insert atindex + 1)Returns plain-text blocks for changed cell + adjacent cells
replace_cell(index: int, content: str)Replaces entire cell source
remove_cell(index: int)Removes a cell by index with immediate reindexing
Returns plain-text blocks for changed cell + adjacent cells
delete_cell(index: int)Backward-compatible alias of
remove_cell
save_markdown(path: str)Saves the same text returned by
load_notebook()to a markdown file path
from_markdown(path: str)Reads exported markdown blocks from disk and replaces current notebook cells
search_cell(keywords: str)Space-separated keyword search (all keywords must match)
Requirements
Python
>=3.12uvfor environment and dependency management
MCP Installation
Run directly with uvx (no persistent install):
uvx jupyter-notebook-mcp --from git+https://github.com/g0g5/jupyter-notebook-mcpInstall as a uv tool:
uv tool install jupyter-notebook-mcp --from git+https://github.com/g0g5/jupyter-notebook-mcpQuick Start
uv sync
uv run python -m jupyter_notebook_mcpYou can also run via the project script entrypoint:
uv run jupyter-notebook-mcpMCP Client Configuration (stdio)
Use one of the following configurations.
Option 1: run with uvx from GitHub:
{
"mcpServers": {
"jupyter-notebook-mcp": {
"command": "uvx",
"args": [
"jupyter-notebook-mcp",
"--from",
"git+https://github.com/g0g5/jupyter-notebook-mcp"
]
}
}
}Option 2: after uv tool install, run installed command directly:
{
"mcpServers": {
"jupyter-notebook-mcp": {
"command": "jupyter-notebook-mcp",
"args": []
}
}
}Development
Install/update dependencies:
uv syncTypecheck (lightweight compile check):
uv run python -m py_compile jupyter_notebook_mcp/*.py tests/*.pyRun tests:
uv run pytest -vProject Structure
jupyter-notebook-mcp/
|- jupyter_notebook_mcp/
| |- __main__.py # Module entrypoint for `python -m jupyter_notebook_mcp`
| |- server.py # FastMCP app and tool registration
| |- session.py # Shared in-memory notebook session state
| |- notebook_io.py # Notebook load/save and validation
| |- cell_ops.py # Cell read/edit operations
| |- markdown_codec.py # Markdown export/import parsing
| |- search.py # Keyword search and snippet extraction
| \- formatting.py # Cell block and markdown preview formatting
\- tests/
|- conftest.py # Shared fixtures (session reset)
|- helpers.py # Shared notebook test helpers
|- test_contract_flow.py
|- test_session_and_io.py
|- test_cell_editing.py
|- test_markdown_codec.py
\- test_search_and_formatting.pyBehavior Notes
If no notebook is loaded, notebook-dependent tools return:
No notebook is loaded. Use load_notebook(path) first.
Cell indices are always current active indices; insert/remove operations reindex following cells.
On save, the server validates notebook structure with
nbformat.validatebefore writing.
Available Tools
10 toolsadd_cellA
Insert after index, or append when index is omitted.
cell_type must be one of: code, markdown, raw.
Inputs: content (required), index, cell_type. Returns: result
delete_cellC
Backward-compatible alias of remove_cell(index).
Inputs: index (required). Returns: result
from_markdownC
Load markdown notebook blocks from disk and replace active cells.
Inputs: path (required). Returns: object
load_notebookA
Load and validate a notebook from disk, then return markdown blocks.
Autosaves the currently open notebook before switching.
Inputs: path (required). Returns: result
read_cellC
Return one active cell by index with type and full source.
Inputs: index (required). Returns: object
remove_cellC
Remove a cell and return previews of affected neighboring cells.
Inputs: index (required). Returns: result
replace_cellC
Replace the full source of the cell at the given index.
Inputs: index (required), content (required). Returns: object
save_markdownC
Export active notebook cells to markdown block format on disk.
Inputs: path (required). Returns: object
save_notebookC
Validate and save the active notebook to current or new path.
Inputs: path. Returns: object
search_cellC
Search cells by space-separated keywords and return matches with snippets.
Inputs: keywords (required). Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 10 tools
remove_cell and delete_cell are explicit duplicates, and load_notebook/from_markdown plus save_notebook/save_markdown both involve disk I/O for different formats, causing some confusion despite descriptions clarifying differences.
Most tools follow a clear verb_noun snake_case pattern (e.g., load_notebook, read_cell), but from_markdown breaks the verb pattern with a preposition, creating a minor inconsistency.
10 tools is well-scoped for notebook cell manipulation, with each tool serving a distinct purpose except the redundant alias.
Covers cell CRUD, search, and markdown import/export, but lacks execution of code cells—a core Jupyter operation—and does not allow changing an existing cell's type, leaving notable gaps.
Maintenance
Related MCP Connectors
Remote MCP server for saving, searching, syncing, and managing Teak cards.
Hosted MCP server for Obsidian Sync vaults: read, search, edit notes. Not affiliated with Obsidian.
Token-free MCP server for structured RevoGrid Core, Pro, and Enterprise knowledge retrieval.
Related MCP Servers
- FlicenseAqualityDmaintenanceProvides tools for interacting with Jupyter notebooks, allowing users to read, add, and execute notebook cells. It supports full notebook execution and metadata retrieval through the FastMCP framework.52-
- AlicenseAqualityCmaintenanceAn MCP server for programmatically editing Jupyter notebooks, offering 29 tools for reading, modifying, and batch-processing notebooks without requiring a Jupyter server.2919 PyPI5MIT
- FlicenseNot gradedqualityCmaintenanceA local MCP server for reading, writing, and executing Jupyter notebooks using jupyter_client for direct kernel communication.-
- AlicenseNot gradedqualityDmaintenanceMCP server for Jupyter notebook navigation and editing. Reads .ipynb files directly as JSON, providing efficient tools for reading, searching, and modifying cells without needing a Jupyter server.MIT