Skip to main content
Glama

대장간 배지

Kaggle MCP(모델 컨텍스트 프로토콜) 서버

이 저장소에는 fastmcp 라이브러리를 사용하여 구축된 MCP(Model Context Protocol) 서버( server.py )가 포함되어 있습니다. Kaggle API와 연동하여 데이터세트 검색 및 다운로드 도구와 EDA 노트북 생성 기능을 제공합니다.

프로젝트 구조

  • server.py : FastMCP 서버 애플리케이션입니다. Kaggle과 상호 작용하기 위한 리소스, 도구 및 프롬프트를 정의합니다.

  • .env.example : 환경 변수(Kaggle API 자격 증명)에 대한 예제 파일입니다. 파일 이름을 .env 로 바꾸고 세부 정보를 입력하세요.

  • requirements.txt : 필요한 Python 패키지를 나열합니다.

  • pyproject.toml & uv.lock : uv 패키지 관리자에 대한 프로젝트 메타데이터와 잠긴 종속성.

  • datasets/ : 다운로드된 Kaggle 데이터세트가 저장되는 기본 디렉토리입니다.

Related MCP server: Kaggle-MCP

설정

  1. 저장소를 복제합니다.

    지엑스피1

  2. 가상 환경을 만듭니다(권장):

    python -m venv venv
    source venv/bin/activate  # On Windows use `venv\Scripts\activate`
    # Or use uv: uv venv
  3. 종속성 설치: pip 사용:

    pip install -r requirements.txt

    또는 uv를 사용하면:

    uv sync
  4. Kaggle API 자격 증명을 설정하세요.

    • 방법 1(권장): 환경 변수

      • .env 파일 생성

      • .env 파일을 열고 Kaggle 사용자 이름과 API 키를 추가하세요.

        KAGGLE_USERNAME=your_kaggle_username
        KAGGLE_KEY=your_kaggle_api_key
      • Kaggle 계정 페이지( Account > API > Create New API Token )에서 API 키를 얻을 수 있습니다. 그러면 사용자 이름과 키가 포함된 kaggle.json 파일이 다운로드됩니다.

    • 방법 2: kaggle.json 파일

      • Kaggle 계정에서 kaggle.json 파일을 다운로드하세요.

      • kaggle.json 파일을 예상 위치(Linux/macOS에서는 일반적으로 ~/.kaggle/kaggle.json , Windows에서는 C:\Users\<Your User Name>\.kaggle\kaggle.json )에 넣으세요. 환경 변수가 설정되어 있지 않으면 kaggle 라이브러리가 자동으로 이 파일을 감지합니다.

서버 실행

  1. 가상 환경이 활성화되어 있는지 확인하세요.

  2. MCP 서버를 실행합니다.

    uv run kaggle-mcp

    서버가 시작되고 리소스, 도구 및 프롬프트가 등록됩니다. MCP 클라이언트 또는 호환 도구를 사용하여 서버와 상호 작용할 수 있습니다.

Docker 컨테이너 실행

1. Kaggle API 자격 증명 설정

이 프로젝트에서는 Kaggle 데이터 세트에 액세스하기 위해 Kaggle API 자격 증명이 필요합니다.

  • https://www.kaggle.com/settings 로 가서 "새 API 토큰 만들기"를 클릭하여 kaggle.json 파일을 다운로드하세요.

  • kaggle.json 파일을 열고 사용자 이름과 키를 프로젝트 루트의 새 .env 파일에 복사합니다.

KAGGLE_USERNAME=your_username
KAGGLE_KEY=your_key

2. Docker 이미지 빌드

docker build -t kaggle-mcp-test .

3. .env 파일을 사용하여 Docker 컨테이너를 실행합니다.

docker run --rm -it --env-file .env kaggle-mcp-test

이렇게 하면 Kaggle 자격 증명이 컨테이너 내부의 환경 변수로 자동 로드됩니다.


서버 기능

서버는 모델 컨텍스트 프로토콜을 통해 다음과 같은 기능을 제공합니다.

도구

  • search_kaggle_datasets(query: str) :

    • 제공된 쿼리 문자열과 일치하는 Kaggle의 데이터 세트를 검색합니다.

    • 참조, 제목, 다운로드 횟수, 마지막 업데이트 날짜와 같은 세부 정보와 함께 상위 10개 일치 데이터 세트의 JSON 목록을 반환합니다.

  • download_kaggle_dataset(dataset_ref: str, download_path: str | None = None) :

    • 특정 Kaggle 데이터 세트에 대한 파일을 다운로드하고 압축을 풉니다.

    • dataset_ref : username/dataset-slug 형식의 데이터세트 식별자(예: kaggle/titanic ).

    • download_path (선택 사항): 데이터 세트를 다운로드할 경로를 지정합니다. 생략하면 서버 스크립트 위치를 기준으로 ./datasets/<dataset_slug>/ 기본값으로 지정됩니다.

프롬프트

  • generate_eda_notebook(dataset_ref: str) :

    • 지정된 Kaggle 데이터 세트 참조에 대한 기본 탐색적 데이터 분석(EDA) 노트북을 생성하는 데 적합한 AI 모델(예: Gemini)에 적합한 프롬프트 메시지를 생성합니다.

    • 이 프롬프트에서는 데이터 로딩, 누락된 값 확인, 시각화 및 기본 통계를 다루는 Python 코드를 요구합니다.

Claude Desktop에 연결

Claude > 설정 > 개발자 > 구성 편집 > claude_desktop_config.json으로 이동하여 다음을 포함합니다.

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

