kaggle-mcp

kaggle-mcp

It interacts with the Kaggle API to provide tools for searching and downloading datasets, and a prompt for generating EDA notebooks.

Category
Visit Server

README

smithery badge

Kaggle MCP (Model Context Protocol) Server

This repository contains an MCP (Model Context Protocol) server (server.py) built using the fastmcp library. It interacts with the Kaggle API to provide tools for searching and downloading datasets, and a prompt for generating EDA notebooks.

Project Structure

  • server.py: The FastMCP server application. It defines resources, tools, and prompts for interacting with Kaggle.
  • .env.example: An example file for environment variables (Kaggle API credentials). Rename to .env and fill in your details.
  • requirements.txt: Lists the necessary Python packages.
  • pyproject.toml & uv.lock: Project metadata and locked dependencies for uv package manager.
  • datasets/: Default directory where downloaded Kaggle datasets will be stored.

Setup

  1. Clone the repository:

    git clone <repository-url>
    cd <repository-directory>
    
  2. Create a virtual environment (recommended):

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    # Or use uv: uv venv
    
  3. Install dependencies: Using pip:

    pip install -r requirements.txt
    

    Or using uv:

    uv sync
    
  4. Set up Kaggle API credentials:

    • Method 1 (Recommended): Environment Variables
      • Create .env file
      • Open the .env file and add your Kaggle username and API key:
        KAGGLE_USERNAME=your_kaggle_username
        KAGGLE_KEY=your_kaggle_api_key
        
      • You can obtain your API key from your Kaggle account page (Account > API > Create New API Token). This will download a kaggle.json file containing your username and key.
    • Method 2: kaggle.json file
      • Download your kaggle.json file from your Kaggle account.
      • Place the kaggle.json file in the expected location (usually ~/.kaggle/kaggle.json on Linux/macOS or C:\Users\<Your User Name>\.kaggle\kaggle.json on Windows). The kaggle library will automatically detect this file if the environment variables are not set.

Running the Server

  1. Ensure your virtual environment is active.
  2. Run the MCP server:
    uv run kaggle-mcp
    
    The server will start and register its resources, tools, and prompts. You can interact with it using an MCP client or compatible tools.

Server Features

The server exposes the following capabilities through the Model Context Protocol:

Tools

  • search_kaggle_datasets(query: str):
    • Searches for datasets on Kaggle matching the provided query string.
    • Returns a JSON list of the top 10 matching datasets with details like reference, title, download count, and last updated date.
  • download_kaggle_dataset(dataset_ref: str, download_path: str | None = None):
    • Downloads and unzips files for a specific Kaggle dataset.
    • dataset_ref: The dataset identifier in the format username/dataset-slug (e.g., kaggle/titanic).
    • download_path (Optional): Specifies where to download the dataset. If omitted, it defaults to ./datasets/<dataset_slug>/ relative to the server script's location.

Prompts

  • generate_eda_notebook(dataset_ref: str):
    • Generates a prompt message suitable for an AI model (like Gemini) to create a basic Exploratory Data Analysis (EDA) notebook for the specified Kaggle dataset reference.
    • The prompt asks for Python code covering data loading, missing value checks, visualizations, and basic statistics.

Connecting to Claude Desktop

Go to Claude > Settings > Developer > Edit Config > claude_desktop_config.json to include the following:

{
  "mcpServers": {
    "kaggle-mcp": {
      "command": "kaggle-mcp",
      "cwd": "<path-to-their-cloned-repo>/kaggle-mcp"
    }
  }
}

Usage Example

An AI agent or MCP client could interact with this server like this:

  1. Agent: "Search Kaggle for datasets about 'heart disease'"
    • Server executes search_kaggle_datasets(query='heart disease')
  2. Agent: "Download the dataset 'user/heart-disease-dataset'"
    • Server executes download_kaggle_dataset(dataset_ref='user/heart-disease-dataset')
  3. Agent: "Generate an EDA notebook prompt for 'user/heart-disease-dataset'"
    • Server executes generate_eda_notebook(dataset_ref='user/heart-disease-dataset')
    • Server returns a structured prompt message.
  4. Agent: (Sends the prompt to a code-generating model) -> Receives EDA Python code.

Recommended Servers

playwright-mcp

playwright-mcp

A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.

Official
Featured
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

graphlit-mcp-server

The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.

Official
Featured
TypeScript
Kagi MCP Server

Kagi MCP Server

An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

Exa Search

A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured