jupyter-kernel-mcp
This server enables AI agents to fully manage and execute Jupyter Notebooks by connecting directly to a Jupyter kernel — no JupyterLab or Notebook server required.
Connect to a Jupyter kernel: Start or reuse a kernel (e.g.,
python3) as the execution backend for all notebook operations.Open or create notebooks: Attach an existing
.ipynbfile to the session, or create a new one if it doesn't exist.Read all notebook cells: List all cells — either as a quick summary or in full detail including source code, outputs, and embedded images.
Inspect individual cells: Read the source code and outputs (including inline base64 PNG images) of a specific cell by index.
Insert cells: Add new code or markdown cells at any position in the notebook, or append to the end.
Edit cell source: Perform find-and-replace operations on an existing cell's source code; outputs are cleared upon edit.
Delete cells: Remove any cell from the notebook by its index.
Execute notebook cells: Run a specific code cell within the notebook context, with configurable timeout and progress reporting; results are saved back to the
.ipynbfile.Execute arbitrary Python code: Run any Python code snippet directly on the kernel outside the notebook context, useful for quick experiments or inspection.
Provides tools to connect to a Jupyter kernel and manage Jupyter notebooks, including creating, editing, executing, and deleting cells.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@jupyter-kernel-mcp execute cell 2 in my notebook"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
I share an in-depth data science and AI project practice every month. Visit and subscribe to https://www.dataleadsfuture.com
jupyter-mcp-kernel
An MCP (Model Context Protocol) server that connects directly to a Jupyter kernel via ZMQ — no JupyterLab or Notebook server required.
Enable your AI assistant to read, create, edit, execute, and manage Jupyter Notebooks as MCP tools.
Architecture
┌──────────────┐ stdio ┌──────────────────┐ ZMQ ┌────────────────┐
│ AI Agent │ ◄────────────► │ jupyter-mcp- │ ◄──────────► │ Jupyter IPykernel │
│ (OpenCode) │ MCP tools │ kernel server │ │ (python3) │
└──────────────┘ └──────────────────┘ └────────────────┘
│
┌─────┴──────┐
│ .ipynb │
│ (on disk) │
└────────────┘The server communicates with the kernel over ZMQ channels (iopub, shell, stdin, control) and persists notebook files to disk after every modification.
Related MCP server: cursor-notebook-mcp
Prerequisites
Python ≥ 3.10
ipykernelinstalled (so the kernel can start). If not sure:python -m ipykernel install --useruv(recommended) orpip
Installation
Option A: Install from GitHub (recommended for end users)
uv tool install git+https://github.com/qtalen/jupyter-mcp-kernel.gitThis makes the jupyter-mcp-kernel command available globally (managed by uv).
Option B: Install from local source (for development)
git clone https://github.com/qtalen/jupyter-mcp-kernel.git
cd jupyter-mcp-kernel
uv tool install --path . jupyter-mcp-kernelOption C: Install via pip
pip install git+https://github.com/qtalen/jupyter-mcp-kernel.gitRegister with OpenCode
Add the following mcp entry to your project's opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"jupyter": {
"type": "local",
"command": ["jupyter-mcp-kernel", "--cell-timeout", "7200"],
"enabled": true,
"timeout": 7200000
}
}
}Then restart OpenCode. The 8 MCP tools will appear automatically.
Available Tools
All tools are registered as @mcp.tool() and are callable by your AI agent once the MCP server is connected.
1. connect_to_jupyter
Item | Value |
Description | Start (or reuse) a Jupyter kernel. Must be called before any other operation. |
Parameters |
|
Returns |
|
2. use_notebook
Item | Value |
Description | Open an existing |
Parameters |
|
Returns |
|
3. read_notebook
Item | Value |
Description | List all cells. In simple mode, returns a TSV summary (index, type, preview, output count). In detailed mode, returns full source + outputs for every cell. |
Parameters |
|
Returns | `list[TextContent |
4. read_cell
Item | Value |
Description | Read a single cell's source code and its outputs. |
Parameters |
|
Returns | `list[TextContent |
5. insert_cell
Item | Value |
Description | Insert a new code or markdown cell at a specified index. |
Parameters |
|
Returns |
|
6. edit_cell_source
Item | Value |
Description | Find and replace text in an existing cell's source. Clears outputs. |
Parameters |
|
Returns |
|
7. delete_cell
Item | Value |
Description | Remove a cell by index. |
Parameters |
|
Returns |
|
8. execute_cell
Item | Value |
Description | Execute a code cell in the open notebook. Supports long execution with timeout and progress reporting. Results are saved back to the |
Parameters |
|
Returns | `list[TextContent |
9. execute_code
Item | Value |
Description | Execute arbitrary Python code directly on the kernel (outside the notebook context). Useful for quick experiments or inspection. |
Parameters |
|
Returns | `list[TextContent |
Typical Workflow
A typical AI-driven notebook session follows these steps:
connect_to_jupyter(kernel_name="python3")
→ "Kernel ready — python3"
use_notebook(path="notebooks/my_analysis.ipynb")
→ "Using notebook: C:/.../my_analysis.ipynb (0 cells)"
insert_cell(source="# My Analysis\n\n## Objective\n...", index=0, cell_type="markdown")
→ "Inserted markdown cell at index 0"
insert_cell(source="import pandas as pd\ndf = pd.read_csv('data.csv')", index=1)
→ "Inserted code cell at index 1"
execute_cell(cell_index=1)
→ [...] + "[COMPLETED in 2s]"
read_cell(cell_index=1)
→ Shows source + any output
edit_cell_source(cell_index=1, old_string="data.csv", new_string="data_v2.csv")
→ "Cell 1 updated: replaced 1 occurrence of 8 → 11 chars"
execute_cell(cell_index=1)
→ [...] + "[COMPLETED in 3s]"
delete_cell(cell_index=2)
→ "Deleted cell 2 (code)"CLI Options
jupyter-mcp-kernel [--cell-timeout SECONDS]Option | Default | Description |
|
| Default execution timeout per cell (seconds). Can be overridden per-call via |
Troubleshooting
Kernel fails to start
Ensure
ipykernelis installed:python -m ipykernel install --userVerify the kernel name. Run
jupyter kernelspec listto see available kernels.Check for proxy issues. The server automatically adds
localhost,127.0.0.1toNO_PROXY.
No tools appear in OpenCode
Confirm
jupyter-mcp-kernelis on your PATH:jupyter-mcp-kernel --helpCheck
opencode.jsonsyntax and path.Restart OpenCode entirely after configuration changes.
Cell execution hangs indefinitely
The default timeout is 7200s (2h). Use
execute_cell(timeout_seconds=120)for shorter tasks.The kernel may be stuck. Use
execute_cell(progress_interval=5)to see progress updates.OpenCode can cancel execution via SIGINT → the server will interrupt the kernel.
Windows-specific
The server registers
SIGBREAK(Ctrl+Break) for graceful shutdown on Windows.Paths with spaces are supported if quoted correctly in
opencode.json.
License
MIT
Available Tools
9 toolsconnect_to_jupyterC
Connect to a Jupyter kernel. Starts one if not already running.
Inputs: kernel_name. Returns: result
delete_cellC
Delete a cell by index.
Inputs: cell_index (required). Returns: result
edit_cell_sourceC
Find and replace text in a cell's source code.
Inputs: cell_index (required), new_string (required), old_string (required). Returns: result
execute_cellC
Execute a code cell in the open notebook and save results.
Inputs: cell_index (required), timeout_seconds, progress_interval. Returns: result
execute_codeA
Execute arbitrary Python code directly (outside the notebook context).
Inputs: code (required), timeout. Returns: result
insert_cellB
Insert a new code or markdown cell at the given index.
Inputs: source (required), index, cell_type. Returns: result
read_cellA
Read a single cell by index with its outputs.
Inputs: cell_index. Returns: result
read_notebookB
List all cells in the open notebook with optional detailed content.
Inputs: detailed. Returns: result
use_notebookC
Open or create a notebook file and attach it to the session.
Inputs: path (required), kernel_name. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 9 tools
Tools have mostly distinct purposes, but 'execute_cell' and 'execute_code' could confuse agents due to similar names despite different contexts. Other tools are clearly separated.
Most tools follow a verb_noun pattern (e.g., delete_cell, insert_cell), but 'connect_to_jupyter' and 'edit_cell_source' deviate slightly. Overall consistent.
9 tools is well-scoped for a Jupyter kernel server, covering connection, notebook management, cell operations, and code execution without excess.
Covers core CRUD for cells and execution, but missing kernel management tools like restart or interrupt, and no explicit save/close functionality.
Maintenance
Related MCP Connectors
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
Hosted MCP server connecting AI assistants to 9,000+ apps and 40,000+ actions via Zapier.
One MCP server for the services your AI needs: memory, files, Microsoft 365, kanban and more.
MCP server for your apps' tools and custom tools, plus hosted AI agents and approval-gated workflows
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceA Model Control Protocol (MCP) server that enables remote programmatic control of Jupyter notebooks, allowing AI assistants and applications to create, edit, and execute notebook cells via SSE protocol.-
- FlicenseNot gradedqualityDmaintenanceAn MCP server that enables AI agents to create, read, edit, and manage Jupyter Notebook files programmatically, overcoming limitations in Cursor's native notebook support.188 PyPI161-
- AlicenseAqualityDmaintenanceAI-powered MCP server for connecting and managing Jupyter Notebooks. Enables interactive code execution, multi-notebook management, and multimodal output for data analysis, visualization, and machine learning.12135 PyPI9MIT
- FlicenseNot gradedqualityCmaintenanceA local MCP server for reading, writing, and executing Jupyter notebooks using jupyter_client for direct kernel communication.-