LeetCode MCP Server
@MCP-Mirror
About LeetCode MCP Server
Mirror of
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"jinzcdev_leetcode-mcp-server": {
"command": "npx",
"args": [
"-y",
"@smithery/cli",
"install",
"@jinzcdev/leetcode-mcp-server",
"--client",
"claude"
]
}
}
}Tools
No tools detected
Fetch the live tool list by running this server in a temporary sandbox using the button above.
Overview
What is LeetCode MCP Server?
The LeetCode MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with LeetCode APIs, enabling advanced automation and intelligent interaction with LeetCode's programming problems, contests, solutions, and user data. It supports both leetcode.com (Global) and leetcode.cn (China) platforms.
How to use LeetCode MCP Server?
Install the npm package globally or run it with npx. Configure it using command-line arguments (--site, --session) or environment variables (LEETCODE_SITE, LEETCODE_SESSION). Integrate with MCP‑compatible clients (e.g., VS Code) by adding a JSON configuration to your user settings. Tools are invoked through the MCP client after setup.
Key features of LeetCode MCP Server
- Multi-site support for leetcode.com and leetcode.cn
- Retrieve problem descriptions, constraints, examples, official editorials, and user‑submitted solutions
- Access user profiles, submission history, and contest performance
- Create and query personal notes, track problem‑solving progress (requires authentication)
- Advanced search by tags, difficulty, categories, and keywords
- Access daily challenge problems
Use cases of LeetCode MCP Server
- Automating retrieval of the daily challenge for practice
- Analyzing user submission history and contest rankings
- Searching and filtering LeetCode problems for targeted study sessions
- Managing personal notes and tracking problem‑solving progress
- Integrating LeetCode data into AI assistants or development workflows
FAQ from LeetCode MCP Server
What are the prerequisites?
A Node.js runtime environment, and optionally a LeetCode session cookie for authenticated API access.
How do I set the site (global or China)?
Use the --site command-line argument with value global or cn, or set the LEETCODE_SITE environment variable. Command-line arguments take precedence over environment variables.
Where does the authentication session cookie come from?
The LEETCODE_SESSION cookie is obtained from your browser after logging into LeetCode. It is required for private data access such as user notes, submission details, and problem progress.
What transports does the server use?
The server communicates via stdio transport using the MCP protocol, configured through a command execution (e.g., npx).
What are the known limitations?
Notes tools are only available on LeetCode China (CN). The get_recent_submissions tool is only available on Global. Several tools require authentication.
Frequently asked questions
What are the prerequisites?
A Node.js runtime environment, and optionally a LeetCode session cookie for authenticated API access.
How do I set the site (global or China)?
Use the `--site` command-line argument with value `global` or `cn`, or set the `LEETCODE_SITE` environment variable. Command-line arguments take precedence over environment variables.
Where does the authentication session cookie come from?
The `LEETCODE_SESSION` cookie is obtained from your browser after logging into LeetCode. It is required for private data access such as user notes, submission details, and problem progress.
What transports does the server use?
The server communicates via stdio transport using the MCP protocol, configured through a command execution (e.g., `npx`).
What are the known limitations?
Notes tools are only available on LeetCode China (CN). The `get_recent_submissions` tool is only available on Global. Several tools require authentication.
Basic information
More Other MCP servers
MCP Go 🚀
mark3labsA Go implementation of the Model Context Protocol (MCP), enabling seamless integration between LLM applications and external data sources and tools.
Mcp
browsermcpBrowser MCP is a Model Context Provider (MCP) server that allows AI applications to control your browser
Awesome Mlops
visengerA curated list of references for MLOps
ICSS
chokcoco不止于 CSS
MCP Toolbox for Databases
googleapisMCP Toolbox for Databases is an open source MCP server for databases.
Comments