Jupyter Notebook

Jupyter Notebook

Connect Claude AI to Jupyter Notebook via MCP for AI-assisted notebook control and execution.

112
Stars
22
Forks
0
Releases

Overview

JupyterMCP enables Claude AI to directly interact with and control a Jupyter Notebook (version 6.x) through the Model Context Protocol (MCP). The solution establishes two-way, WebSocket-based communication between Claude and a running Jupyter instance, allowing AI-driven operations such as inserting and executing cells, saving notebooks, and retrieving notebook information. The system comprises three main components: a WebSocket Server inside Jupyter (jupyter_ws_server.py) that bridges notebook communication, a Client JavaScript (client.js) that runs in the notebook to perform operations, and an MCP Server (jupyter_mcp_server.py) that implements MCP and connects to the WebSocket server. Installation steps describe prerequisites (Python 3.12+, uv), a kernel install, and Claude desktop integration configuration to launch the MCP server via uv. Usage highlights include starting the Jupyter nbclassic server, selecting the jupyter-mcp kernel, initializing the WebSocket server from Python, and launching Claude with MCP. Available Claude tools cover code insertion, execution, notebook and cell management, and retrieving outputs. This integration is experimental and should be used with caution while evaluating its capabilities in AI-assisted notebook workflows.

Details

Owner
jjsantos01
Language
Jupyter Notebook
License
MIT License
Updated
2025-12-07

Features

Two-way communication

Establish two-way WebSocket-based communication between Claude and the Jupyter notebook, enabling bidirectional control and data exchange.

Cell manipulation

Insert, execute, and manage notebook cells from Claude.

Notebook management

Save notebooks and retrieve notebook information.

Cell execution

Run specific cells or all cells in a notebook.

Output retrieval

Get output content from executed cells, with options to limit text.

WebSocket Server inside Jupyter

jupyter_ws_server.py sets up a WebSocket server inside Jupyter that bridges notebook communication with external clients.

Client JavaScript integration

client.js runs in the notebook to handle operations (inserting cells, executing code, etc.).

MCP Server implementation

jupyter_mcp_server.py implements the Model Context Protocol and connects to the WebSocket server.

Audience

Claude AI usersControl and interact with Jupyter Notebooks from Claude to perform AI-assisted coding, data analysis, and visualization.
Data scientists / researchersLeverage Claude to orchestrate notebook operations and execute analytics workflows within Jupyter 6.x.
Jupyter developers / MCP integratorsInstall and run the MCP components to bridge Claude and Jupyter notebooks via WebSocket.

Tags

JupyterClaude AIMCPWebSocketNotebookCode executionNotebook managementAI-assisted analysisVisualization