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.
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., "@mcp-leetcodeWhat's today's daily LeetCode challenge?"
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.
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 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
- AlicenseCqualityFmaintenanceA Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data.72244MIT
- AlicenseAqualityAmaintenanceA 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.9335136MIT
- FlicenseAqualityDmaintenanceAn MCP server that provides tools to interact with the LeetCode API, enabling problem fetching, code template generation, and solution execution/submission.71
- Flicense-qualityCmaintenanceAn MCP server that provides structured, AI-powered guidance for LeetCode problems, including approach analysis, hints, complexity breakdowns, and optimization directions without spoiling solutions.201
Related MCP Connectors
A MCP server built for developers enabling Git based project management with project and personalβ¦
MCP server for AI agent profiles and smart notes. 60+ coding prompt packs with expert personas.
MCP server for accessing curated awesome list documentation
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/LYCGGG/mcp-leetcode'
If you have feedback or need assistance with the MCP directory API, please join our Discord server