사용 예

AI 에이전트나 MCP 클라이언트는 다음과 같이 이 서버와 상호 작용할 수 있습니다.

  1. 상담원: "Kaggle에서 '심장병' 관련 데이터 세트를 검색하세요."

    • 서버가 search_kaggle_datasets(query='heart disease') 실행합니다.

  2. 상담원: "'user/heart-disease-dataset' 데이터 세트를 다운로드하세요."

    • 서버가 download_kaggle_dataset(dataset_ref='user/heart-disease-dataset') 실행합니다.

  3. 에이전트: "'user/heart-disease-dataset'에 대한 EDA 노트북 프롬프트를 생성하세요."

    • 서버는 generate_eda_notebook(dataset_ref='user/heart-disease-dataset') 실행합니다.

    • 서버는 구조화된 프롬프트 메시지를 반환합니다.

  4. 에이전트: (프롬프트를 코드 생성 모델로 전송) -> EDA Python 코드를 수신합니다.

Available Tools

2 tools
download_kaggle_datasetC

Downloads files for a specific Kaggle dataset. Args: dataset_ref: The reference of the dataset (e.g., 'username/dataset-slug'). download_path: Optional. The path to download the files to. Defaults to '/datasets/'.

ParametersJSON Schema
NameRequiredDescriptionDefault
dataset_refYes
download_pathNo

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries full burden for behavioral disclosure. It states the action but lacks critical details: whether authentication is required (Kaggle typically needs API credentials), what happens if files already exist at the path, error handling, or any rate limits. The description is minimal beyond the basic operation.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness4/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is efficiently structured with a clear purpose statement followed by parameter explanations. It avoids unnecessary fluff, though the formatting with 'Args:' could be more integrated. Every sentence adds value, making it appropriately concise.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the complexity of downloading datasets (which often involves authentication, file management, and error cases), no annotations, and no output schema, the description is insufficient. It misses key contextual details like authentication requirements, response format, or handling of large downloads, leaving significant gaps for an agent.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The description adds meaningful context for both parameters: it explains the format of 'dataset_ref' with an example and clarifies the default behavior and path structure for 'download_path'. With 0% schema description coverage, this compensates somewhat, but it doesn't fully detail constraints (e.g., path validity, dataset accessibility).

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Downloads files') and resource ('for a specific Kaggle dataset'), making the purpose immediately understandable. It distinguishes from the sibling tool 'search_kaggle_datasets' by focusing on downloading rather than searching, though it doesn't explicitly contrast them.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. While it's implied this is for downloading after a dataset is identified (versus searching with the sibling tool), there's no explicit mention of prerequisites, dependencies, or when-not-to-use scenarios.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

search_kaggle_datasetsC

Searches for datasets on Kaggle matching the query using the Kaggle API.

ParametersJSON Schema
NameRequiredDescriptionDefault
queryYes

TDQS

C2.9/5.0
Behavior2/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It mentions using the Kaggle API but doesn't disclose behavioral traits such as authentication requirements, rate limits, pagination, or what the search returns (e.g., format, fields). This leaves significant gaps for an agent to understand how to use it effectively.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, efficient sentence with zero waste. It is appropriately sized and front-loaded, directly stating the tool's purpose without unnecessary elaboration.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness2/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the lack of annotations and output schema, the description is incomplete. It doesn't cover key aspects like authentication, rate limits, return format, or error handling. For a search tool with no structured support, more context is needed to guide an agent effectively.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It implies the 'query' parameter is used for searching datasets, but doesn't add meaning beyond what the schema's title ('Query') and type suggest. No details on query syntax, examples, or constraints are provided, resulting in minimal added value.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose4/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the action ('Searches for datasets') and target resource ('on Kaggle'), specifying it uses the Kaggle API. It distinguishes from the sibling tool 'download_kaggle_dataset' by focusing on search rather than download, though it doesn't explicitly mention this distinction.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No guidance is provided on when to use this tool versus alternatives. The description doesn't mention the sibling tool 'download_kaggle_dataset' or any other search methods, nor does it specify prerequisites like authentication or rate limits.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

TDQS

B3.1/5.0
Disambiguation5/5

The two tools have clearly distinct purposes: one downloads a specific dataset, while the other searches for datasets. There is no overlap in functionality, making it easy for an agent to choose the correct tool for each task without confusion.

Naming Consistency5/5

Both tools follow a consistent verb_noun pattern (download_kaggle_dataset and search_kaggle_datasets), using snake_case and clear action verbs. This consistency makes the tool set predictable and easy to understand at a glance.

Tool Count2/5

With only two tools, the server feels thin for a Kaggle integration, lacking essential operations like listing datasets, uploading data, or managing competitions. While the tools are functional, the scope is incomplete for typical Kaggle workflows, making the count too low for the domain.

Completeness2/5

The tool set is severely incomplete for a Kaggle MCP server. It covers downloading and searching datasets but misses critical operations such as uploading datasets, accessing competition data, or interacting with notebooks. This creates significant gaps that will hinder agents from performing common Kaggle tasks.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

  • A
    license
    Not graded
    quality
    D
    maintenance
    Connects Claude AI to the Kaggle API through the Model Context Protocol, enabling users to browse competitions, search and download datasets, analyze kernels, and access pre-trained models through natural language interactions.
    MIT
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to interact with Kaggle competitions, including listing competitions, downloading files, submitting predictions, and viewing submission history.
    10

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/arrismo/kaggle-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server