LeetCode MCP Server
Allows searching and retrieving LeetCode problem details, user profiles, and solved problem statistics.
Click on "Deploy 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: PersonalLeetcodeMCP
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 deployed
Maintenance
Related MCP Connectors
Search Luogu problems, fetch statements, explore problem sets and get practice recommendations.
Search Codeforces problems and inspect public problem metadata through the official Codeforces API.
Live SEO workflow tools for Claude Code, Codex, and AI agents.
Run UX research from Claude — create card sort studies, list studies, pull headline stats.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables interactive LeetCode practice with AI-guided authentication, problem solving, solution submission, and learning mode.24147 npm12MIT
- AlicenseNot gradedqualityBmaintenanceEnables Claude to fetch and analyze your public LeetCode submission history, weak areas, and daily challenge via a remote MCP server.9 npmMIT
- FlicenseNot gradedqualityCmaintenanceEnables querying a personal GitHub repository of solved LeetCode problems via natural language, including topic-based search and live retrieval of solution code with difficulty and tags.1-
- AlicenseAqualityCmaintenanceEnables secure, read-only access to LeetCode CN for fetching problem details by title, slug, number, or URL, and retrieving user submission records for a given date with optional filtering.5MIT