LeetCode MCP Server
by spryzen-devs
README.md
# 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
## Tech Stack
- Python 3.11+
- Model Context Protocol (MCP)
- Claude Desktop
- LeetCode API
## Project Structure
```text
.
├── server.py
├── tools/
├── utils/
├── requirements.txt
├── pyproject.toml
└── README.md
```
> Adjust the structure above to match your repository.
## Installation
Clone the repository.
```bash
git clone https://github.com/<username>/leetcode-mcp-server.git
cd leetcode-mcp-server
```
Create a virtual environment.
```bash
python -m venv .venv
```
Activate it.
**Windows**
```bash
.venv\Scripts\activate
```
**Linux/macOS**
```bash
source .venv/bin/activate
```
Install dependencies.
```bash
pip install -r requirements.txt
```
## Running the Server
```bash
python server.py
```
## Claude Desktop Configuration
Add the server to your Claude Desktop MCP configuration.
```json
{
"mcpServers": {
"leetcode": {
"command": "python",
"args": [
"/absolute/path/to/server.py"
]
}
}
}
```
Restart Claude Desktop after updating the configuration.
## Example Prompts
```text
Search for Medium Binary Search problems.
```
```text
Show me the problem statement for Two Sum.
```
```text
Display my LeetCode profile.
```
```text
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
```text
Claude Desktop
│
│ MCP
▼
LeetCode MCP Server
│
▼
LeetCode API
```
## Future 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
ActivityStale
ResponsivenessNo issues