Ipython Mcp — independently scanned and version-tracked by SaferSkills.
SaferSkills independently audited Ipython Mcp (Agent Skill) and scored it 100/100 (green). The audit ran 55 deterministic rules across Security, Supply Chain, Maintenance, Transparency, and Community; it found 0 high-severity and 0 lower-severity findings. The full rule-by-rule trace and per-finding evidence are below. Free, methodology-open.
Findings & checks · 0 flagged
Every scanned point with the score it earned and what moved between them.
First recorded scan — no prior version to compare against.
The primary manifest — the file an agent reads to learn what this artifact does.
An MCP server that connects to existing IPython kernels, allowing Claude to execute code in a shared persistent environment with your IDE.
MCP is an open protocol created by Anthropic that enables AI systems to interact with external tools and data sources. While currently supported by Claude (Desktop and CLI), the open standard allows other LLMs to adopt it in the future.
⚠️ Important for Windows users: For optimal functionality, it is highly recommended to run both the MCP server and your IPython kernel inside WSL (Windows Subsystem for Linux). This ensures the server can interrupt infinite loops and runaway queries that LLMs might accidentally generate.
Running the MCP server on Windows (outside WSL) disables interrupt functionality, which is critical for escaping problematic code during AI-assisted development sessions.
ipython, zmq and mcp Python packagesFor first-time users, the fastest way to get started:
ipython kernel claude mcp add ipython-kernel "uv run ipython_mcp/server.py" claudeThen connect to your kernel:
> connect to my ipython kernel using connection file ~/.local/share/jupyter/runtime/kernel-12345.json
● ipython-kernel:connect_to_kernel (MCP)(connection_file: "~/.local/share/jupyter/runtime/kernel-12345.json")
⎿ ✅ Connected to IPython kernel at 127.0.0.1:5555
> execute x = 42; print(f"x = {x}")
● ipython-kernel:execute_code (MCP)(code: "x = 42; print(f'x = {x}')")
⎿ x = 42Run directly with uv (no pip installation required, may be slower on startup; best for trying it out at first):
claude mcp add ipython-kernel "uv run ipython_mcp/server.py"#### pip (recommended for regular use)
pip install ipython-mcpNote: Consider using a virtual environment to avoid dependency conflicts:
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
pip install ipython-mcp##### Adding to Claude CLI
After installation:
claude mcp add ipython-kernel ipython-mcp##### Adding to Claude Desktop
Add to your Claude Desktop configuration file:
{
"mcpServers": {
"ipython-kernel": {
"command": "ipython-mcp"
}
}
}For uv-based installation:
{
"mcpServers": {
"ipython-kernel": {
"command": "uv",
"args": [
"--directory",
"/absolute/path/to/ipython-mcp",
"run",
"ipython_mcp/server.py"
]
}
}
}Option 1: Using the demo connection file (recommended for testing)
ipython kernel --ConnectionFileMixin.connection_file=~/ipython-mcp/demo_connection.jsonThis uses predictable ports (5555-5559) and makes it easy to connect.
Option 2: Basic kernel start
ipython kernelIPython will create a random connection file. Note the output path:
[IPKernelApp] Connection file: /home/user/.local/share/jupyter/runtime/kernel-12345.jsonOption 3: From your IDE
Option 4: With custom connection file
ipython kernel --ConnectionFileMixin.connection_file=my_connection.jsonConnection files are typically located in:
# List active kernels
ls ~/.local/share/jupyter/runtime/
# Example files:
# kernel-12345.json
# kernel-67890.jsonstart_kernel(connection_file=None) - Start new IPython kernel and auto-connectconnect_to_kernel(connection_file=None) - Connect to existing IPython kernelexecute_code(code) - Execute Python code on the connected kernelkernel_status() - Check current connection statusdisconnect_kernel() - Disconnect from current kernelThe tools use this priority for finding connection files:
connection_file argument (highest priority)IPYTHON_MCP_CONNECTIONdefault_connection.json (ports 5555-5559)IPYTHON_MCP_CONNECTION - Default connection file path to use when none specifiedSimplest approach - let the MCP server handle everything:
# In Claude CLI, start a kernel using package defaults
> start a new ipython kernel
# The tool will:
# 1. Use built-in default_connection.json (ports 5555-5559)
# 2. Start IPython kernel in background
# 3. Auto-connect to it
# 4. Return connection details
# Now execute code
> run: import pandas as pd; df = pd.DataFrame({'a': [1,2,3]})Using environment variable:
# Set your preferred connection file
export IPYTHON_MCP_CONNECTION=/path/to/my/connection.json
# In Claude CLI
> start a new ipython kernel
# Will use your env var connection fileManual kernel startup (traditional approach):
# 1. Start kernel manually
ipython kernel
# 2. In Claude CLI, connect to the kernel
> connect to my ipython kernel using ~/.local/share/jupyter/runtime/kernel-12345.json
# 3. Execute code
> run: import pandas as pd; df = pd.DataFrame({'a': [1,2,3]})This project is designed with Spyder IDE in mind due to its unique features:
While other IDEs can work with this MCP server, Spyder provides a smooth experience for data science workflows where you want both interactive coding and AI assistance on the same persistent Python environment.
This MCP server uses Jupyter's standard connection protocol with HMAC-SHA256 message signing.
IF you're using this locally (single-user machine):
demo-key-12345) is perfectly fineBUT IF you need enhanced security (shared machines, network access, production):
# Generate a secure connection file with random key
python -c "
import json, secrets
conn = {
'shell_port': 5555, 'iopub_port': 5556, 'stdin_port': 5557,
'control_port': 5558, 'hb_port': 5559, 'ip': '127.0.0.1',
'key': secrets.token_hex(32), 'transport': 'tcp',
'signature_scheme': 'hmac-sha256', 'kernel_name': ''
}
print(json.dumps(conn, indent=2))
" > secure_connection.json
# Use your secure connection file (via env var or explicit parameter)
export IPYTHON_MCP_CONNECTION=secure_connection.json
ipython kernel --ConnectionFileMixin.connection_file=secure_connection.jsonAdditional Security Measures:
chmod 600 your_connection.jsonWhen using Claude CLI on Windows (which runs in WSL), you may want to run the IPython kernel on the Windows side while keeping the MCP server in WSL. This allows you to use Windows Python environments (like Miniconda) while still accessing them from Claude CLI.
Start Windows IPython kernel from WSL:
# Using PowerShell to start kernel in background
powershell.exe -Command "Start-Process -WindowStyle Hidden cmd -ArgumentList '/c', 'C:\Users\<USERNAME>\miniconda3\Scripts\activate.bat C:\Users\<USERNAME>\miniconda3 && python -m ipykernel_launcher -f <PATH_TO_CONNECTION_JSON>'"Where <PATH_TO_CONNECTION_JSON> can be:
\\\\wsl.localhost\\Ubuntu\\home\\<USER>\\my_connection.json\\\\wsl.localhost\\Ubuntu\\home\\<USER>\\.local\\lib\\python3.x\\site-packages\\ipython_mcp\\default_connection.json\\\\wsl.localhost\\Ubuntu\\home\\<USER>\\ipython-mcp\\src\\ipython_mcp\\default_connection.jsonThis approach:
Skip this section if you're not on Windows.
Since Claude CLI is WSL-only on Windows, but you might want to use Windows Python environments or IDEs, you need proper port communication between WSL2 and Windows.
#### .wslconfig File Setup Location: C:\Users\{YourUsername}\.wslconfig
Add mirrored networking configuration:
# Mirrored networking mode for seamless port communication
networkingMode=mirrored
dnsTunneling=true
firewall=true
autoProxy=true#### Restart WSL2 Run from Windows PowerShell/CMD (NOT from within WSL):
wsl --shutdown
# Wait a few seconds, then start WSL again#### What Mirrored Networking Provides
#### Test Port Communication
Test WSL2 → Windows (localhost):
# In WSL2, test connection to Windows IPython kernel
python -c "import zmq; ctx = zmq.Context(); sock = ctx.socket(zmq.REQ); sock.connect('tcp://127.0.0.1:5555'); print('Connection successful')"Test Windows → WSL2 (localhost):
# In Windows, test connection to WSL2 service
python -c "import zmq; ctx = zmq.Context(); sock = ctx.socket(zmq.REQ); sock.connect('tcp://127.0.0.1:5555'); print('Connection successful')"#### Known Limitations of Mirrored Networking
This MCP server acts as a bridge between Claude and existing IPython kernels:
The MCP Server manages:
The User manages:
Why this separation?
The start_kernel tool is provided as a convenience helper - not a requirement. Many users prefer to start kernels through their IDE, Jupyter, or custom scripts.
IPython kernels support two different interrupt modes that determine how clients can stop running code:
1. Signal Mode (Default)
2. Message Mode
interrupt_request messages via the control socket (Jupyter protocol)"interrupt_mode": "message"This MCP server implements a dual-method approach that works with both interrupt modes:
Method 1: Jupyter Protocol (First Attempt)
interrupt_request messages via the control socketinterrupt_mode: "message"Method 2: OS Signal Fallback
psutil to send SIGINT directly to the kernel processinterrupt_mode: "signal"The interrupt tool first tries the control socket approach, then falls back to direct SIGINT if needed.
This approach ensures reliable kernel management across different configurations and platforms without requiring users to modify their kernel setup.
~30 seconds. Free. No account. Every finding cites a rule and a line of evidence.