jupyter-kernel-mcp
Provides tools to connect to a Jupyter kernel and manage Jupyter notebooks, including creating, editing, executing, and deleting cells.
Click on "Install 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-mcpexecute 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-kernel-mcp
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-kernel- │ ◄──────────► │ Jupyter IPykernel │
│ (OpenCode) │ MCP tools │ mcp 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-kernel-mcp.gitThis makes the jupyter-kernel-mcp command available globally (managed by uv).
Option B: Install from local source (for development)
git clone https://github.com/qtalen/jupyter-kernel-mcp.git
cd jupyter-kernel-mcp
uv tool install --path . jupyter-kernel-mcpOption C: Install via pip
pip install git+https://github.com/qtalen/jupyter-kernel-mcp.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-kernel-mcp", "--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-kernel-mcp [--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-kernel-mcpis on your PATH:jupyter-kernel-mcp --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
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Latest Blog Posts
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/qtalen/jupyter-kernel-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server