Kaggle MCP Server
以下摘录自该仓库的 README(片段) · 在 GitHub 读完整 README →
A Model Context Protocol (MCP) server that exposes Kaggle dataset search, download, and EDA prompt generation to MCP clients such as Claude Desktop.
Features
- Search Kaggle datasets by keyword.
- Download and unzip Kaggle datasets locally.
- Generate a starter Exploratory Data Analysis (EDA) prompt for a Kaggle dataset.
- Supports Kaggle credentials via environment variables or the standard kaggle.json file.
- Runs locally, in Docker, or through Smithery.
Available MCP Capabilities
Tools
search_kaggle_datasets(query: str)
Searches Kaggle for datasets matching query and returns up to 10 results as JSON.
Returned fields include:
- ref
- title
- subtitle
- download_count
- last_updated
- usability_rating
download_kaggle_dataset(dataset_ref: str, download_path: str | None = None)
Downloads and unzips a Kaggle dataset.
- dataset_ref: Kaggle dataset reference in owner/dataset-slug format, for example kaggle/titanic.
- download_path: Optional local output path. If omitted, files are saved to ./datasets/ /.
Prompts
generate_eda_notebook(dataset_ref: str)
Creates a prompt for generating basic Python EDA code for the provided Kaggle dataset reference. The prompt asks for data loading, missing-value checks, visualizations, and summary statistics.
Requirements
- Python 3.10+
- Kaggle account and API token
- An MCP-compatible client
Kaggle Credentials
Create a Kaggle API token from your Kaggle account settings:
1. Go to .
2. Select **Create New API Token**.
3. Download kaggle.json.
Use either environment variables or the standard Kaggle config file.
Option 1: Environment variables
Create a .env file in the project root:
Option 2: kaggle.json
Place kaggle.json in the standard Kaggle location:
- macOS/Linux: ~/.kaggle/kaggle.json
- Windows: C:\Users\ \.kaggle\kaggle.json
On macOS/Linux, make sure the file is not world-readable:
Installation
Create and activate a virtual environment:
Install dependencies with one of the following methods.
Using uv
Using pip
Running Locally
With uv:
Or run the server module directly:
The server communicates over MCP stdio and is intended to be launched by an MCP client.
Claude Desktop Configuration
Open Claude Desktop settings, then go to **Developer** > **Edit Config** and add this server to claude_desktop_config.json.
If installed in the project environment:
If using kaggle.json, you can omit the env block.
Docker
Build the image:
Run with credentials from .env:
Smithery
This repository includes smithery.yaml. Smithery starts the server over stdio and passes these configuration values as environment variables: