Safe Kaggle MCP

io.github.parkseokjune由 GitHub 帳號 parkseokjune 發布v0.4.1更新於 Oct 24, 2026

Safety-first Kaggle MCP — confirm-gated destructive ops, submission budget, injection-fenced.

概覽

AI 產生的概覽

一個安全優先的 Kaggle MCP 伺服器,讓助理瀏覽競賽、資料集、核心與模型,執行 EDA,並在確認閘門與每日預算限制下提交預測。

可以做什麼
把助理連接到 Kaggle 的競賽、資料集、核心(notebook)與模型。工具涵蓋競賽概況篩選、資料集搜尋與預覽、精簡 EDA 摘要、訓練/測試結構差異與目標自動辨識、提交預覽與提交、最佳分數與排行榜追蹤、唯讀討論與解題文章摘要、核心推送/狀態/輸出、資料集版本化,以及工作階段稽核日誌。提交、刪除、公開發布等不可逆操作需要先預覽再提交的確認權杖,Kaggle 回傳的文字會被標記為不受信任內容。
適用情境
當你希望助理用自然語言驅動 Kaggle 工作流程時使用:篩選進行中的競賽、下載並探索資料、在 Kaggle 算力上執行 notebook、在預算內提交預測,以及追蹤分數或排行榜變化。適合需要嚴格管控破壞性步驟的自主循環。
執行需求
以 stdio 方式在本機執行,從 PyPI 安裝 safe-kaggle-mcp,用 uvx 啟動(需要 Python/uv 執行環境)。唯讀工具不需要憑證;如需驗證,可用 KAGGLE_USERNAME 搭配 KAGGLE_KEY,或使用從 ~/.kaggle/access_token 讀取的 KGAT_ 權杖。需要連線到 Kaggle API 的網路。選用開關:KAGGLE_MCP_ENABLE_DESTRUCTIVE、KAGGLE_MCP_ENABLE_PUBLISH、KAGGLE_MCP_SUBMISSION_CAP。
安裝前請注意
它會處理 Kaggle 憑證(KAGGLE_USERNAME、KAGGLE_KEY、KAGGLE_API_TOKEN);README 表示憑證不會進入模型上下文並會被遮蔽。刪除資料集/模型等破壞性工具與公開發布預設關閉,僅在設定 KAGGLE_MCP_ENABLE_DESTRUCTIVE 與 KAGGLE_MCP_ENABLE_PUBLISH 後啟用,且每次仍需確認權杖。提交會消耗每日每競賽預算(KAGGLE_MCP_SUBMISSION_CAP,預設 5)且不可撤銷。下載的壓縮檔會寫入本機磁碟。

安裝

在 SourceWeft 中

  1. 開啟 儀表板中的 Safe Kaggle MCP,將其新增到工作區。
  2. 為需要使用其工具的對話啟用該服務。

Desktop only,透過 STDIO。 STDIO 服務會啟動本機處理程序,因此需要 SourceWeft 桌面主機。

其他 MCP 客戶端

參照 儲存庫 中的啟動說明。

README

kaggle-mcp

[CI] [PyPI] [smithery] [Python] [License: MIT]

A safety-first Model Context Protocol server connecting Claude (Desktop / Code) to Kaggle — competitions, datasets, kernels (notebooks), and models.

safe-kaggle-mcp is the only Kaggle MCP built safety-first. Every irreversible action — submit, delete, public-publish — is gated behind a two-call preview→commit confirm token, a per-competition submission budget surfaced in every response, and off-by-default destructive flags, while all Kaggle-returned text is fenced in <untrusted-content> and your credentials never enter the model context. Other servers chase tool count and the official remote server wins on zero-install convenience — but none of them, official included, gate a single destructive call, cap submissions, or harden against prompt injection. It trades raw breadth for the one thing an autonomous agent with your Kaggle account actually needs: it cannot quietly burn your daily submissions, leak your key, publish your private work, or be hijacked by a poisoned discussion thread.

bash
claude mcp add --transport stdio kaggle -- uvx --from safe-kaggle-mcp kaggle-mcp

How it compares

