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 分