Leetcode MCP Server logo

Leetcode MCP Server

by jinzcdev

Access LeetCode problems, searches, public profiles, submissions, rankings, and community solutions through MCP.

Install Leetcode MCP Server

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "jinzcdev-leetcode-mcp-server": {
      "command": "npx",
      "args": [
        "-y",
        "@jinzcdev/leetcode-mcp-server"
      ]
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Automated check passed— started and listed 9 tools correctly (1mo ago).

Overview

The jinzcdev/leetcode-mcp-server MCP server exposes LeetCode problem, user, submission, contest, and community-solution data through MCP tools. It supports both leetcode.com and leetcode.cn, with site selection through command-line options or environment variables. Most listed tools are read-only and work without authentication; a LeetCode session cookie enables authenticated, user-specific access. Use it when an MCP client needs to search programming problems, inspect problem details, review public activity, or retrieve solution articles.

Use cases

  • Search LeetCode problems by difficulty, tag, category, or keyword
  • Retrieve the daily challenge for practice workflows
  • Inspect public profiles, rankings, and recent submissions
  • Read community solution articles for a selected problem

Key features

  • Searches problems with filters and pagination
  • Retrieves problem statements and daily challenges
  • Supports leetcode.com and leetcode.cn
  • Reads public profiles, rankings, and submissions
  • Retrieves community solution article content
  • Supports stdio and Streamable HTTP transports

Tools9

What Leetcode MCP Server lets your agent do. Expand a tool for its parameters.

Verified live~1.9k tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked 1d ago

Recent health check succeeded.

7/7 checks healthy over the last 77d

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 8d ago via OSV.dev · @jinzcdev/leetcode-mcp-server (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

GitHub stars155Stargazers on the source repository.
npm downloads694Package downloads in the last 30 days.
Last commit9d agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed9Callable tools this server registers over MCP.
Directory activity8 viewsConfig copies, upvotes, and views on AllMCPs.

How Leetcode MCP Server works

What jinzcdev/leetcode-mcp-server MCP server does

The jinzcdev/leetcode-mcp-server MCP server connects MCP clients to LeetCode's global and China platforms. It provides tools for discovering problems, reading problem statements, checking the daily challenge, inspecting public user data, and retrieving community solution articles.

Problem tools cover three common workflows. search_problems filters problems by keywords, tags, category, and difficulty, with pagination through limit and offset values. get_problem returns a known problem's description, examples, constraints, and metadata using its title slug. get_daily_challenge returns the current day's featured problem.

User-facing read-only tools retrieve public profiles, contest rankings, recent submissions, and recent accepted submissions. Recent submission history is available only on the global site, while accepted-submission lookup works on both supported sites. Community solution access uses a two-step flow: first list articles for a problem to obtain a topic ID, then request the article content with that ID.

How it works

The server communicates with an MCP client using either standard input/output or Streamable HTTP. Stdio is the default and is intended for local client configurations. HTTP mode starts a server that listens on a configured host and port and exposes the MCP endpoint, which defaults to /mcp.

Select the LeetCode deployment with --site global or --site cn; global is the default. Command-line options override matching environment variables. The available configuration covers the site, transport, HTTP port, HTTP host, and endpoint path.

The jinzcdev/leetcode-mcp-server MCP server does not require authentication for the listed problem, public-profile, ranking, recent-submission, or solution-article lookups. Pass a LeetCode session cookie when authenticated access to private or current-user data is needed. The cookie can be supplied with --session or through the LEETCODE_SESSION environment variable.

Setup and configuration

The repository requires Node.js 20 or newer. The documented npm execution path runs the published package with npx:

Terminal
npx -y @jinzcdev/leetcode-mcp-server --site global

For LeetCode China, replace global with cn. To use HTTP transport, add --transport http and optionally set --port, --host, or --endpoint. The project also documents cloning the repository, installing dependencies, building it, and starting node build/index.js locally.

MCP client configuration can pass settings as command-line arguments or environment variables. Supported environment variables include LEETCODE_SITE, LEETCODE_SESSION, LEETCODE_TRANSPORT, LEETCODE_HTTP_PORT, LEETCODE_HTTP_HOST, and LEETCODE_HTTP_ENDPOINT. Session cookies should be treated as sensitive credentials.

Tools and capabilities

The jinzcdev/leetcode-mcp-server MCP server exposes tools for:

  • Finding problems by filters and pagination.
  • Reading complete problem details and the daily challenge.
  • Looking up public profiles and contest performance.
  • Reading recent submissions, including accepted-only history where supported.
  • Listing solution article metadata and retrieving article content.

Results are returned as JSON for the problem, profile, ranking, submission, and solution operations described in the listing. Use a title slug for direct problem retrieval and a topic ID for full solution retrieval.

Limitations and notes

Recent non-accepted submission history is limited to LeetCode Global. Solution listing returns article metadata and topic IDs rather than the article body, so a second tool call is required for full content. Authenticated features depend on a valid LeetCode session cookie and are intended for private or current-user data. The server accesses LeetCode's public and authenticated APIs, so site availability and API behavior may affect results.

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about Leetcode MCP Server

With Node.js 20 or newer, run `npx -y @jinzcdev/leetcode-mcp-server --site global`. Use `--site cn` for LeetCode China.

Not for the listed problem, public-profile, ranking, recent-submission, and solution-article tools. A session cookie enables authenticated user-specific or private data access.

Yes. Start it with `--site cn` or set `LEETCODE_SITE=cn`. Some data differs by site; recent full submission history is available only on Global.

Run `npx -y @jinzcdev/leetcode-mcp-server --transport http --port 3000 --site global`, then connect an MCP client to the configured HTTP endpoint, which defaults to `/mcp`.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewLeetcode MCP Server AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/jinzcdev-leetcode-mcp-server?style=directory)](https://allmcps.com/mcp/jinzcdev-leetcode-mcp-server)
HTML Embed
<a href="https://allmcps.com/mcp/jinzcdev-leetcode-mcp-server"><img src="https://allmcps.com/api/badge/jinzcdev-leetcode-mcp-server?style=directory" alt="Leetcode MCP Server on AllMCPs" /></a>