ipykernel-mcp
The server provides a persistent Jupyter kernel for AI agents to run calculations, data analysis, plots, and code interactively while retaining state across turns.
Discover available Jupyter kernels and project virtual environments (
kernel_discover)Start a kernel by name or venv path, optionally with a custom working directory (
kernel_start)Check kernel status, connection info, Python executable, and ports (
kernel_status)Execute Python/R/Julia code and get stdout, stderr, last expression result, errors, and image outputs (
kernel_execute)Retrieve output of long-running executions using a message ID (
kernel_get_output)Stop, restart, or interrupt the kernel (
kernel_stop,kernel_restart,kernel_interrupt)Keep variables and data in memory across follow-up questions
Connect other Jupyter tools to the same kernel via the connection file
Work with local files, plots, and PNG/JPEG images when supported by the client and model
Provides tools for managing and executing code on Jupyter kernels, allowing AI agents to run calculations, data analysis, and plots in a persistent kernel environment.
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., "@ipykernel-mcp run a Python script to analyze the sales data"
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.
jupyter-kernel-mcp
Give your AI agent a persistent Jupyter kernel for calculations, data analysis, and plots. Variables, data, and functions stay available across follow-up requests.
Use an MCP-compatible client and a Jupyter installation with your chosen kernel.
See also example conversations and development setup.
Quick setup with uvx
Add this to your client's mcp.json, replacing the paths with absolute paths
on your machine:
{
"mcpServers": {
"jupyter-python": {
"command": "uvx",
"args": [
"--from", "git+https://github.com/0x0L/jupyter-kernel-mcp",
"jupyter-kernel-mcp",
"--jupyter", "/path/to/project/.venv/bin/jupyter",
"--kernel", "python3",
"--cwd", "/path/to/project"
]
}
}
}--jupyter and --kernel are required. Choose a kernel listed by your Jupyter
executable's kernelspec list command. --cwd is optional and defaults to the
server's working directory. Install analysis libraries in the kernel's environment.
Available Tools
8 toolskernel_discoverA
Discover available Jupyter kernel specs and project venvs.
Returns a list of dicts with keys: name, display_name, language, source. Use the "name" value as the kernel_name argument to kernel_start.
If scan_dir is provided, also checks for a .venv with ipykernel installed at that path and includes it as a "venv:" entry.
Inputs: scan_dir. Returns: result
kernel_executeA
Execute code on the running kernel and return structured output.
Output is returned as tagged text blocks: [stdout], [stderr], [result] (last expression value), [error] (with traceback), plus image blocks for plots and display calls.
If timeout is set and execution exceeds it, returns any output collected so far plus a [pending] block with a msg_id. Pass that msg_id to kernel_get_output to retrieve the rest. Without timeout, blocks until done.
Inputs: code (required), timeout.
kernel_get_outputA
Retrieve output for a pending execution by msg_id.
If still running, waits up to timeout seconds (or returns immediately if timeout is omitted). Returns the same tagged blocks as kernel_execute: [stdout], [stderr], [result], [error], images, and [pending] if not yet done.
Once complete output is returned, the record is cleaned up — calling again with the same msg_id will return an error.
Inputs: msg_id (required), timeout.
kernel_interruptA
Interrupt the running kernel (send SIGINT).
Use this to cancel a long-running execution without losing kernel state.
Inputs: no named parameters. Returns: result
kernel_restartA
Restart the kernel, clearing all variables, imports, and state.
Pending executions are discarded. The kernel process is replaced but the connection is preserved — no need to call kernel_start again.
Inputs: no named parameters. Returns: result
kernel_startA
Start a kernel by name, as returned by kernel_discover.
kernel_name is either a registered Jupyter spec name (e.g. "python3") or a venv reference ("venv:/path/to/project") from kernel_discover.
cwd sets the working directory. Defaults to the venv project dir for venv kernels, or the user's home directory for registered specs.
Only one kernel can run at a time — call kernel_stop first if one is already running.
Inputs: kernel_name (required), cwd. Returns: result
kernel_statusA
Return the current kernel status.
Returns a dict with: running, alive, project_dir, connection_file, python, pending_executions, transport, ip, shell_port, iopub_port. Returns {"running": False} if no kernel is running.
Inputs: no named parameters. Returns: object
kernel_stopA
Stop the running kernel and clean up resources.
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool targets a distinct lifecycle action on the kernel: discover, start, status, restart, interrupt, stop, execute, and get_output. There is no ambiguity between kernel_start/kernel_restart (start launches a new kernel, restart replaces the process while preserving connection), and kernel_execute/kernel_get_output are clearly separated (execute starts, get_output retrieves pending work).
All tools follow a consistent kernel_verb pattern: kernel_discover, kernel_start, kernel_status, kernel_restart, kernel_interrupt, kernel_stop, kernel_execute, kernel_get_output. The naming convention is uniform and predictable across the entire set.
Eight tools is a well-scoped set for a kernel-management MCP server. Each tool covers a distinct and necessary operation for the full kernel lifecycle without redundancy or bloat; the count feels appropriate for the domain.
The tool surface covers the full kernel lifecycle: discovery, start, status, restart, interrupt, stop, execute, and async output retrieval. The only potential gap is code completion/inspection, but for a kernel-execution server the lifecycle coverage is complete with no dead ends.
Maintenance
Related MCP Connectors
Shared memory MCP server for Claude Code, Codex, Gemini CLI and Cursor. Cited, editable.
Nifty's MCP server — exposes tasks, projects, messages, and files as tools for AI agents.
MCP server for generating rough-draft project plans from natural-language prompts.
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
Related MCP Servers
- FlicenseAqualityNot gradedmaintenanceA Model Context Protocol server that allows LLMs to interact with Python environments, enabling code execution, file operations, package management, and development workflows.9-
- FlicenseBqualityDmaintenanceAn MCP server that manages Python virtual environments using uv, allowing LLMs to reliably resolve dependencies and update virtual environments.67-
- AlicenseNot gradedqualityDmaintenanceAn MCP server that connects to existing IPython kernels, allowing Claude to execute code in a shared persistent environment with your IDE.131 PyPI2MIT
- 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.12101 PyPI9MIT