jupyter-kernel-mcp
Provides tools for managing and executing code in Jupyter kernels with persistent state, supporting Python, TypeScript, and JavaScript.
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 Load the iris dataset and display summary statistics"
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
A Model Context Protocol (MCP) server that provides stateful Jupyter kernel development with multi-language support (Python, TypeScript, JavaScript) for AI agents and assistants.
Table of contents
Related MCP server: notebook-agent-mcp
Project description
With Jupyter Kernel MCP you can execute Python, TypeScript, and JavaScript code in persistent, isolated environments that maintain state between executionsโperfect for AI agents performing complex data analysis and development workflows.
Jupyter Kernel MCP helps you build stateful AI agent workflows that can load datasets, perform transformations, and analyze results across multiple interactions without losing variables or computed state.
Unlike traditional stateless code execution, Jupyter Kernel MCP preserves variables, imports, and computed results between AI agent messages, enabling sophisticated multi-step data science workflows.
Key Features
๐ Persistent State: Variables and imports persist between code executions
๐ Multi-Language Support: Python, TypeScript, and JavaScript kernels
๐ Multi-Kernel Support: Create and manage multiple isolated kernel environments
๐ค AI-Agent Ready: Seamless integration with Claude Code and other MCP clients
๐ Data Science Workflows: Perfect for iterative data analysis and exploration
โก Fast Communication: Direct socket-based communication with Jupyter kernels
๐ Easy Management: Simple kernel lifecycle management (start, stop, reset, list)
๐ Unified API: Single interface for all languages - no separate tools needed
Who this project is for
This project is intended for AI developers, data scientists, and automation engineers who want to build intelligent agents that can perform stateful data analysis and complex computational workflows.
Perfect for:
Building AI agents that analyze datasets across multiple interactions
Creating persistent computational environments for LLMs
Developing stateful data science workflows with AI assistants
Prototyping and exploring APIs with maintained context
Full-stack development with TypeScript/JavaScript and Python
Educational environments teaching multiple programming languages
Project dependencies
Before using Jupyter Kernel MCP, ensure you have:
Python 3.10 or higher - Required for MCP SDK compatibility
Claude Code, Cline, or another MCP client - To interact with the server
Jupyter dependencies - Automatically installed with the package
Node.js (for TypeScript/JavaScript) - Required for TSLAB kernels (optional)
TSLAB - TypeScript/JavaScript kernel support (optional)
Instructions for using Jupyter Kernel MCP
Get started with Jupyter Kernel MCP by installing the package and adding it to your MCP client.
Install Jupyter Kernel MCP
From PyPI (Recommended)
Install using pip:
pip install jupyter-kernel-mcpOr using uv:
uv add jupyter-kernel-mcpFrom GitHub (Development Version)
To install the latest development version directly from GitHub:
uv tool install git+https://github.com/codewithcheese/jupyter-kernel-mcp.gitVerify Installation
jupyter-kernel-mcp --helpOptional: Install TSLAB for TypeScript/JavaScript Support
To enable TypeScript and JavaScript kernels:
# Install TSLAB globally
npm install -g tslab
# or with pnpm
pnpm install -g tslab
# Install kernel specs
tslab install
# Verify kernels are available
jupyter kernelspec listYou should see tslab and jslab in the kernel list.
Configure with Claude Code
Add the server to Claude Code:
claude mcp add jupyter-kernel jupyter-kernel-mcpVerify the server is listed:
claude mcp list
Configure with other MCP clients
Add to your MCP client configuration (example for
mcp_config.json):{ "servers": { "jupyter-kernel": { "command": "jupyter-kernel-mcp" } } }
Run Jupyter Kernel MCP
The server starts automatically when called by your MCP client
No manual startup required - the server launches when your MCP client connects.
Start your first kernel:
In Claude Code or your MCP client:
Please start a new Jupyter kernel for data analysisExecute stateful code:
Load this dataset and show me the first few rows: import pandas as pd df = pd.read_csv('data.csv') df.head()Continue the analysis in follow-up messages:
Now group the data by category and calculate the mean valuesThe
dfvariable persists from the previous execution!
Available Tools
Tool | Description |
| Create a new Jupyter kernel for Python, TypeScript, or JavaScript |
| Execute code in any language kernel (auto-routes based on kernel type) |
| Show all active kernels with their languages |
| Display variables in a kernel's namespace |
| Get detailed kernel information |
| Stop and remove a specific kernel |
| Reset a kernel (clears all variables) |
Troubleshooting
Other troubleshooting resources:
Check server logs for detailed error messages
Verify your MCP client supports the required MCP protocol version
Ensure no firewall is blocking local kernel connections
Contributing guidelines
We welcome contributions! Please see our Contributing Guide for details on:
How to submit bug reports and feature requests
Development setup and testing procedures
Code style guidelines and review process
Additional documentation
For more information:
Model Context Protocol Specification - Official MCP documentation
Jupyter Client Documentation - Jupyter kernel communication protocol
Claude Code MCP Guide - Using MCP servers with Claude
How to get help
Need assistance? Here's how to get support:
GitHub Issues - Report bugs or request features
Email - Contact the maintainer at tom@codewithcheese.com
MCP Community - Join discussions in MCP community forums
Terms of use
Jupyter Kernel MCP is licensed under the MIT License.
Built with โค๏ธ for the AI agent development community
Available Tools
7 toolsexecute_codeA
Execute Python code in a persistent Jupyter kernel with maintained state.
Inputs: code (required), kernel_id (required), timeout. Returns: success, output, result, error, +1 more
get_kernel_statusARead-onlyIdempotent
Get detailed status information about a specific Jupyter kernel.
Inputs: kernel_id (required). Returns: kernel_id, status, created_at, language, +2 more
list_kernelsARead-onlyIdempotent
List all currently active Jupyter kernels with their status information.
Inputs: no named parameters. Returns: success, kernels, count, timestamp
list_variablesARead-onlyIdempotent
List all variables currently defined in the specified kernel's namespace.
Inputs: kernel_id (required). Returns: success, variables, count, timestamp, +1 more
reset_kernelADestructiveIdempotent
Reset a Jupyter kernel by clearing all variables and state while keeping the same ID.
Inputs: kernel_id (required). Returns: kernel_id, success, message, timestamp, +1 more
start_kernelA
Start a new Jupyter kernel with persistent state for code execution.
Inputs: env_path (required), language, kernel_id, python_env. Returns: kernel_id, success, message, timestamp, +1 more
stop_kernelADestructiveIdempotent
Stop and permanently remove a Jupyter kernel and all its state.
Inputs: kernel_id (required). Returns: kernel_id, success, message, timestamp, +1 more
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogโฆ
TDQS
Scored across 7 tools
Each tool targets a distinct operation: execution, kernel lifecycle, variable listing, and status. No overlapping functionality.
All tool names follow a consistent verb_noun pattern in lowercase snake_case, e.g., execute_code, reset_kernel.
7 tools is appropriate for managing Jupyter kernels: start, stop, reset, list, status, variable listing, and code execution. Not excessive or sparse.
Covers core kernel lifecycle and code execution. Missing features like interrupting a kernel or retrieving execution history, but essential operations are present.
Related MCP Connectors
Build Apps and run code in 30 languages โ sandboxed, with persistent sessions for agent loops.
Coding agents build full-stack apps in persistent workspaces and share them by link.
Persistent cloud workspaces for AI agents: run commands, edit files, use git and a browser.
Hosted runtime for persistent agent teams, durable workflows, memory, schedules, and goals.
Related MCP Servers
- AlicenseAqualityDmaintenanceEnables AI agents to create, read, edit, and execute Jupyter notebook cells, manage kernels, and connect to remote Jupyter servers.2128 PyPIMIT
- FlicenseNot gradedqualityDmaintenanceEnables AI agents to execute Jupyter notebook cells with persistent kernel state, output persistence, and structured JSON control surface.2-
- AlicenseAqualityDmaintenanceEnables AI assistants to securely execute Python and JavaScript code in sandboxed environments, with file management and package installation.771 npmMIT
- FlicenseNot gradedqualityDmaintenanceProvides a persistent Jupyter kernel for executing code, inspecting variables and dataframes, and checking SQL query plans, enabling agents to work with stateful Python sessions.-