jupyter-notebook-mcp-server
Jupyter Notebook MCP Server
Documentation
Jupyter Notebook MCP Server
A FastMCP server that provides tools for interacting with Jupyter notebooks. Built using the FastMCP framework.
Features
- โ Read notebook cells with filtering
- โ Add new cells at any position
- โ Execute individual cells
- โ Execute entire notebooks
- โ Get notebook metadata and statistics
- โ Proper error handling and validation
- โ Progress reporting for long operations
- โ Comprehensive logging via FastMCP Context
Integration with your MCP Client
Make sure uv is installed.
To use this server with cursor, claude desktop or any other MCP client, add the following to your mcp config file:
{
"mcpServers": {
"jupyter-notebook": {
"command": "uv",
"args": [
"run",
"--with",
"fastmcp>=2.8.1",
"python",
"/main.py"
]
}
}
}Testing
Run the test client to see all functionality in action:
python test_client.pySecurity Notes
- Cell execution runs Python code directly via subprocess
- Only execute notebooks from trusted sources
- Consider running in a sandboxed environment for production use
- Timeout controls help prevent runaway executions
Dependencies
- `fastmcp` - MCP server framework
Tools
This MCP server provides the following tools for working with Jupyter notebooks:
๐ `read_notebook_cells`
Read cells from a Jupyter notebook with optional filtering by cell type.
Parameters:
- `notebook_path` (str): Path to the .ipynb file
- `cell_type` (optional str): Filter by cell type ('code', 'markdown', 'raw')
โ `add_cell_to_notebook`
Add a new cell to a Jupyter notebook at a specified position.
Parameters:
- `notebook_path` (str): Path to the .ipynb file
- `cell_content` (str): Content of the new cell
- `cell_type` (str, default="code"): Type of cell ('code', 'markdown', 'raw')
- `position` (optional int): Position to insert cell (default: append to end)
- `metadata` (optional dict): Optional cell metadata
โก `execute_notebook_cell`
Execute a specific cell in a Jupyter notebook.
Parameters:
- `notebook_path` (str): Path to the .ipynb file
- `cell_index` (int): Index of the cell to execute (0-based)
- `kernel_name` (str, default="python3"): Jupyter kernel to use
- `timeout` (int, default=30): Execution timeout in seconds
๐ `execute_entire_notebook`
Execute all code cells in a Jupyter notebook sequentially.
Parameters:
- `notebook_path` (str): Path to the .ipynb file
- `kernel_name` (str, default="python3"): Jupyter kernel to use
- `timeout_per_cell` (int, default=30): Timeout per cell in seconds
- `stop_on_error` (bool, default=True): Whether to stop execution if a cell fails
๐ `get_notebook_info`
Get basic information about a Jupyter notebook.
Parameters:
- `notebook_path` (str): Path to the .ipynb file
Frequently asked questions
What is jupyter-notebook-mcp-server?
jupyter-notebook-mcp-server is Jupyter Notebook MCP Server
How do I install jupyter-notebook-mcp-server?
Open the GitHub repository and follow its README. Most MCP servers are added to your client's MCP config, then called by your agent.
Is jupyter-notebook-mcp-server open source?
Yes โ it is hosted on GitHub at https://github.com/shwetalsoni/jupyter-notebook-mcp-server and has 2 stars.
Related MCP tools
AI Observability & Evaluation for the Model Context Protocol. Enhance AI assistants with powerful integrations. Jupyter Notebook-based implementation.
Model Context Protocol Servers
Pre-indexed code knowledge graph, auto syncs on code changes, for Claude Code, Codex, Gemini, Cursor, OpenCode, AntiGravity, Kiro, CoPilot, and Hermes Agent โ fewer tokens, fewer tool calls, 100% local
an open source, extensible AI agent that goes beyond code suggestions - install, execute, edit, and test with any LLM
The easy-to-use open source Business Intelligence and Embedded Analytics tool that lets everyone work with data :bar_chart:
The Open-Source Multimodal AI Agent Stack: Connecting Cutting-Edge AI Models and Agent Infra
Run your own MCP server? See who uses it and what to fix.
Measure it with TrackMCP