Skip to main content
Glama
ipykernel-mcp

ipykernel-mcp

by 0x0L

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 tools
kernel_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

    A4.2/5.0

    Scored across 8 tools

    Disambiguation5/5

    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).

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness5/5

    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

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      Not graded
      maintenance
      A Model Context Protocol server that allows LLMs to interact with Python environments, enabling code execution, file operations, package management, and development workflows.
      9
      -
    • F
      license
      B
      quality
      D
      maintenance
      An MCP server that manages Python virtual environments using uv, allowing LLMs to reliably resolve dependencies and update virtual environments.
      6
      7
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server that connects to existing IPython kernels, allowing Claude to execute code in a shared persistent environment with your IDE.
      131 PyPI
      2
      MIT