
LeetCode
Connects to LeetCode's platform to access programming problem details, search by difficulty/tags, view user profiles, and retrieve community solutions for coding practice.
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.
What it does
- 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
Best for
About LeetCode
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
LeetCode is released under the MIT license. This is a permissive open-source license, meaning you can freely use, modify, and distribute the software.
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.
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
README truncated. View full README on GitHub.
Alternatives
Related Skills
Browse all skillsUI design system toolkit for Senior UI Designer including design token generation, component documentation, responsive design calculations, and developer handoff tools. Use for creating design systems, maintaining visual consistency, and facilitating design-dev collaboration.
Answer questions about the AI SDK and help build AI-powered features. Use when developers: (1) Ask about AI SDK functions like generateText, streamText, ToolLoopAgent, embed, or tools, (2) Want to build AI agents, chatbots, RAG systems, or text generation features, (3) Have questions about AI providers (OpenAI, Anthropic, Google, etc.), streaming, tool calling, structured output, or embeddings, (4) Use React hooks like useChat or useCompletion. Triggers on: "AI SDK", "Vercel AI SDK", "generateText", "streamText", "add AI to my app", "build an agent", "tool calling", "structured output", "useChat".
Master API documentation with OpenAPI 3.1, AI-powered tools, and modern developer experience practices. Create interactive docs, generate SDKs, and build comprehensive developer portals. Use PROACTIVELY for API documentation or developer portal creation.
Use when working with the OpenAI API (Responses API) or OpenAI platform features (tools, streaming, Realtime API, auth, models, rate limits, MCP) and you need authoritative, up-to-date documentation (schemas, examples, limits, edge cases). Prefer the OpenAI Developer Documentation MCP server tools when available; otherwise guide the user to enable `openaiDeveloperDocs`.
Guide for building TypeScript CLIs with Bun. Use when creating command-line tools, adding subcommands to existing CLIs, or building developer tooling. Covers argument parsing, subcommand patterns, output formatting, and distribution.
Integrate Vercel AI SDK applications with You.com tools (web search, AI agent, content extraction). Use when developer mentions AI SDK, Vercel AI SDK, generateText, streamText, or You.com integration with AI SDK.