LeetCode MCP Server
Allows searching and retrieving LeetCode problem details, user profiles, and solved problem statistics.
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 MCP ServerSearch for Medium Binary Search problems."
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 MCP Server
A Model Context Protocol (MCP) server built with Python that enables Claude Desktop to access LeetCode through natural language. The server exposes LeetCode functionality as MCP tools, allowing Claude to retrieve problem information, user statistics, and other resources directly from a conversation.
Features
Search LeetCode problems
Retrieve problem details
Fetch user profile information
View user statistics
Native integration with Claude Desktop using MCP
Related MCP server: MCP Claude Hacker News
Tech Stack
Python 3.11+
Model Context Protocol (MCP)
Claude Desktop
LeetCode API
Project Structure
.
├── server.py
├── tools/
├── utils/
├── requirements.txt
├── pyproject.toml
└── README.mdAdjust the structure above to match your repository.
Installation
Clone the repository.
git clone https://github.com/<username>/leetcode-mcp-server.git
cd leetcode-mcp-serverCreate a virtual environment.
python -m venv .venvActivate it.
Windows
.venv\Scripts\activateLinux/macOS
source .venv/bin/activateInstall dependencies.
pip install -r requirements.txtRunning the Server
python server.pyClaude Desktop Configuration
Add the server to your Claude Desktop MCP configuration.
{
"mcpServers": {
"leetcode": {
"command": "python",
"args": [
"/absolute/path/to/server.py"
]
}
}
}Restart Claude Desktop after updating the configuration.
Example Prompts
Search for Medium Binary Search problems.Show me the problem statement for Two Sum.Display my LeetCode profile.How many Hard problems have I solved?Available Tools
Tool | Description |
Search Problems | Search problems using filters or keywords |
Problem Details | Retrieve complete problem information |
User Profile | Fetch LeetCode profile information |
User Statistics | Retrieve solved problem statistics |
Architecture
Claude Desktop
│
│ MCP
▼
LeetCode MCP Server
│
▼
LeetCode APIFuture Improvements
Daily Challenge support
Contest information
Company-specific problems
Topic-based recommendations
Submission history
AI-assisted problem recommendations
License
MIT License
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.
Latest Blog Posts
- 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/spryzen-devs/Leetcode-MCP-Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server