Skip to main content
Glama
LeetCode MCP Server

LeetCode MCP Server

LeetCode MCP 서버

NPM 버전 GitHub 라이센스 대장간 배지 중국 의사 별

LeetCode MCP 서버는 LeetCode API와 원활하게 통합되는 MCP(Model Context Protocol) 서버로, LeetCode의 프로그래밍 문제, 콘테스트, 솔루션 및 사용자 데이터와의 고급 자동화 및 지능적인 상호 작용을 가능하게 합니다.

특징

  • 🌐 다중 사이트 지원 : leetcode.com(글로벌) 및 leetcode.cn(중국) 플랫폼 모두 지원

  • 📊 문제 데이터 검색 : 자세한 문제 설명, 제약 조건, 예시, 공식 사설 및 사용자가 제출한 솔루션을 얻습니다.

  • 👤 사용자 데이터 액세스 : 사용자 프로필, 제출 내역 및 콘테스트 성과 검색

  • 🔒 개인 데이터 액세스 : 사용자 메모 생성 및 쿼리, 문제 해결 진행 상황 추적, 제출 세부 정보 분석(AC/WA 분석)

  • 🔍 고급 검색 기능 : 태그, 난이도, 카테고리 및 키워드로 문제 필터링

  • 📅 일일 챌린지 접근 : 일일 챌린지 문제에 쉽게 접근

Related MCP server: mcp-server-leetcode

필수 조건

  1. Node.js 런타임 환경

  2. (선택 사항) 인증된 API 액세스를 위한 LeetCode 세션 쿠키

설치

Smithery를 통해 설치

Smithery를 통해 Claude Desktop에 leetcode-mcp-server를 자동으로 설치하려면:

지엑스피1

수동 설치

# Install from npm
npm install @jinzcdev/leetcode-mcp-server -g

# Or run with Global site configuration
npx -y @jinzcdev/leetcode-mcp-server --site global

# Run with authentication (for accessing private data)
npx -y @jinzcdev/leetcode-mcp-server --site global --session <YOUR_LEETCODE_SESSION_COOKIE>

또는 저장소를 복제하여 로컬에서 실행할 수 있습니다.

# Clone the repository
git clone https://github.com/jinzcdev/leetcode-mcp-server.git

# Navigate to the project directory
cd leetcode-mcp-server

# Build and run the server
npm run build && node build/index.js --site global

용법

Visual Studio Code 통합

다음 JSON 구성을 사용자 설정(JSON) 파일에 추가하세요. Ctrl/Cmd + Shift + P 누르고 Preferences: Open User Settings (JSON) 검색하여 이 파일에 액세스하세요.

옵션 1: 환경 변수 사용

{
  "mcp": {
    "servers": {
      "leetcode": {
        "type": "stdio",
        "command": "npx",
        "args": ["-y", "@jinzcdev/leetcode-mcp-server"],
        "env": {
          "LEETCODE_SITE": "global",
          "LEETCODE_SESSION": "<YOUR_LEETCODE_SESSION_COOKIE>"
        }
      }
    }
  }
}

옵션 2: 명령줄 인수 사용

{
  "mcp": {
    "servers": {
      "leetcode": {
        "type": "stdio",
        "command": "npx",
        "args": [
          "-y",
          "@jinzcdev/leetcode-mcp-server",
          "--site",
          "global",
          "--session",
          "<YOUR_LEETCODE_SESSION_COOKIE>"
        ]
      }
    }
  }
}

LeetCode China 사이트의 경우 --site 매개변수를 cn 으로 수정합니다.

[!팁]

서버는 다음과 같은 환경 변수를 지원합니다.

  • LEETCODE_SITE : LeetCode API 엔드포인트('global' 또는 'cn')

  • LEETCODE_SESSION : 인증된 API 액세스를 위한 LeetCode 세션 쿠키

우선순위 참고 : 명령줄 인수와 환경 변수가 모두 지정된 경우 명령줄 인수가 환경 변수보다 우선합니다. 예:

  • LEETCODE_SITE=cn 설정되어 있지만 leetcode-mcp-server --site global 실행하면 서버는 global 사용합니다.

  • LEETCODE_SESSION 이 존재하지만 --session "new_cookie" 제공하면 명령줄 세션 값이 사용됩니다.

사용 가능한 도구

문제들

도구

글로벌

중국

승인 필요

설명

매일 챌린지 받기

✅

✅

❌

오늘의 LeetCode Daily Challenge 문제를 검색합니다.

문제_받기

✅

✅

❌

특정 LeetCode 문제에 대한 세부 정보를 검색합니다.

검색_문제

✅

✅

❌

여러 필터 기준을 사용하여 LeetCode 문제 검색

