A Model Context Protocol (MCP) server for interacting with Kaggle competitions through Claude or other compatible AI assistants.
Want to understand the full potential of this server? Check out the detailed article:
AI-Powered Data Science Revolution: How Kaggle MCP Server Transforms AI Capabilities
- Node.js 16 or higher
- TypeScript
- Kaggle CLI installed (
pip install kaggle
) - Kaggle API credentials configured
There are two ways to authenticate with the Kaggle API:
- Install the Kaggle CLI:
pip install kaggle
- Go to https://www.kaggle.com/account and click "Create New API Token"
- This will download a
kaggle.json
file with your credentials - Create a
.kaggle
directory in your home folder (if it doesn't exist)
# On Linux/Mac
mkdir -p ~/.kaggle
# On Windows (PowerShell)
New-Item -ItemType Directory -Force -Path "$HOME\.kaggle"
- Move the downloaded
kaggle.json
file to the.kaggle
directory:
# On Linux/Mac
mv ~/Downloads/kaggle.json ~/.kaggle/
chmod 600 ~/.kaggle/kaggle.json # Set permissions
# On Windows (PowerShell)
Move-Item -Path "$HOME\Downloads\kaggle.json" -Destination "$HOME\.kaggle\kaggle.json"
You can directly add your Kaggle credentials to your claude_desktop_config.json
file:
{
"mcpServers": {
"kaggle": {
"command": "node",
"args": ["/path/to/build/index.js"],
"env": {
"KAGGLE_USERNAME": "your-kaggle-username",
"KAGGLE_KEY": "your-kaggle-api-key"
}
}
}
}
Replace your-kaggle-username
and your-kaggle-api-key
with your actual Kaggle credentials.
- Clone this repository
- Install dependencies:
npm install
- Build the project:
npm run build
npm start
Or directly:
node build/index.js
Add the following configuration to your claude_desktop_config.json
file.
Once connected to Claude, you can ask questions like:
- "Show me the active Kaggle competitions"
- "Search for image classification competitions"
- "Download the files for the Titanic competition"
- "Submit my predictions.csv file to the housing-prices competition with the message 'Random forest model'"
- "Show me my submissions for the digit-recognizer competition"
If you encounter authentication errors:
-
Verify your credentials are correctly set:
- If using
kaggle.json
, check it's in the correct location:- Linux/Mac:
~/.kaggle/kaggle.json
- Windows:
C:\Users\<USERNAME>\.kaggle\kaggle.json
- Linux/Mac:
- If using environment variables, check the
env
section in yourclaude_desktop_config.json
- If using
-
For
kaggle.json
, check if the file has the correct permissions:- On Linux/Mac, run:
chmod 600 ~/.kaggle/kaggle.json
- On Linux/Mac, run:
-
Make sure your API token is still valid. If needed, generate a new one from your Kaggle account page.
If the Kaggle CLI is not found:
- Make sure you have installed it with:
pip install kaggle
- Verify that the Kaggle command is in your PATH by running:
kaggle --version
The server currently provides the following operations for Kaggle competitions:
- List all active Kaggle competitions
- Search competitions by keyword
- Support for pagination to browse through results
- Display competition details including name, category, deadline, and prize
- Download files for any competition
- Specify custom download path
- Force re-download of existing files
- Works with all public competition datasets
- Submit prediction files to competitions
- Add custom submission messages
- Get immediate feedback on submission status
- Requires prior acceptance of competition rules on Kaggle website
- View submission history for a specific competition
- See submission status and scores
- Track multiple submissions over time
All the features previously listed as "Coming Soon" are now available in the feature-complete
branch of this repository. This includes:
- Dataset Operations: Browse, search, download, and analyze datasets from Kaggle
- Notebook Integration: Work with Kaggle notebooks directly from your AI assistant
- User Management: Check profile information and competition standings
- Competition Analysis: Get detailed competition metrics and leaderboard insights
Check out the feature-complete
branch for the most up-to-date and comprehensive implementation of the Kaggle MCP server.
MIT