LeetCode▌

by jinzcdev
Access LeetCode problems, user profiles, and community solutions for improved algorithm practice and LeetCode 75 contest
Connects to LeetCode's programming platform for accessing problem descriptions, searching by tags and difficulty, retrieving user profiles, and viewing community solutions to enhance algorithm learning and contest preparation.
best for
- / Software engineers preparing for coding interviews
- / Students practicing data structures and algorithms
- / Developers participating in programming contests
- / Anyone building coding practice automation tools
capabilities
- / Retrieve problem descriptions with constraints and examples
- / Search problems by tags, difficulty, and keywords
- / Access user profiles and submission history
- / View community solutions and editorial content
- / Get daily challenge problems
- / Track problem-solving progress with notes
what it does
Connects to LeetCode's platform to access programming problem details, search by difficulty/tags, view user profiles, and retrieve community solutions for coding practice.
about
LeetCode is a community-built MCP server published by jinzcdev that provides AI assistants with tools and capabilities via the Model Context Protocol. Access LeetCode problems, user profiles, and community solutions for improved algorithm practice and LeetCode 75 contest It is categorized under developer tools.
how to install
You can install LeetCode in your AI client of choice. Use the install panel on this page to get one-click setup for Cursor, Claude Desktop, VS Code, and other MCP-compatible clients. This server runs locally on your machine via the stdio transport.
license
MIT
LeetCode is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
readme
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.
<a href="https://glama.ai/mcp/servers/@jinzcdev/leetcode-mcp-server"> <img width="380" height="200" src="https://glama.ai/mcp/servers/@jinzcdev/leetcode-mcp-server/badge" alt="LeetCode Server MCP server" /> </a>Features
- 🌐 Multi-site Support: Support both leetcode.com (Global) and leetcode.cn (China) platforms
- 📊 Problem Data Retrieval: Obtain detailed problem descriptions, constraints, examples, official editorials, and user-submitted solutions
- 👤 User Data Access: Retrieve user profiles, submission history, and contest performance
- 🔒 Private Data Access: Create and query user notes, track problem-solving progress, and analyze submission details (AC/WA analysis)
- 🔍 Advanced Search Capabilities: Filter problems by tags, difficulty levels, categories, and keywords
- 📅 Daily Challenge Access: Easily access daily challenge problems
Prerequisites
- Node.js (v20.x or above)
- (Optional) LeetCode session cookie for authenticated API access
Installation
Installing via Smithery
To install leetcode-mcp-server for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @jinzcdev/leetcode-mcp-server --client claude
Manual Installation
# Install from npm
npm install @jinzcdev/leetcode-mcp-server -g
# Or run with Global site configuration
npx -y @jinzcdev/leetcode-mcp-server --site global
# Run with authentication (for accessing private data)
npx -y @jinzcdev/leetcode-mcp-server --site global --session <YOUR_LEETCODE_SESSION_COOKIE>
Alternatively, you can clone the repository and run it locally:
# Clone the repository
git clone https://github.com/jinzcdev/leetcode-mcp-server.git
# Navigate to the project directory
cd leetcode-mcp-server
# Build the project
npm install && npm run build
# Run the server
node build/index.js --site global
Usage
Visual Studio Code Integration
Add the following JSON configuration to your User Settings (JSON) file. Access this by pressing Ctrl/Cmd + Shift + P and searching for Preferences: Open User Settings (JSON).
Option 1: Using Environment Variables
{
"mcp": {
"servers": {
"leetcode": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@jinzcdev/leetcode-mcp-server"],
"env": {
"LEETCODE_SITE": "global",
"LEETCODE_SESSION": "<YOUR_LEETCODE_SESSION_COOKIE>"
}
}
}
}
}
Option 2: Using Command Line Arguments
{
"mcp": {
"servers": {
"leetcode": {
"type": "stdio",
"command": "npx",
"args": [
"-y",
"@jinzcdev/leetcode-mcp-server",
"--site",
"global",
"--session",
"<YOUR_LEETCODE_SESSION_COOKIE>"
]
}
}
}
}
For LeetCode China site, modify the --site parameter to cn.
[!TIP]
The server supports the following optional environment variables:
LEETCODE_SITE: LeetCode API endpoint ('global' or 'cn', default: 'global')LEETCODE_SESSION: LeetCode session cookie for authenticated API access (default: empty)Priority Note: Command-line arguments take precedence over environment variables when both are specified. For example:
- If
LEETCODE_SITE=cnis set but you runleetcode-mcp-server --site global, the server will useglobal.- If
LEETCODE_SESSIONexists but you provide--session "new_cookie", the command-line session value will be used.
Available Tools
Problems
| Tool | Global | CN | Auth Required | Description |
|---|---|---|---|---|
| get_daily_challenge | ✅ | ✅ | ❌ | Retrieves today's LeetCode Daily Challenge problem |
| get_problem | ✅ | ✅ | ❌ | Retrieves details for a specific LeetCode problem |
| search_problems | ✅ | ✅ | ❌ | Searches for LeetCode problems with multiple filter criteria |
Users
| Tool | Global | CN | Auth Required | Description |
|---|---|---|---|---|
| get_user_profile | ✅ | ✅ | ❌ | Retrieves profile information for a LeetCode user |
| get_user_contest_ranking | ✅ | ✅ | ❌ | Obtains contest ranking statistics for a user |
| get_recent_ac_submissions | ✅ | ✅ | ❌ | Retrieves a user's recent accepted submissions |
| get_recent_submissions | ✅ | ❌ | ❌ | Retrieves a user's recent submissions history |
| get_user_status | ✅ | ✅ | ✅ | Retrieves current user's current status |
| get_problem_submission_report | ✅ | ✅ | ✅ | Provides detailed submission analysis for a specific problem |
| get_problem_progress | ✅ | ✅ | ✅ | Retrieves current user's problem-solving progress |
| get_all_submissions | ✅ | ✅ | ✅ | Retrieves current user's submission history |
Notes
| Tool | Global | CN | Auth Required | Description |
|---|---|---|---|---|
| search_notes | ❌ | ✅ | ✅ | Searches for user notes with filtering options |
| get_note | ❌ | ✅ | ✅ | Retrieves notes for a specific problem by question ID |
| create_note | ❌ | ✅ | ✅ | Creates a new note for a specific problem |
| update_note | ❌ | ✅ | ✅ | Updates an existing note with new content |
Solutions
| Tool | Global | CN | Auth Required | Description |
|---|---|---|---|---|
| list_problem_solutions | ✅ | ✅ | ❌ | Retrieves a list of community solutions for a specific problem |
| get_problem_solution | ✅ | ✅ | ❌ | Retrieves the complete content of a specific solution |
Tool Parameters
Problems
-
get_daily_challenge - Retrieves today's LeetCode Daily Challenge problem with complete details
- No parameters required
-
get_problem - Retrieves details about a specific LeetCode problem
titleSlug: The URL slug/identifier of the problem (string, required)
-
search_problems - Searches for LeetCode problems based on multiple filter criteria
category: Problem category filter (string, optional, default: "all-code-essentials")tags: List of topic tags to filter problems by (string[], optional)difficulty: Problem difficulty level filter (enum: "EASY", "MEDIUM", "HARD", optional)searchKeywords: Keywords to search in problem titles and descriptions (string, optional)limit: Maximum number of problems to return (number, optional, default: 10)offset: Number of problems to skip (number, optional)
Users
-
get_user_profile - Retrieves profile information about a LeetCode user
username: LeetCode username (string, required)
-
get_user_contest_ranking - Retrieves a user's contest ranking information
username: LeetCode username (string, required)attended: Whether to include only the contests the user has participated in (boolean, optional, default: true)
-
get_recent_submissions - Retrieves a user's recent submissions on LeetCode Global
username: LeetCode username (string, required)limit: Maximum number of submissions to return (number, optional, default: 10)
-
get_recent_ac_submissions - Retrieves a user's recent accepted submissions
username: LeetCode username (string, required)limit: Maximum number of submissions to return (number, optional, default: 10)
-
get_user_status - Retrieves the current user's status
- No parameters required
-
get_problem_submission_report - Retrieves detailed information about a specific submission
id: The numerical submission ID (number, required)
-
get_problem_progress - Retrieves the current user's problem-solving progress
offset: Number of questions to skip (number, optional, default: 0)limit: Maximum number of questions to return (number, optional, default: 100)questionStatus: Filter by question status (enum: "ATTEMPTED", "SOLVED", optional)- `difficulty
FAQ
- What is the LeetCode MCP server?
- LeetCode is a Model Context Protocol (MCP) server profile on explainx.ai. MCP lets AI hosts (e.g. Claude Desktop, Cursor) call tools and resources through a standard interface; this page summarizes categories, install hints, and community ratings.
- How do MCP servers relate to agent skills?
- Skills are reusable instruction packages (often SKILL.md); MCP servers expose live capabilities. Teams frequently combine both—skills for workflows, MCP for APIs and data. See explainx.ai/skills and explainx.ai/mcp-servers for parallel directories.
- How are reviews shown for LeetCode?
- This profile displays 10 aggregated ratings (sample rows for discoverability plus signed-in user reviews). Average score is about 4.5 out of 5—verify behavior in your own environment before production use.
Ratings
4.5★★★★★10 reviews- ★★★★★Shikha Mishra· Oct 10, 2024
LeetCode is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.
- ★★★★★Piyush G· Sep 9, 2024
We evaluated LeetCode against two servers with overlapping tools; this profile had the clearer scope statement.
- ★★★★★Chaitanya Patil· Aug 8, 2024
Useful MCP listing: LeetCode is the kind of server we cite when onboarding engineers to host + tool permissions.
- ★★★★★Sakshi Patil· Jul 7, 2024
LeetCode reduced integration guesswork — categories and install configs on the listing matched the upstream repo.
- ★★★★★Ganesh Mohane· Jun 6, 2024
I recommend LeetCode for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.
- ★★★★★Oshnikdeep· May 5, 2024
Strong directory entry: LeetCode surfaces stars and publisher context so we could sanity-check maintenance before adopting.
- ★★★★★Dhruvi Jain· Apr 4, 2024
LeetCode has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.
- ★★★★★Rahul Santra· Mar 3, 2024
According to our notes, LeetCode benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.
- ★★★★★Pratham Ware· Feb 2, 2024
We wired LeetCode into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.
- ★★★★★Yash Thakker· Jan 1, 2024
LeetCode is a well-scoped MCP server in the explainx.ai directory — install snippets and categories matched our Claude Code setup.