사용자

도구

글로벌

중국

승인 필요

설명

사용자_프로필 가져오기

✅

✅

❌

LeetCode 사용자의 프로필 정보를 검색합니다.

사용자 경연대회 순위를 얻으세요

✅

✅

❌

사용자의 경연 순위 통계를 얻습니다.

최근 AC 제출물 가져오기

✅

✅

❌

사용자의 최근 승인된 제출물을 검색합니다.

최근 제출 가져오기

✅

❌

❌

사용자의 최근 제출 내역을 검색합니다.

사용자 상태 가져오기

✅

✅

✅

현재 사용자의 현재 상태를 검색합니다

문제_제출_보고서_받기

✅

✅

✅

특정 문제에 대한 자세한 제출 분석을 제공합니다.

문제 진행 상황 가져오기

✅

✅

✅

현재 사용자의 문제 해결 진행 상황을 검색합니다.

모든 제출물을 가져오세요

✅

✅

✅

현재 사용자의 제출 내역을 검색합니다.

노트

도구

글로벌

중국

승인 필요

설명

검색 노트

❌

✅

✅

필터링 옵션을 사용하여 사용자 메모 검색

get_note

❌

✅

✅

질문 ID로 특정 문제에 대한 메모를 검색합니다.

노트 생성

❌

✅

✅

특정 문제에 대한 새 메모를 만듭니다.

업데이트_노트

❌

✅

✅

기존 노트를 새 콘텐츠로 업데이트합니다.

솔루션

도구

글로벌

중국

승인 필요

설명

문제 해결 목록

✅

✅

❌

특정 문제에 대한 커뮤니티 솔루션 목록을 검색합니다.

문제 해결 방법 얻기

✅

✅

❌

특정 솔루션의 전체 콘텐츠를 검색합니다.

도구 매개변수

문제들

  • get_daily_challenge - 오늘의 LeetCode Daily Challenge 문제를 완전한 세부 정보와 함께 검색합니다.

    • 매개변수가 필요하지 않습니다

  • get_problem - 특정 LeetCode 문제에 대한 세부 정보를 검색합니다.

    • titleSlug : 문제의 URL 슬러그/식별자(문자열, 필수)

  • search_problems - 여러 필터 기준을 기반으로 LeetCode 문제를 검색합니다.

    • category : 문제 카테고리 필터(문자열, 선택 사항, 기본값: "all-code-essentials")

    • tags : 문제를 필터링할 주제 태그 목록(문자열[], 선택 사항)

    • difficulty : 문제 난이도 수준 필터(열거형: "EASY", "MEDIUM", "HARD", 선택 사항)

    • searchKeywords : 문제 제목 및 설명에서 검색할 키워드(문자열, 선택 사항)

    • limit : 반환할 문제의 최대 개수(개수, 선택, 기본값: 10)

    • offset : 건너뛸 문제 수(숫자, 선택 사항)

사용자

  • get_user_profile - LeetCode 사용자에 대한 프로필 정보를 검색합니다.

    • username : LeetCode 사용자 이름(문자열, 필수)

  • get_user_contest_ranking - 사용자의 콘테스트 순위 정보를 검색합니다.

    • username : LeetCode 사용자 이름(문자열, 필수)

    • attended : 사용자가 참여한 콘테스트만 포함할지 여부(부울, 선택 사항, 기본값: true)

  • get_recent_submissions - LeetCode Global에서 사용자의 최근 제출물을 검색합니다.

    • username : LeetCode 사용자 이름(문자열, 필수)

    • limit : 반환할 제출의 최대 개수(숫자, 선택 사항, 기본값: 10)

  • get_recent_ac_submissions - 사용자의 최근 승인된 제출물을 검색합니다.

    • username : LeetCode 사용자 이름(문자열, 필수)

    • limit : 반환할 제출의 최대 개수(숫자, 선택 사항, 기본값: 10)

  • get_user_status - 현재 사용자의 상태를 검색합니다.

    • 매개변수가 필요하지 않습니다

  • get_problem_submission_report - 특정 제출에 대한 자세한 정보를 검색합니다.

    • id : 숫자 제출 ID(숫자, 필수)

  • get_problem_progress - 현재 사용자의 문제 해결 진행 상황을 검색합니다.

    • offset : 건너뛸 질문 수 (숫자, 선택, 기본값: 0)

    • limit : 반환할 질문의 최대 개수(숫자, 선택, 기본값: 100)

    • questionStatus : 질문 상태별 필터링(열거형: "시도됨", "해결됨", 선택 사항)

    • difficulty : 난이도 수준별 필터링(string[], 선택 사항)

  • get_all_submissions - 사용자 제출물의 페이지별 목록을 검색합니다.

    • limit : 반환할 제출물의 최대 개수(숫자, 기본값: 20)

    • offset : 건너뛸 제출 수(숫자, 기본값: 0)

    • questionSlug : 선택적 문제 식별자(문자열, 선택 사항)

    • lang : 프로그래밍 언어 필터(문자열, 선택 사항, CN만 해당)

    • status : 제출 상태 필터(열거형: "AC", "WA", 선택 사항, CN만 해당)

    • lastKey : 다음 페이지를 검색하기 위한 페이지 번호 토큰(문자열, 선택 사항, CN만 해당)

