LeetCode MCP Server
LeetCode MCP 서버
LeetCode MCP 서버는 LeetCode API와 원활하게 통합되는 MCP(Model Context Protocol) 서버로, LeetCode의 프로그래밍 문제, 콘테스트, 솔루션 및 사용자 데이터와의 고급 자동화 및 지능적인 상호 작용을 가능하게 합니다.
특징
🌐 다중 사이트 지원 : leetcode.com(글로벌) 및 leetcode.cn(중국) 플랫폼 모두 지원
📊 문제 데이터 검색 : 자세한 문제 설명, 제약 조건, 예시, 공식 사설 및 사용자가 제출한 솔루션을 얻습니다.
👤 사용자 데이터 액세스 : 사용자 프로필, 제출 내역 및 콘테스트 성과 검색
🔒 개인 데이터 액세스 : 사용자 메모 생성 및 쿼리, 문제 해결 진행 상황 추적, 제출 세부 정보 분석(AC/WA 분석)
🔍 고급 검색 기능 : 태그, 난이도, 카테고리 및 키워드로 문제 필터링
📅 일일 챌린지 접근 : 일일 챌린지 문제에 쉽게 접근
Related MCP server: Linear MCP Server
필수 조건
Node.js 런타임 환경
(선택 사항) 인증된 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 세션 인증이 필요합니다.
브라우저 개발자 도구에서
LEETCODE_SESSION쿠키 추출--session플래그 또는LEETCODE_SESSION환경 변수를 사용하여 서버를 구성합니다.
응답 형식
모든 도구는 다음 구조로 JSON 형식의 응답을 반환합니다.
{
"content": [
{
"type": "text",
"text": "JSON_DATA_STRING"
}
]
}JSON_DATA_STRING 에는 요청된 데이터나 실패한 요청에 대한 오류 메시지가 포함됩니다.
특허
이 프로젝트는 MIT 라이선스에 따라 라이선스가 부여되었습니다.
Available Tools
1 toolget_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.
| Name | Required | Description | Default |
|---|---|---|---|
| topicId | Yes | Solution topicId from list_problem_solutions response |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
With no annotations, the description fully covers behavioral traits: read-only, no authentication, and return format (JSON with text, author, metadata).
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
Three concise sentences, front-loaded with purpose and safety, no wasted words.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Complete for a simple retrieval tool with one parameter and no output schema; mentions return fields and prerequisite step. Could specify error cases, but not required.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
Schema coverage is 100%, baseline 3. The description adds value by explaining the topicId's origin from list_problem_solutions, which is not in the schema.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states 'Retrieves full content of a community solution article' with specific verb and resource. It is unambiguous and needs no sibling differentiation.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
Explicitly instructs to first use list_problem_solutions to obtain topicId, providing clear prerequisite and sequential usage guidance.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
2 tool updates
v1.4.0- Added
get_problem_solution - Removed
get_user_contest_ranking
9 tool updates
v1.4.0- Removed
get_daily_challenge - Removed
get_problem - Removed
get_problem_solution - Removed
get_recent_ac_submissions - Removed
get_recent_submissions - Changed
get_user_contest_ranking2 fields changed- changed
Input schema / properties / attended / descriptionPrevious value: -"Whether to include only the contests the user has participated in (true) or all contests (false); defaults to true"New value: +"true = only contests the user attended (default); false = include all contests in history" - changed
Input schema / properties / username / descriptionPrevious value: -"LeetCode username to retrieve contest ranking information for"New value: +"LeetCode username whose contest ranking to fetch"
- Removed
get_user_profile - Removed
list_problem_solutions - Removed
search_problems
1 tool update
v1.0.0- Changed
get_daily_challenge1 field changed- removed
Input schema / additionalPropertiesRemoved value: -false
9 tool updates
- First observed
get_daily_challenge - First observed
get_problem - First observed
get_problem_solution - First observed
get_recent_ac_submissions - First observed
get_recent_submissions - First observed
get_user_contest_ranking - First observed
get_user_profile - First observed
list_problem_solutions - First observed
search_problems
TDQS
Scored across 1 tool
Only one tool exists, so there is no ambiguity with other tools. However, the tool's dependency on a missing listing tool could cause confusion for agents trying to use it.
With a single tool, naming is trivially consistent. The pattern 'get_problem_solution' follows verb_noun convention.
A single tool for a LeetCode server is far too few. Expected operations (list problems, get problem details, submit solutions, etc.) are missing, making the surface extremely limited.
The only tool requires a topicId from a non-existent list_problem_solutions tool, rendering it unusable. The surface is severely incomplete.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
A Model Context Protocol server for Wix AI tools
Model Context Protocol server for the Apideck Unified API. Connect any MCP-compatible agent framework to 100+ accounting systems, HRIS platforms, file storage providers, and more through one integration. More information https://www.apideck.com/mcp-server
Model Context Protocol server for Studex tools, notifications, and profile integrations
Related MCP Servers
- AlicenseNot gradedqualityCmaintenanceServer that enhances the capabilities of the Cline coding agent. It provides intelligent code suggestions, reduces hallucinations, and documents the knowledge base by leveraging your project's documentation and detecting the technologies used in your codebase.15MIT
- AlicenseAqualityCmaintenanceA Model Context Protocol server that enables large language models to interact with Linear's issue tracking system, allowing management of issues, projects, teams, and other Linear resources.1935 npm1MIT
- AlicenseCqualityFmaintenanceA Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data.740 npm43MIT
- FlicenseNot gradedqualityNot gradedmaintenanceModel Context Protocol server that enables interaction with GitHub repositories, issues, pull requests, and search functionality through natural language.1-