python-notebook-mcp
by UsamaK98·★ 45·Score 42
A Python MCP server for AI assistants to create, edit and view Jupyter notebooks.
Overview
Python Notebook MCP is a lightweight server that enables AI assistants like Cursor and Claude Desktop to interact with Jupyter notebooks through the Model Context Protocol. It allows initializing a workspace and then performing various operations on notebook files including creating, reading, editing cells, and accessing cell outputs. The server is well-documented with clear setup instructions for different operating systems and multiple installation methods.
Try asking AI
After installing, here are 5 things you can ask your AI assistant:
When to choose this
Choose this server when working with Jupyter notebooks in AI environments that need programmatic access to notebook files without full execution capabilities.
When NOT to choose this
Don't choose this if you need actual code execution capabilities within the notebooks or if you're working with non-Jupyter notebook formats.
Tools this server exposes
9 tools extracted from the READMEinitialize_workspaceinitialize_workspace(directory: str)Sets the absolute path for the workspace directory.
list_notebookslist_notebooks()Lists all .ipynb files found within the workspace directory.
create_notebookcreate_notebook(filepath: str, title: str)Creates a new, empty Jupyter notebook if it doesn't exist.
read_notebookread_notebook(filepath: str)Reads the entire structure and content of a notebook.
read_cellread_cell(filepath: str, cell_index: int)Reads the content and metadata of a specific cell by index.
edit_celledit_cell(filepath: str, cell_index: int, content: str)Modifies the source content of an existing cell by index.
add_celladd_cell(filepath: str, content: str, cell_type: str, index: int = null)Adds a new code or markdown cell at a specific index or at the end.
read_notebook_outputsread_notebook_outputs(filepath: str)Reads all outputs from all code cells in a notebook.
read_cell_outputread_cell_output(filepath: str, cell_index: int)Reads the output(s) of a specific code cell by index.
Comparable tools
Installation
Installation
- Clone the repository:
git clone https://github.com/UsamaK98/python-notebook-mcp.git
cd python-notebook-mcp- Create and activate virtual environment:
uv venv
source .venv/bin/activate # or .venv\Scripts\activate.bat on Windows- Install dependencies:
uv pip install -r requirements.txtClaude Desktop Configuration
Add to claude_desktop_config.json:
{
"mcpServers": {
"jupyter": {
"command": "/full/path/to/.venv/bin/python",
"args": ["/full/path/to/server.py"]
}
}
}Alternative with fastmcp
fastmcp install server.py --name "Jupyter Notebook MCP"FAQ
- What's the first step I need to take after connecting to the server?
- You must initialize the workspace using the initialize_workspace tool with the absolute path to your project directory containing notebooks.
- Can I use relative paths for notebook files?
- No, the server requires absolute paths for all notebook operations. Relative paths like '.' are not accepted.
Compare python-notebook-mcp with
Last updated · Auto-generated from public README + GitHub signals.