Python Notebook MCP is an MCP server that allows AI assistants to interact directly with local Jupyter notebook files (.ipynb). Built with FastMCP and Python 3.10+, it connects clients like Cursor and Claude Desktop to a local directory workspace containing project notebooks. The server is designed for data scientists, developers, and machine learning researchers who want automated tools to inspect, generate, and edit computational notebooks without manually copying code across applications. Once initialized with a local workspace directory, Python Notebook MCP exposes tools to discover notebook files, inspect complete notebook structures, read individual cell metadata, and add or update code and markdown cells by index. It also provides capabilities to retrieve execution outputs from individual cells or across entire notebooks, making it possible for models to review past execution errors and guide iterative data analysis workflows directly within existing environments.
Category: Data & Analytics
Tags: code-execution, data-science, jupyter, notebooks, python
uv are installed. 2. Clone the repository: bash git clone https://github.com/UsamaK98/python-notebook-mcp.git cd python-notebook-mcp 3. Run the automated setup script (bash ./install_unix.sh on macOS/Linux or .\install_windows.ps1 on Windows), or create a virtual environment manually using uv venv and run uv pip install -r requirements.txt. 4. For Claude Desktop, register the server by running: bash fastmcp install server.py --name "Jupyter Notebook MCP" 5. For Cursor or manual configuration, add the server to mcp.json using the absolute path to your Python virtual environment executable: json { "mcpServers": { "jupyter": { "command": "/absolute/path/to/python-notebook-mcp/.venv/bin/python", "args": ["/absolute/path/to/python-notebook-mcp/server.py"] } } }.ipynb files across a local data science repository using list_notebooks to map project structure. - Creating new analysis notebooks and inserting boilerplate code or markdown documentation cells via create_notebook and add_cell. - Reviewing computational results and error traces by calling read_cell_output or read_notebook_outputs after execution runs. - Updating and refactoring existing notebook scripts cell-by-cell with edit_cell to correct errors or update dependencies.Part of MCP Servers
Clone the repository from GitHub, create a virtual environment using uv, and install the dependencies from requirements.txt. You can also run the included automated setup scripts for Unix or Windows. For Claude Desktop, install it using the fastmcp CLI via fastmcp install server.py.
The server works with any Model Context Protocol client that supports local stdio connections. It has documented support for Cursor via client configuration files like mcp.json, and Claude Desktop through fastmcp registration.
You must first call the initialize_workspace tool from your AI assistant, providing the full absolute path to the directory containing your Jupyter notebooks. Relative paths are rejected by the server.
The server can list Jupyter notebooks in a workspace, create new notebook files, read full notebook JSON structures, read and edit specific cells by index, add new code or markdown cells, and extract cell execution outputs.
Yes, Python Notebook MCP is open source and licensed under the MIT License. The code and license details can be inspected on the official GitHub repository.