노트

  • search_notes - LeetCode China의 사용자 노트 검색

    • keyword : 노트를 필터링할 검색어(문자열, 선택 사항)

    • limit : 반환할 노트의 최대 개수(숫자, 선택, 기본값: 10)

    • skip : 건너뛸 노트 수 (숫자, 선택, 기본값: 0)

    • orderBy : 반환된 노트의 정렬 순서(열거형: "오름차순", "내림차순", 선택 사항, 기본값: "내림차순")

  • get_note - 특정 LeetCode 문제에 대한 사용자 노트를 검색합니다.

    • questionId : LeetCode 문제의 질문 ID(문자열, 필수)

    • limit : 반환할 노트의 최대 개수(숫자, 선택, 기본값: 10)

    • skip : 건너뛸 노트 수 (숫자, 선택, 기본값: 0)

  • create_note - 특정 LeetCode 문제에 대한 새 노트를 만듭니다.

    • questionId : LeetCode 문제의 질문 ID(문자열, 필수)

    • content : 노트의 내용, 마크다운 형식을 지원합니다(문자열, 필수)

    • summary : 메모에 대한 선택적 짧은 요약 또는 제목(문자열, 선택 사항)

  • update_note - 기존 노트를 새로운 내용이나 요약으로 업데이트합니다.

    • noteId : 업데이트할 메모의 ID(문자열, 필수)

    • content : 노트의 새로운 콘텐츠로, 마크다운 형식을 지원합니다(문자열, 필수)

    • summary : 메모에 대한 선택적 새 짧은 요약 또는 제목(문자열, 선택 사항)

솔루션

  • list_problem_solutions - 특정 문제에 대한 커뮤니티 솔루션 목록을 검색합니다.

    • questionSlug : 문제의 URL 슬러그/식별자(문자열, 필수)

    • limit : 반환할 솔루션의 최대 개수(숫자, 선택 사항, 기본값: 10)

    • skip : 건너뛸 솔루션 수(숫자, 선택 사항)

    • userInput : 솔루션을 필터링할 검색어(문자열, 선택 사항)

    • tagSlugs : 솔루션을 필터링하기 위한 태그 식별자 배열(string[], 선택 사항, 기본값: [])

    • orderBy : 반환된 솔루션에 대한 정렬 기준

      • 전역: 열거형: "HOT", "MOST_RECENT", "MOST_VOTES", 선택 사항, 기본값: "HOT"

      • CN: 열거형: "기본값", "가장 많은 추천", "인기", "최신순", "최근순", "최근순", 선택 사항, 기본값: "기본값"

  • get_problem_solution - 특정 솔루션의 전체 내용을 검색합니다.

    • topicId : 솔루션의 고유 주제 ID(문자열, 필수, 전역 전용)

    • slug : 솔루션의 고유 슬러그/식별자(문자열, 필수, CN만 해당)

사용 가능한 리소스

리소스 이름

글로벌

중국

승인 필요

설명

문제 범주

✅

✅

❌

모든 문제 분류 범주 목록

문제 태그

✅

✅

❌

알고리즘 및 데이터 구조 태그의 자세한 컬렉션

문제 언어

✅

✅

❌

지원되는 모든 프로그래밍 언어의 전체 목록

문제-세부 사항

✅

✅

❌

특정 문제에 대한 세부 정보를 제공합니다

문제 해결

✅

✅

❌

특정 솔루션의 전체 내용을 제공합니다

리소스 URI

  • 문제 분류 범주 - 모든 문제 분류 범주 목록

    • URI: categories://problems/all

  • problem-tags - 알고리즘 및 데이터 구조 태그의 자세한 컬렉션

    • URI: tags://problems/all

  • problem-langs - LeetCode에서 지원하는 모든 프로그래밍 언어의 전체 목록

    • URI: langs://problems/all

  • problem-detail - 특정 LeetCode 문제에 대한 세부 정보를 제공합니다.

    • URI: problem://{titleSlug}

    • 매개변수:

      • titleSlug : LeetCode URL에 나타나는 문제 식별자

  • 문제-해결책 - 특정 솔루션의 전체 내용을 제공합니다.

    • 글로벌 URI: solution://{topicId}

      • 매개변수:

        • topicId : 솔루션의 고유 주제 ID

    • CN URI: solution://{slug}

      • 매개변수:

        • slug : 솔루션의 고유 슬러그/식별자

