mcp-leetcode
Provides tools for interacting with LeetCode, including daily challenges, problem search, user profiles, submissions, progress, code execution, and notes management (CN-only), supporting both leetcode.com and leetcode.cn.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
MCP LeetCode
A feature-rich LeetCode MCP Server written in Python, supporting both leetcode.com and leetcode.cn.
Features
π Dual Site Support - leetcode.com (Global) & leetcode.cn (China)
π Problem Query - Search, filter, and get problem details
π€ User Data - Profile, submissions, progress, contest info
π» Code Execution - Run and submit code
π Notes Management - CRUD operations (CN only)
β‘ Smart Caching - Reduce API calls with built-in cache
π‘οΈ Type Safe - Full Pydantic v2 type definitions
Related MCP server: LeetCode MCP Server
Quick Start
Installation
pip install mcp-leetcodeConfiguration
cp config.example.yaml config.yaml
# Edit config.yaml with your settingsRun
mcp-leetcodeMCP Client Configuration
Claude Desktop
{
"mcpServers": {
"leetcode": {
"command": "mcp-leetcode",
"env": {
"LEETCODE_SITE": "cn",
"LEETCODE_SESSION": "your_session_cookie",
"LEETCODE_CSRF": "your_csrf_token"
}
}
}
}VS Code (Copilot)
{
"mcp": {
"servers": {
"leetcode": {
"command": "mcp-leetcode",
"env": {
"LEETCODE_SITE": "cn"
}
}
}
}
}Available Tools
Problems
Tool | Description |
| Get today's daily challenge |
| Get problem details by slug |
| Search with filters (tags, difficulty, keywords) |
| Get community solutions |
Users
Tool | Description |
| Get user profile information |
| Get submission history |
| Get problem-solving progress |
| Get contest ranking info |
Code Execution
Tool | Description |
| Run code with test cases |
| Submit code to LeetCode |
Notes (CN only)
Tool | Description |
| Get user notes |
| Create a new note |
| Update existing note |
Development
# Clone
git clone https://github.com/LYCGGG/mcp-leetcode.git
cd mcp-leetcode
# Install dev dependencies
pip install -e ".[dev]"
# Run tests
pytest
# Lint
ruff check src/License
MIT
This server cannot be deployed
Maintenance
Related MCP Connectors
Lean 4 MCP server: compile, prove theorems, and formalize math with Mathlib.
A MCP server built for developers enabling Git based project management with project and personalβ¦
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
Related MCP Servers
- AlicenseCqualityFmaintenanceA Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data.714 npm44MIT
- AlicenseAqualityBmaintenanceA Model Context Protocol server that provides integration with LeetCode APIs, enabling automated interaction with programming problems, contests, solutions, and user data across both leetcode.com and leetcode.cn platforms.9169 npm155MIT
- FlicenseAqualityDmaintenanceAn MCP server that provides tools to interact with the LeetCode API, enabling problem fetching, code template generation, and solution execution/submission.71-
- FlicenseNot gradedqualityDmaintenanceA tutorial and working MCP server that connects to your LeetCode profile, enabling AI assistants to check solved problems and recommend new ones by topic and difficulty.1-