kaggle mcp服务器
该项目提供了一个MCP(模型上下文协议)服务器,用于从Claude Desktop(或任何兼容MCP的客户端)与Kaggle进行交互
🚀 设置
1.克隆存储库并安装依赖项
pip install -r requirements.txt2.配置Kaggle API凭据
Go to your Kaggle account -> Settings
Scroll to API section → click Create New API Token.
This will download a file called kaggle.json.
Place kaggle.json in the following location on your system:
Linux/Mac:
~/.kaggle/kaggle.json
Windows:
C:\Users\\.kaggle\kaggle.json3.配置克劳德桌面
To connect Claude with this MCP server, create or update the file:
Claude/claude_desktop_config.json
with the following contents:
{
"mcpServers": {
"Kaggle": {
"command": "
",
"args": ["
"]
}
}
}
Replace
with the path to your Python interpreter (e.g. python or C:/Python/python.exe).
Replace
with the path to this repo’s kaggle-server.py file.📜 用法
Once configured:
Start Claude Desktop.
Start the Kaggle MCP server (Run kaggle-server.py as a Python File).
You can now use MCP tools defined in kaggle-server.py, for example:
get_competitions_list: Fetches the list of available Kaggle competitions and returns them in a JSON-friendly format.🛠️ 关于代码
kaggle-server.py registers MCP tools using the @mcp.tool() decorator.
The server communicates with Claude via MCP and exposes Kaggle API methods.
Example tool:
@mcp.tool()
def get_competitions_list() -> list[dict]:
"""
Fetch the list of available Kaggle competitions.
"""✅ 需求
Python 3.10+
Kaggle API credentials (kaggle.json)
Dependencies listed in requirements.txt🔒 安全说明
Never commit your kaggle.json file.
Ensure the .kaggle folder has restricted permissions.