leetcode-github-assistant
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@leetcode-github-assistantShow me all my dynamic programming solutions with difficulty"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
π€ LeetCode GitHub MCP Assistant
Turn your personal LeetCode solutions repo into a queryable AI tool β right inside Claude Desktop.
GitHub Repo β Metadata Index β MCP Server β Claude Desktop (natural language queries)
Python 3.x | MCP SDK | GitHub REST API | LeetCode GraphQL API | MIT License
π§ What is this?
This project connects a personal GitHub repository of solved LeetCode problems directly to Claude Desktop using the Model Context Protocol (MCP). Instead of manually browsing GitHub to find "all array problems I've solved" or hunting for one specific solution file, you can just ask Claude Desktop in plain language β and it answers using live data pulled straight from your repo.
Built as a personal productivity tool to make DSA/LeetCode practice searchable and reviewable through conversation, instead of manual file digging.
It surfaces:
Every solved problem tagged by topic (array, dynamic-programming, graph, etc.)
Each problem's difficulty (easy/medium/hard), pulled from LeetCode itself
The full solution code, fetched live from GitHub on demand
Related MCP server: Company Docs MCP Server
β¨ Features
Capability | Description |
π Topic-based search | Ask for any topic (e.g. "array", "dynamic-programming") and get every matching solved problem with its difficulty |
π Live code retrieval | Fetch the complete solution code for any problem by name or slug, straight from GitHub |
π·οΈ Auto-tagging | Difficulty and topic tags are pulled automatically from LeetCode's own GraphQL API β no manual tagging needed |
β‘ Fast parallel indexing | Uses multithreading to fetch metadata for every problem concurrently instead of one-by-one |
π Native Claude Desktop integration | Runs as a local MCP server β no browser tab switching, no copy-pasting links |
ποΈ Architecture & Pipeline
βββββββββββββββββββββββββββ
β 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"
βββββββββββββββββββββββββββ
π οΈ Tech Stack
Category | Technology |
Language | Python 3.x |
MCP Server |
|
Data Source | GitHub REST API, LeetCode GraphQL API |
Concurrency |
|
HTTP Client |
|
Client | Claude Desktop (local MCP server config) |
π Project Structure
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π Tool Reference (MCP Tools)
Tool | Input | Description |
|
| Returns all solved problems tagged with that topic, with difficulty |
|
| Fetches and returns the full solution code live from GitHub |
π Getting Started
Prerequisites
Python 3.10+
A GitHub repo of your own solved LeetCode problems (public, or add a token for private repos)
Claude Desktop installed
1. Clone & install dependencies
git clone https://github.com/<your-username>/<this-repo>.git
cd <this-repo>
pip install -r requirements.txt2. Configure your repo name
Open build_index_github.py and set:
GITHUB_REPO = "your-username/your-leetcode-repo"3. Build the index
python build_index_github.pyThis creates index.json with every problem's difficulty and topic tags.
4. Connect to Claude Desktop
Open Claude Desktop β Settings β Developer β Edit Config, and add:
{
"mcpServers": {
"leetcode-github-assistant": {
"command": "python",
"args": ["/absolute/path/to/mcp_server.py"]
}
}
}π‘ On Windows, use double backslashes in the path (e.g.
"D:\\Leetcode_mcp_server\\mcp_server.py"), and usepython.exe's full path ifpythonisn't on your system PATH.
5. Restart Claude Desktop
Fully quit (End Task in Task Manager, not just close the window) and reopen. Check Settings β Developer β the server should show status running.
6. Ask away
"array topic ke problems batao"
"show me the code for two-sum"πΊοΈ Roadmap Ideas
Add difficulty-based filtering tool (e.g. "show me all hard problems")
Add a "random problem suggestion" tool for practice
Auto-sync index whenever new commits are pushed to the repo (webhook or scheduled rebuild)
Support private repos via GitHub personal access token
Add retry/caching logic for LeetCode GraphQL calls to reduce indexing time
π€ Contributing
This is a personal learning project, but issues and suggestions are welcome β feel free to open a PR or an issue.
Built to make personal LeetCode practice conversational β instead of digging through GitHub folders, just ask.
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