Featuresafe-kaggle-mcpTypical community serverOfficial remote / Composio
Two-call preview→commit confirm tokens (submit/delete/publish)✅ Yes❌ No (single-shot)❌ No (single-shot)
Per-competition submission budget surfaced to the agent✅ Yes (default 5/day)❌ No❌ No (opaque server quota)
Prompt-injection hardening (<untrusted-content> fencing)✅ Yes❌ No❌ No
Private-by-default + off-by-default destructive/publish flags✅ Yes⚠️ Optional is_private param❌ No
No in-chat authenticate() + 40-hex credential redaction✅ Yes❌ Some leak the key into context⚠️ OAuth keeps key out, no redaction
Zip-slip-safe / sandboxed downloads✅ Yes❌ No❌ Can't sandbox local writes
Callable local EDA tool (compact pandas digest, never raw rows)✅ Yes (dataset + competition)❌ EDA prompt at best❌ No
Competition train/test schema diff + target auto-detect✅ Yes❌ No❌ No
Competition landscape triage (days-left, budget, metric)✅ Yes❌ Thin raw list❌ Raw fields, no digest
Submission best-score digest (metric-aware best/trend/failures)✅ Yes❌ Raw list❌ Raw list
Leaderboard delta tracking (local snapshots + rank moves)✅ Yes❌ No❌ No API endpoint either
Session audit ledger of mutating actions (redacted)✅ Yes❌ No❌ No
Read-only discussion + write-up digest, injection-fenced✅ Yes (untrusted-fenced)⚠️ Yes but unfenced (Galaxy-Dawn)⚠️ Unfenced
One-call competition kickoff (data + EDA + baseline plan)✅ Yes❌ No❌ No
Output discipline (ranked/capped tables, pagination, top-N)✅ Yes❌ Undocumented❌ Client's job
Modern KGAT_ token + legacy username/key auth✅ Both⚠️ Mostly legacy-only✅ OAuth 2.0
InstallLocal stdio (PyPI + git, uvx)Local (pip/uv)✅ Zero-install remote
Raw tool breadth41 tools (no benchmark listing — API exposes none)up to ~51~35–57

The two honest places we don't lead: the official remote server is zero-install, and the broadest community server (Galaxy-Dawn, ~51 tools) has more raw endpoints (e.g. benchmarks). Where they expose ~10 forum tools unfenced, we expose read-only discussion search + read with every body fenced as <untrusted-content> — and no posting tool, because the API has none.

What you can do with it

Drive your whole Kaggle workflow from a Claude chat, in plain language:

