Skip to main content
Glama
prabhattripathi9351

leetcode-github-assistant

🤖 LeetCode GitHub MCP 어시스턴트

개인 LeetCode 솔루션 저장소를 쿼리 가능한 AI 도구로 — Claude Desktop 안에서 바로.

GitHub 저장소 → 메타데이터 인덱스 → MCP 서버 → Claude Desktop (자연어 쿼리)

Python 3.x | MCP SDK | GitHub REST API | LeetCode GraphQL API | MIT License


🧠 이게 뭔가요?

이 프로젝트는 개인 GitHub 저장소에 있는 푼 LeetCode 문제들을 Model Context Protocol (MCP) 을 사용해 Claude Desktop에 직접 연결합니다. "내가 푼 모든 배열 문제"를 찾거나 특정 솔루션 파일 하나를 찾기 위해 GitHub을 수동으로 뒤지는 대신, Claude Desktop에 평범한 언어로 물어보기만 하면 됩니다 — 저장소에서 직접 가져온 실시간 데이터로 답변해 줍니다.

수동으로 파일을 뒤지는 대신 대화를 통해 DSA/LeetCode 연습을 검색하고 복습할 수 있게 만든 개인 생산성 도구로 제작되었습니다.

다음을 제공합니다:

  • 주제(array, dynamic-programming, graph 등)별로 태그된 모든 푼 문제

  • 각 문제의 난이도(easy/medium/hard) — LeetCode 자체에서 가져옴

  • 전체 솔루션 코드 — 요청 시 GitHub에서 실시간으로 가져옴


Related MCP server: Company Docs MCP Server

✨ 기능

기능

설명

🔍 주제 기반 검색

아무 주제나 물어보고(예: "array", "dynamic-programming") 난이도와 함께 일치하는 모든 푼 문제를 받아보세요

📄 실시간 코드 검색

문제 이름이나 슬러그로 모든 문제의 전체 솔루션 코드를 GitHub에서 바로 가져옵니다

🏷️ 자동 태깅

난이도와 주제 태그는 LeetCode 자체 GraphQL API에서 자동으로 가져옵니다 — 수동 태깅 불필요

빠른 병렬 인덱싱

멀티스레딩을 사용해 모든 문제의 메타데이터를 하나씩이 아닌 동시에 가져옵니다

🔌 네이티브 Claude Desktop 통합

로컬 MCP 서버로 실행됩니다 — 브라우저 탭 전환, 링크 복사-붙여넣기 불필요


🏗️ 아키텍처 및 파이프라인

┌─────────────────────────┐
│   GitHub Repo            │   → your solved LeetCode .py/.cpp/.java files
│   Daily_leet_code         │
└────────────┬─────────────┘
             │  GitHub REST API (recursive file listing)
             ▼
┌─────────────────────────┐
│  build_index_github.py   │   → extracts slug from filename
│      (Indexer)            │   → queries LeetCode GraphQL for
└────────────┬─────────────┘     difficulty + topic tags (parallel)
             │  writes
             ▼
┌─────────────────────────┐
│      index.json           │   → local structured metadata store
└────────────┬─────────────┘
             │  loaded at startup
             ▼
┌─────────────────────────┐
│    mcp_server.py          │   → exposes 2 tools over stdio:
│   (MCP Server)             │     search_by_topic, get_solution_code
└────────────┬─────────────┘
             │  MCP / JSON-RPC over stdio
             ▼
┌─────────────────────────┐
│     Claude Desktop        │   → "array topic ke problems batao"
│   (spawns server locally) │   → "0877-stone-game ka code dikhao"
└─────────────────────────┘

아키텍처 다이어그램

MCP 설명

🛠️ 기술 스택

카테고리

기술

언어

Python 3.x

MCP 서버

mcp SDK (mcp.server.Server, stdio 전송)

데이터 소스

GitHub REST API, LeetCode GraphQL API

동시성

concurrent.futures.ThreadPoolExecutor

HTTP 클라이언트

requests

클라이언트

Claude Desktop (로컬 MCP 서버 설정)


📁 프로젝트 구조

Leetcode_mcp_server/
├── build_index_github.py   # Indexer: scans GitHub repo, builds index.json
├── mcp_server.py            # MCP server: exposes search_by_topic & get_solution_code
├── index.json                # Auto-generated metadata index (gitignored)
├── requirements.txt          # Python dependencies
└── .gitignore

🔌 도구 참조 (MCP 도구)

도구

입력

설명

search_by_topic

topic: string (예: "array")

해당 주제로 태그된 모든 푼 문제를 난이도와 함께 반환합니다

get_solution_code

problem_name: string (예: "0877-stone-game.py" 또는 "stone-game")

GitHub에서 전체 솔루션 코드를 실시간으로 가져와 반환합니다


🚀 시작하기

사전 요구 사항

  • Python 3.10+

  • 직접 푼 LeetCode 문제가 있는 GitHub 저장소 (공개, 또는 비공개 저장소용 토큰 추가)

  • Claude Desktop 설치

1. 클론 및 의존성 설치

git clone https://github.com/<your-username>/<this-repo>.git
cd <this-repo>
pip install -r requirements.txt

2. 저장소 이름 구성

build_index_github.py를 열고 다음을 설정하세요:

GITHUB_REPO = "your-username/your-leetcode-repo"

3. 인덱스 빌드

python build_index_github.py

이렇게 하면 모든 문제의 난이도와 주제 태그가 포함된 index.json이 생성됩니다.

4. Claude Desktop에 연결

Claude Desktop을 열고 → 설정 → 개발자 → 구성 편집으로 이동한 후 다음을 추가하세요:

{
  "mcpServers": {
    "leetcode-github-assistant": {
      "command": "python",
      "args": ["/absolute/path/to/mcp_server.py"]
    }
  }
}

💡 Windows에서는 경로에 이중 백슬래시를 사용하고(예: "D:\\Leetcode_mcp_server\\mcp_server.py"), python이 시스템 PATH에 없으면 python.exe의 전체 경로를 사용하세요.

5. Claude Desktop 재시작

완전히 종료하고(창을 닫는 것이 아니라 작업 관리자에서 작업 끝내기) 다시 엽니다. 설정 → 개발자를 확인하세요 — 서버 상태가 running으로 표시되어야 합니다.

6. 물어보세요

"array topic ke problems batao"
"show me the code for two-sum"

🗺️ 로드맵 아이디어

  • 난이도 기반 필터링 도구 추가 (예: "모든 hard 문제 보여줘")

  • 연습용 "랜덤 문제 추천" 도구 추가

  • 저장소에 새 커밋이 푸시될 때마다 인덱스 자동 동기화 (웹훅 또는 예약 재빌드)

  • GitHub 개인 액세스 토큰을 통한 비공개 저장소 지원

  • 인덱싱 시간을 줄이기 위한 LeetCode GraphQL 호출 재시도/캐싱 로직 추가


🤝 기여

개인 학습 프로젝트이지만 이슈와 제안은 환영합니다 — PR이나 이슈를 자유롭게 열어주세요.


개인 LeetCode 연습을 대화형으로 만들기 위해 제작되었습니다 — GitHub 폴더를 뒤지는 대신 그냥 물어보세요.

F
license - not found
Not graded
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

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

Related MCP Servers

View all related MCP servers

Related MCP Connectors

  • Search Luogu problems, fetch statements, explore problem sets and get practice recommendations.

  • Connect AI assistants to your GitHub-hosted Obsidian vault to seamlessly access, search, and analy…

  • Code intelligence for coding agents: semantic, AST, graph, and full-text search. 279+ languages.

View all MCP Connectors

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/prabhattripathi9351/leetcode-mcp-assistant'

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