Skip to content

v1.1.0 — Onboarding, Jupyter Proxy Attach, MCP 2026, Chunked Transfer & Warm TUI

Latest

Choose a tag to compare

@NguyenQuocDat06-AI NguyenQuocDat06-AI released this 05 Dec 10:32

Added

  • Zero-to-One Onboarding, 8-Layer Diagnostics & Safe MCP Setup (onboarding.py, server.py):
    • Added kgsh init (interactive & --non-interactive credential setup with live Kaggle token validation, automatic KGAT_... username resolution, and atomic 0600 .env writes).
    • Added kgsh doctor [--comp <slug>] [--no-net] [--json] executing 8 zero-GPU-cost checks (Python/SDK versions, credentials & live auth, Kaggle API/phone verification & weekly GPU/TPU quota, optional competition rules check, trycloudflare.com reachability, GitHub Releases reachability, prebuilt kgsh-tui availability, and orphan running GPU kernel detection).
    • Added kgsh setup <claude|cursor|windsurf|codex|antigravity> [--dry-run] [--config <path>] to safely merge the kgsh MCP server block into JSON or TOML configs with atomic 0600 .bak backups and zero secret leaks.
  • MCP 2026 ToolAnnotations & Live kaggle_up Progress (server.py, launcher.py):
    • Annotated all 14 MCP tools with MCP 2026 ToolAnnotations (readOnlyHint, destructiveHint, idempotentHint, openWorldHint) compatible with both mcp v1 and v2.
    • Upgraded kaggle_up to async with live ctx.report_progress(...) stage updates across kernel push, container boot, tunnel handshake, and readiness polling.
  • Interactive Notebook Attach Mode (attach.py, launcher.py, worker_template.py, server.py, bridge.py, tui/):
    • Added kgsh attach <jupyter_proxy_url> [-s <slot>] [-f] CLI command and kaggle_attach MCP tool (14th tool) to attach to an already-running Kaggle Interactive Notebook without consuming an extra headless commit slot.
    • Uses a zero-dependency Python stdlib RFC 6455 TLS WebSocket client over Jupyter Server's /api/kernels + /channels API to bootstrap worker_template.py (ATTACHED=True, no cloudflared/watchdog) on port 8765, then deletes the temporary kernel so notebook state stays untouched.
    • kgsh down / kaggle_down and TUI x cleanly detach attached sessions without pushing over or deleting the interactive notebook (even when local Kaggle API credentials are unset); kgsh ui displays [ATTACHED] badges across the header, Remote pane, status bar, and Workers modal.
  • Chunked Resumable Transfer & RAM-Only SecretsVault (client.py, sync.py, worker_template.py, server.py):
    • Added /fs/upload_chunk and /fs/download_range (default 16 MiB chunks, per-chunk SHA-256 verification, atomic .part finalize with EXDEV cross-device copy fallback, X-Total-Size lock, and automatic HTTP 404 fallback for older workers), enabling reliable multi-GB checkpoint/dataset transfers through Cloudflare Quick Tunnels with a 20 GiB disk-backed streaming tar ceiling.
    • Added in-memory SecretsVault (/secrets/set, /secrets/list, /secrets/clear) and kgsh secret set/list/clear CLI (KEY=VALUE, interactive getpass, --from-env NAME, --stdin NAME). Secrets live strictly in worker RAM (never written to disk), inject into PTY sessions (MAX_CANON-safe <=2048 B lines under set +o history with marker_seen version gating) and background jobs, and are redacted longest-first from PTY outputs, job logs, and events.
  • Warm TUI Bridge Daemon, FileEditor v2 & Transfer Progress HUD (bridge.py, tui/):
    • Added persistent NDJSON-RPC python -m kaggle_mcp.bridge --daemon sidecar with deadlock-free stderr draining, automatic one-shot fallback when busy (>500 ms) or unsupported, and one-time auto-restart—cutting TUI Kaggle API actions from ~1s cold Python startup to sub-100ms warm calls.
    • Upgraded FileEditor with 100-snapshot bounded Undo/Redo (Ctrl+Z, Ctrl+Y, Ctrl+Shift+Z), incremental Unicode-safe Find bar (Ctrl+F, Enter/F3, Shift+F3, Esc closes Find bar first), and unicode-width = "0.2" visual column/mouse hit-testing for Vietnamese combining marks and CJK characters.
    • Implemented full chunked upload/download parity in tui/src/worker.rs (pure-Rust FIPS 180-4 SHA-256, X-Upload-Filename-B64, streaming 20 GiB tar cap) with a live MB / total (%) transfer progress HUD and instant Esc cancellation (CancelToken + .part cleanup).

Security

  • SSRF IP-Pinned Attach & Local Proxy Token Redaction (attach.py, client.py, worker.rs):
    • Rejects loopback, private, link-local, CGNAT (100.64.0.0/10), multicast, reserved, metadata hostnames, and IPv6 transition addresses (IPv4-mapped, 6to4, Teredo, NAT64) before pinning the resolved IP on both HTTPS (httpcore/httpx) and TLS WebSocket (SNI) connections; local clients (attach.py, client.py, tui/src/worker.rs) scrub /k/<id>/<token> proxy paths across status outputs, diagnostics, and errors.
  • Vault Injection & Atomic Config Hardening (worker_template.py, onboarding.py):
    • Blocks dangerous env override keys (LD_PRELOAD, LD_LIBRARY_PATH, PYTHONPATH, PYTHONSTARTUP, PYTHONBREAKPOINT, BASH_ENV, ENV, PATH, etc.) with HTTP 403 on /secrets/set, redacts active vault secrets longest-first across worker PTY/job/event outputs, scrubs KGAT_* & secret env values before formatting onboarding diagnostics, and uses POSIX O_EXCL + nonce + short-write-safe atomic writes (0600) with atomic 0600 .bak backups in onboarding.py.

Install / Upgrade

pip install -U kaggle-shell-mcp
# or
uv tool upgrade kaggle-shell-mcp

Full Changelog: v1.0.1...v1.1.0