Ask Claude…What happens under the hood
"Triage active competitions — prize, metric, days left."kaggle_competition_landscape (one digested, deadline-sorted report)
"Download titanic data, infer the target, and do an EDA."kaggle_eda_competition → train/test schema diff (auto-target) + compact pandas digest
"Find a good Titanic dataset and show me what it looks like."kaggle_search_datasets → kaggle_dataset_preview (capped, untrusted-fenced rows)
"Summarize the iris dataset."kaggle_eda_dataset → shape, dtypes, missingness, target dist, top correlations
"Submit predictions.csv to titanic and tell me the score."kaggle_preview_submission → kaggle_submit_to_competition (token + budget gate) → kaggle_get_submission_score
"Is it worth iterating — what's my best score so far?"kaggle_submission_best_score (metric-aware best/trend/failures + today's budget)
"Did anyone pass me on the leaderboard since last check?"kaggle_leaderboard_track (snapshot deltas, who passed you)
"What techniques are people discussing for this competition?"kaggle_search_discussions → kaggle_get_discussion (read-only, every post untrusted-fenced)
"Find the winning solution write-ups for this competition."kaggle_search_writeups → kaggle_get_discussion
"Kick off this competition for me."kaggle_competition_kickoff — one call: metric + rules + data download + train/test EDA (auto-target) + baseline plan + budget
"What mutating actions have I taken this session?"kaggle_audit_log (redacted ledger of every submit/create/delete)
"Run this notebook on Kaggle's free GPU and get the output."kaggle_push_kernel → kaggle_kernel_status → kaggle_kernel_output
"Save my engineered features as a private dataset version."kaggle_version_dataset — private by default

Higher-order workflows the agent chains itself: an autonomous competition loop (download → train → submit → read score → iterate, within the daily budget), Kaggle as a remote GPU/TPU backend, and cross-run memory via private dataset versions. Every irreversible step is gated, so the agent can run autonomously without risking your account.

What it won't do (honest limits)

Some competitors advertise capabilities the public Kaggle API can't actually deliver. We refuse to ship dishonest stubs:

  • No posting to forums/discussions. The API can read topics but has no create/reply/vote endpoint — so we don't pretend to.
  • No private-leaderboard or final-rank prediction. Private scores are withheld until the deadline; our tools label scores as public-only.
  • No historical leaderboard from Kaggle. There's no such endpoint — kaggle_leaderboard_track diffs against snapshots you captured locally, and says so.
  • No hidden test labels / private splits. We only ever serve files the competition exposes.

Install

bash
# fastest: install + register with Claude Codeclaude mcp add --transport stdio kaggle -- uvx --from safe-kaggle-mcp kaggle-mcp
# or straight from this repo (no PyPI):claude mcp add --transport stdio kaggle -- uvx --from git+https://github.com/parkseokjune/kaggle-mcp kaggle-mcp
# or for developmentuv sync --extra dev && uv run kaggle-mcp

The PyPI distribution is safe-kaggle-mcp (the name kaggle-mcp was taken); the command it installs is still kaggle-mcp, so launch it with uvx --from safe-kaggle-mcp kaggle-mcp.

Get a token at https://www.kaggle.com/settings → API → Create New Token. Both schemes work (resolved in order):

bash
# 1) legacy username/key (env or ~/.kaggle/kaggle.json)export KAGGLE_USERNAME=your_userexport KAGGLE_KEY=your_40_char_key
# 2) current API token (KGAT_...): the client reads it automaticallymkdir -p ~/.kaggle && echo "KGAT_..." > ~/.kaggle/access_token && chmod 600 ~/.kaggle/access_token

Claude Desktop — edit claude_desktop_config.json, then fully restart:

json
{ "mcpServers": { "kaggle": {  "command": "uvx", "args": ["--from", "safe-kaggle-mcp", "kaggle-mcp"],  "env": { "KAGGLE_USERNAME": "your_user", "KAGGLE_KEY": "your_key" } } } }

Safety switches (default OFF → read-only / private posture)

Env varDefaultEffect when 1
KAGGLE_MCP_ENABLE_DESTRUCTIVE0Exposes kaggle_delete_dataset / kaggle_delete_model
KAGGLE_MCP_ENABLE_PUBLISH0Allows creating public datasets
KAGGLE_MCP_SUBMISSION_CAP5Per-competition daily submission budget

Even when enabled, each destructive call still needs a one-time confirm_token from its *_preview_* tool, and is recorded in kaggle_audit_log.

Tools

41 tools across account, competitions, datasets, discussions, kernels, models — plus kaggle:// resources (metadata, leaderboard, rules) and /kaggle-eda, /kaggle-submit-checklist, /kaggle-landscape, /kaggle-solution-research prompts. Run kaggle_status to see your auth + submission budget.

Verified live against the Kaggle API (kaggle 2.2.2) with both auth schemes; 53 offline + 6 live read-only tests pass.

Develop

bash
uv run pytest                              # offline unit + integration testsKAGGLE_LIVE=1 uv run pytest tests/test_live_readonly.py   # live read-only smoke (needs creds)uv run mcp dev src/kaggle_mcp/server.py    # MCP Inspector

License

MIT

來源:README.md,提交 33a5e69

工具

0
SourceWeft 尚未在沙箱中啟動過該軟體包,因此其工具未知。

版本歷史

1
  1. v0.4.1最新Sep 16, 2026

評分

已滿足適用檢查項的 50%

該評分衡量此收錄條目的完整程度,依據註冊中心條目、端點與公開來源計算得出。它不是對伺服器本身的評價,也不表示伺服器安全或目前可用:可連通性是帶日期的檢查結果,評分也不包含安裝量或使用者評價。

  • 近 30 天內可連通25 分

    請保持端點能夠回應 MCP 握手;SourceWeft 每 30 天探測一次。

  • 已宣告認證方式10 分

    請在註冊中心條目中宣告憑證請求標頭,或保持端點能夠回應探測,以便判定其認證方式。

  • 已列出工具15 分

    請讓伺服器在無憑證時回應 tools/list,或發布可在沙箱中無憑證啟動的軟體包。

  • 描述必需15 分
  • 圖示10 分
  • 文件15 分
  • 授權條款10 分