Jupyter Notebook MCP Server
Interact with Jupyter notebooks, allowing for code execution, cell manipulation, and notebook management.
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",
"<absolute_path_to_jupyter_mcp_server>/main.py"
]
}
}
}
Testing
Run the test client to see all functionality in action:
python test_client.py
Security 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 filecell_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 filecell_content(str): Content of the new cellcell_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 filecell_index(int): Index of the cell to execute (0-based)kernel_name(str, default="python3"): Jupyter kernel to usetimeout(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 filekernel_name(str, default="python3"): Jupyter kernel to usetimeout_per_cell(int, default=30): Timeout per cell in secondsstop_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
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Integrated MCPs Guide
An integrated MCP server combining Azure DevOps, Gmail, Browser, and Gemini AI functionalities on a Node.js server.
Codelogic
Utilize Codelogic's rich software dependency data in your AI programming assistant.
ActionKit MCP Starter
A demonstration server for ActionKit, providing access to Slack actions via Claude Desktop.
CircleCI
Enable AI Agents to fix build failures from CircleCI.
Typst MCP Server
Provides Typst documentation to MCP clients like Claude Code.
MLflow MCP Server
Integrates with MLflow, enabling AI assistants to interact with experiments, runs, and registered models.
Cygnus MCP Server
A simple MCP server exposing Cygnus tools for demonstration, including 'cygnus_alpha' and 'invoke-service'.
Choose MCP Server
An MCP server for integration with the Claude Desktop Client, with optional DBT manifest path configuration.
AltTester® AI Extension
MCP server for game test automation
Code Council
Your AI Code Review Council - Get diverse perspectives from multiple AI models in parallel.