입증

사용자별 데이터 액세스에는 LeetCode 세션 인증이 필요합니다.

  1. LeetCode( 글로벌 또는 중국 사이트)에 로그인하세요

  2. 브라우저 개발자 도구에서 LEETCODE_SESSION 쿠키 추출

  3. --session 플래그 또는 LEETCODE_SESSION 환경 변수를 사용하여 서버를 구성합니다.

응답 형식

모든 도구는 다음 구조로 JSON 형식의 응답을 반환합니다.

{
  "content": [
    {
      "type": "text",
      "text": "JSON_DATA_STRING"
    }
  ]
}

JSON_DATA_STRING 에는 요청된 데이터나 실패한 요청에 대한 오류 메시지가 포함됩니다.

특허

이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여되었습니다.

Available Tools

9 tools
get_daily_challengeA

Retrieves today's Daily Challenge problem with full description (read-only, no auth). Returns problem details for the current date as JSON. Use get_problem when you know a specific titleSlug; use search_problems to discover problems by filters.

Inputs: no named parameters.

get_problemA

Retrieves a single LeetCode problem by titleSlug (read-only, no auth). Returns description, examples, constraints, and metadata as JSON. Use search_problems to find problems by keyword/tag/difficulty; use get_daily_challenge for today's featured problem.

Inputs: titleSlug (required).

get_problem_solutionA

Retrieves full content of a community solution article (read-only, no auth). Requires topicId from list_problem_solutions. Returns article text, author, and metadata as JSON. Use list_problem_solutions first to discover solutions and obtain topicId.

Inputs: topicId (required).

get_recent_ac_submissionsA

Retrieves a user's recent accepted (AC) submissions (read-only, no auth). Available on both Global and CN. Use get_recent_submissions (Global only) to include failed attempts, or get_all_submissions (auth, current user) for full paginated history.

Inputs: username (required), limit.

get_recent_submissionsA

Retrieves a user's recent submission history on LeetCode Global (read-only, no auth). Includes both accepted and failed submissions. Global only—not available on CN. Use get_recent_ac_submissions for accepted-only results, or get_all_submissions (auth, current user) for paginated full history with filters.

Inputs: username (required), limit.

get_user_contest_rankingA

Retrieves a user's contest ranking and participation history (read-only, no auth). Returns overall rating, ranking, and per-contest performance as JSON. Use get_user_profile for general stats and ranking; use this specifically for contest performance data.

Inputs: username (required), attended.

get_user_profileA

Retrieves any user's public profile by username (read-only, no auth). Returns ranking, avatar, bio, submission stats, and platform-specific progress. Use this to look up other users or public stats. Use get_user_status (requires auth) instead to verify the current session user's login state—not for looking up arbitrary users.

Inputs: username (required).

list_problem_solutionsA

Lists community solution articles for a problem (read-only, no auth). Returns metadata only (topicId)—not full content. Use get_problem_solution with the returned topicId to read the full article. Do not call this when you already have a topicId and need the solution text.

Inputs: questionSlug (required), skip, limit, orderBy, +2 more.

search_problemsA

Searches LeetCode problems by category, tags, difficulty, and keywords (read-only, no auth). Supports pagination via limit/offset. Returns matching problem list as JSON. Use get_problem when you already know the titleSlug; use this to browse or discover problems.

Inputs: tags, limit, offset, category, +2 more.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.4/5.0

    Scored across 9 tools

    Disambiguation4/5

    Most tools target clearly distinct resources, and descriptions actively cross-reference alternatives (e.g. search_problems vs get_problem, get_problem vs get_daily_challenge). The only real overlap is get_recent_submissions vs get_recent_ac_submissions, which differ narrowly (failed attempts, Global-only), though the descriptions do disambiguate them.

    Naming Consistency5/5

    Every tool follows a consistent snake_case verb_noun pattern (get_, search_, list_). No mixing of conventions, and names map cleanly to their actions and resources.

    Tool Count5/5

    Nine tools is well-scoped for a read-only LeetCode data client, with each tool covering a distinct resource. No filler or redundant tools bloat the surface.

    Completeness3/5

    The read-only domain is mostly covered (problems, solutions, users, submissions, contest ranking), but descriptions reference tools that do not exist in the set—get_user_status and get_all_submissions—creating dead ends. There is also no submission/write capability, so any workflow requiring those referenced operations will fail.

    Maintenance

    ActivityNo data
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers