leetcode-github-assistant
🤖 LeetCode GitHub MCP Assistant
個人のLeetCode解答リポジトリを、Claude Desktop内で直接クエリ可能なAIツールに変えます。
GitHub Repo → Metadata Index → MCP Server → Claude Desktop (自然言語クエリ)
Python 3.x | MCP SDK | GitHub REST API | LeetCode GraphQL API | MIT License
🧠 これは何か?
このプロジェクトは、解決済みのLeetCode問題を保存した個人のGitHubリポジトリを、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から自動取得 — 手動タグ付けは不要 |
⚡ 高速並列インデックス | マルチスレッドを使用して、すべての問題のメタデータを1件ずつではなく並行して取得 |
🔌 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"
└─────────────────────────┘
🛠️ 技術スタック
カテゴリ | 技術 |
言語 | Python 3.x |
MCPサーバー |
|
データソース | GitHub REST API、LeetCode GraphQL API |
並行処理 |
|
HTTPクライアント |
|
クライアント | 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ツール)
ツール | 入力 | 説明 |
|
| そのトピックでタグ付けされたすべての解決済み問題を難易度付きで返す |
|
| 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.txt2. リポジトリ名を設定
build_index_github.py を開いて設定:
GITHUB_REPO = "your-username/your-leetcode-repo"3. インデックスを構築
python build_index_github.pyこれにより、すべての問題の難易度とトピックタグを含む index.json が作成されます。
4. Claude Desktopに接続
Claude Desktopを開く → Settings → Developer → Edit Config を選択し、以下を追加:
{
"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を再起動
完全に終了(ウィンドウを閉じるだけでなく、タスクマネージャーで「タスクの終了」)してから再度開きます。Settings → Developer を確認 — サーバーのステータスが running と表示されるはずです。
6. 質問する
"array topic ke problems batao"
"show me the code for two-sum"🗺️ ロードマップのアイデア
難易度ベースのフィルタリングツールを追加(例:「難しい問題をすべて表示」)
練習用の「ランダム問題提案」ツールを追加
リポジトリに新しいコミットがプッシュされたときにインデックスを自動同期(webhookまたはスケジュール再構築)
GitHub個人アクセストークンによるプライベートリポジトリのサポート
LeetCode GraphQL呼び出しにリトライ/キャッシュロジックを追加してインデックス時間を短縮
🤝 コントリビューション
これは個人の学習プロジェクトですが、Issueや提案は歓迎します — PRやIssueを自由に開いてください。
個人のLeetCode練習を会話型にするために構築されました — GitHubフォルダを掘り返す代わりに、ただ質問してください。
This server cannot be installed
Maintenance
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
- AlicenseAqualityAmaintenanceEnables interactive LeetCode practice with AI-guided authentication, problem solving, solution submission, and learning mode.2417311MIT
- FlicenseNot gradedqualityDmaintenanceProvides read-only access to company GitHub repositories, enabling code search, file retrieval, documentation search, and repo browsing via natural language.
- FlicenseNot gradedqualityDmaintenanceEnables natural-language queries about public GitHub repositories, including issues, pull requests, repo metadata, and READMEs, via the GitHub API.
- FlicenseNot gradedqualityDmaintenanceEnables natural language queries to search GitHub for trending repositories by topic, summarize project READMEs, and compare multiple repos to uncover ecosystem patterns.2
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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
