developer-tools

LeetCode

jinzcdev

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.

github stars

95

0 commentsdiscussion

Both formats append explainx.ai attribution and the canonical URL for this MCP server listing.

Supports both leetcode.com and leetcode.cnAccess private data with session cookieAdvanced filtering capabilities

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

NPM Version GitHub License smithery badge Chinese Doc Stars

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

  1. Node.js (v20.x or above)
  2. (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=cn is set but you run leetcode-mcp-server --site global, the server will use global.
  • If LEETCODE_SESSION exists but you provide --session "new_cookie", the command-line session value will be used.

Available Tools

Problems

ToolGlobalCNAuth RequiredDescription
get_daily_challengeRetrieves today's LeetCode Daily Challenge problem
get_problemRetrieves details for a specific LeetCode problem
search_problemsSearches for LeetCode problems with multiple filter criteria

Users

ToolGlobalCNAuth RequiredDescription
get_user_profileRetrieves profile information for a LeetCode user
get_user_contest_rankingObtains contest ranking statistics for a user
get_recent_ac_submissionsRetrieves a user's recent accepted submissions
get_recent_submissionsRetrieves a user's recent submissions history
get_user_statusRetrieves current user's current status
get_problem_submission_reportProvides detailed submission analysis for a specific problem
get_problem_progressRetrieves current user's problem-solving progress
get_all_submissionsRetrieves current user's submission history

Notes

ToolGlobalCNAuth RequiredDescription
search_notesSearches for user notes with filtering options
get_noteRetrieves notes for a specific problem by question ID
create_noteCreates a new note for a specific problem
update_noteUpdates an existing note with new content

Solutions

ToolGlobalCNAuth RequiredDescription
list_problem_solutionsRetrieves a list of community solutions for a specific problem
get_problem_solutionRetrieves 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 49 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.

Use Cases

Extended AI Capabilities

Add new capabilities to Claude beyond text generation

Example

Access external data sources, execute code, interact with tools and services

Transform Claude from chatbot to action-taking agent

Context Enhancement

Provide Claude with access to relevant context and data

Example

Load project documentation, access knowledge bases, query databases

Get more accurate, context-aware responses

Workflow Automation

Automate multi-step workflows combining AI and external tools

Example

Research → Summarize → Create document → Send notification

Complete complex tasks end-to-end without manual steps

Implementation Guide

Prerequisites

  • Claude Desktop 0.7.0+ or Cursor IDE with MCP support
  • Basic understanding of MCP architecture and capabilities
  • Access credentials for integrated services (if required)
  • Willingness to experiment and iterate on configuration

Time Estimate

15-60 minutes depending on server complexity

Installation Steps

  1. 1.Install MCP server: npm install -g [package-name] or via GitHub
  2. 2.Add server configuration to ~/.claude/mcp.json
  3. 3.Provide required credentials and configuration
  4. 4.Restart Claude Desktop to load new server
  5. 5.Test basic functionality with simple prompts
  6. 6.Explore capabilities and experiment with use cases
  7. 7.Document successful patterns for reuse

Troubleshooting

  • MCP server not loading: Check config syntax, verify installation
  • Connection errors: Check network, firewall, credentials
  • Feature not working: Read server docs, check required parameters
  • Performance issues: Monitor resource usage, check for network latency
  • Conflicts with other servers: Check port assignments, namespace collisions

Best Practices

✓ Do

  • +Read server documentation thoroughly before setup
  • +Start with simple use cases to validate functionality
  • +Test in non-production environment first
  • +Monitor resource usage and performance
  • +Keep servers updated for bug fixes and new features
  • +Document configuration for team members
  • +Use environment variables for sensitive configuration

✗ Don't

  • Don't grant overly permissive access to MCP servers
  • Don't skip reading security considerations in docs
  • Don't expose sensitive data without proper controls
  • Don't run untrusted MCP servers without code review
  • Don't ignore error messages—investigate root cause

💡 Pro Tips

  • Combine multiple MCP servers for powerful workflows
  • Create custom MCP servers for your specific needs
  • Share successful configurations with team
  • Use MCP inspector for debugging
  • Join MCP community for tips and troubleshooting

Technical Details

Architecture

Model Context Protocol standardizes how AI hosts (Claude, Cursor) communicate with external tools and data sources through server implementations.

Protocols

  • Model Context Protocol (MCP)
  • JSON-RPC 2.0
  • stdio or HTTP transport

Compatibility

  • Claude Desktop
  • Cursor IDE
  • Custom MCP clients

When to Use This

✓ Use When

Use when you need Claude to access external data, execute actions, or integrate with tools. Best for extending AI capabilities beyond conversation.

✗ Avoid When

Avoid when native integrations exist (use official APIs directly), for real-time critical systems, or when security/compliance requires zero external dependencies.

Integration

  • Tool composition: Chain multiple MCP tools in workflows
  • Context augmentation: Provide AI with relevant external data
  • Action delegation: Let AI execute tasks on external systems
  • Bidirectional sync: Keep AI context and external systems in sync

Discussion

Product Hunt–style comments (not star reviews)
  • No comments yet — start the thread.

List & Promote Your MCP Server

Share your MCP server with the developer community

GET_STARTED →
MCP server reviews

Ratings

4.549 reviews
  • Noah Dixit· Dec 16, 2024

    LeetCode reduced integration guesswork — categories and install configs on the listing matched the upstream repo.

  • Pratham Ware· Dec 8, 2024

    We evaluated LeetCode against two servers with overlapping tools; this profile had the clearer scope statement.

  • Mia Wang· Dec 4, 2024

    We wired LeetCode into a staging workspace; the listing’s GitHub and npm pointers saved time versus hunting across READMEs.

  • Hana Robinson· Nov 23, 2024

    According to our notes, LeetCode benefits from clear Model Context Protocol framing — fewer ambiguous “AI plugin” claims.

  • Noah Sanchez· Nov 15, 2024

    We evaluated LeetCode against two servers with overlapping tools; this profile had the clearer scope statement.

  • Henry Gill· Nov 7, 2024

    I recommend LeetCode for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.

  • Noah Ramirez· Oct 26, 2024

    Strong directory entry: LeetCode surfaces stars and publisher context so we could sanity-check maintenance before adopting.

  • Carlos Perez· Oct 14, 2024

    LeetCode has been reliable for tool-calling workflows; the MCP profile page is a good permalink for internal docs.

  • Carlos Srinivasan· Oct 6, 2024

    LeetCode is among the better-indexed MCP projects we tried; the explainx.ai summary tracks the official description.

  • Kwame Farah· Sep 25, 2024

    I recommend LeetCode for teams standardizing on MCP; the explainx.ai page compares cleanly with sibling servers.

showing 1-10 of 49

1 / 5