Kaggle Provider
The Jupyter MCP Server can execute code against a Kaggle notebook runtime.
Kaggle exposes a Jupyter-compatible kernel behind an authenticating proxy, so the
server connects through the
code-sandboxes kaggle sandbox
variant.
For the full, engine-level credential and parameter reference, see the Kaggle sandbox guide in the code-sandboxes documentation.
Requirements
Install the Kaggle extra:
pip install "jupyter-mcp-server[kaggle]"
Install the sandbox extension package used by this provider:
pip install datalayer_mcp_sandboxes
Connection modes
Kaggle supports two connection modes:
- Batch mode (default): when no runtime URL/channels are configured, code
is executed via Kaggle's job API (
KaggleKernelExecutor). - Interactive mode: create or connect to a runtime kernel via
KaggleKernelClient.
Mode A: batch execution (default)
No RUNTIME_URL is required. Configure Kaggle credentials (for example
KAGGLE_API_TOKEN, or standard Kaggle credentials such as kaggle.json).
Optionally set SANDBOX_GPU to request a specific accelerator.
SANDBOX_VARIANT=kaggle
KAGGLE_API_TOKEN=...
SANDBOX_GPU=T4
Supported accelerator values include:
NvidiaTeslaP100NvidiaTeslaT4NvidiaTeslaT4HighmemNvidiaL4NvidiaL4X1NvidiaTeslaA100NvidiaH100NvidiaRtxPro6000
Friendly aliases such as P100, T4, A100, and H100 are accepted.
Note: Kaggle free-tier access is typically limited to
P100andT4.
Mode B: interactive create kernel (token-based)
| Parameter | Environment variable | Description |
|---|---|---|
| Server URL | RUNTIME_URL | Kaggle proxied runtime URL ending in /proxy |
| API token | KAGGLE_API_TOKEN (or RUNTIME_TOKEN) | Kaggle API token |
SANDBOX_VARIANT=kaggle
RUNTIME_URL=https://kkb-production.jupyter-proxy.kaggle.net/k/12345678/eyJ.../proxy
KAGGLE_API_TOKEN=...
Mode B: connect to an existing kernel
Use either:
RUNTIME_URL+RUNTIME_ID, orRUNTIME_CHANNELS_URL(the websocket URL from the notebook session)
Example channels URL:
wss://kkb-production.jupyter-proxy.kaggle.net/k/<n>/<jwt>/proxy/api/kernels/<kernel_id>/channels?session_id=<...>
How to obtain runtime values
The official Kaggle API (kaggle CLI / kagglehub) provides batch notebook/job
operations, but not interactive kernel WebSocket provisioning. Interactive
runtime values come from an active browser session:
- Open your notebook on kaggle.com and run a cell.
- Open DevTools (
F12) -> Network -> WS. - Find the
.../proxy/api/kernels/<id>/channels?...request and copy its URL.
You can parse RUNTIME_URL and RUNTIME_ID from that URL automatically by
setting RUNTIME_CHANNELS_URL.
Configuration
Default (batch mode):
SANDBOX_VARIANT=kaggle
KAGGLE_API_TOKEN=...
SANDBOX_GPU=T4
Interactive mode:
SANDBOX_VARIANT=kaggle
RUNTIME_URL=https://kkb-production.jupyter-proxy.kaggle.net/k/12345678/eyJ.../proxy
KAGGLE_API_TOKEN=...
Or via the command line:
jupyter mcp start \
--transport streamable-http \
--sandbox-variant kaggle \
--runtime-url "https://kkb-production.jupyter-proxy.kaggle.net/k/12345678/eyJ.../proxy" \
--runtime-token "${KAGGLE_API_TOKEN}" \
--port 4040
Existing-kernel flow:
jupyter mcp start \
--transport streamable-http \
--sandbox-variant kaggle \
--runtime-channels-url "wss://kkb-production.jupyter-proxy.kaggle.net/k/.../proxy/api/kernels/.../channels?session_id=..." \
--port 4040
Once connected, all notebook and cell execution tools run against the Kaggle runtime transparently.
When a Kaggle sandbox is active, execute_code prefers the sandbox streaming
execution path when available, so batch status/progress lines and output events
are surfaced in-order in the returned tool output.