Skip to content

Add a single-language Jupyter kernel with a Python transport - #190

Draft
t-kalinowski wants to merge 2 commits into
feat/integrator-controlfrom
feat/python-jupyter-kernel
Draft

t-kalinowski wants to merge 2 commits into
feat/integrator-controlfrom
feat/python-jupyter-kernel

Conversation

@t-kalinowski

Copy link
Copy Markdown
Member

Expose Console's R, Python, and SQL sessions as standard Jupyter kernels so unmodified Kallichore can launch them and execute ordinary source.

Adds mcp-console kernel --language {r,python,sql} --connection-file PATH --config-file PATH. Each process accepts one source language, submits code unchanged, and retains objects across executions and frontend reconnects. Standard Jupyter messages carry streams, images, results, structured errors, managed stdin, interrupts, and shutdown. Execution remains active until Console finishes; the control channel stays responsive during preparation and execution. Restart retires the old process and starts from launch configuration.

The embedded Python transport uses jupyter_client and pyzmq, installed through the optional mcp-console[jupyter] extra and selected with --jupyter-python. It starts one native controller over private JSONL pipes. The controller reuses Console's preparation, execution, sandbox, interruption, and recording owners. Internal worker events now distinguish language errors and expression results from ordinary text. Both transport and controller remain outside the workload sandbox. Cargo.toml and Cargo.lock are unchanged, and existing MCP entry points remain available.

Includes launch documentation, ordinary REST request examples, and runnable direct-Jupyter and Kallichore integration harnesses covering state, output, errors, stdin, interruption, reconnect, restart, cleanup, package preparation, and sandbox behavior. Completion and inspection return minimal responses; there are no per-request language or requirements fields, LSP, debugger, or Positron extensions. Kallichore's existing REST/MCP execution collector disables stdin; interactive input uses its existing channel interface.

Based on #185 and targets feat/integrator-control, so this diff contains only the additional controller support and Jupyter adapter.

Keep Jupyter transport in an optional Python environment while reusing the
integrator execution lifecycle, preparation, sandboxing, and recordings.
Expose typed output and execution outcomes, managed stdin, pinned interrupts,
and process-owned retirement through a private native controller transport.

Cover standard execution, state, output, errors, stdin, interruption, restart,
reconnect, and cleanup through the public Jupyter interface.
Describe the independent transport Python environment and standard session
requests. Provide a runnable harness for unmodified Kallichore covering
execution, input, preparation, sandboxing, reconnection, and process cleanup.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant