# jinzcdev/leetcode-mcp-server [Health: Active]

**Category:** 🤖 Coding Agents  
**Repository:** https://github.com/jinzcdev/leetcode-mcp-server  
**GitHub Stars:** 143  
**npm Downloads (last month):** 1395  
**Views:** 5  
**Installs:** 0  
**Upvotes:** 0  
**Directory Page:** https://allmcps.com/mcp/jinzcdev-leetcode-mcp-server

## Description
MCP server enabling automated access to LeetCode's programming problems, solutions, submissions and public data with optional authentication for user-specific features (e.g., notes), supporting both leetcode.com (global) and leetcode.cn (China) sites.

## Tools
Capabilities this server exposes over MCP:

- **get_daily_challenge** — Retrieves today's Daily Challenge problem with full description (read-only, no auth). Returns problem details for the current date as JSON. Use get_problem when you know a specific titleSlug; use search_problems to discover problems by filters.
- **get_problem** — Retrieves a single LeetCode problem by titleSlug (read-only, no auth). Returns description, examples, constraints, and metadata as JSON. Use search_problems to find problems by keyword/tag/difficulty; use get_daily_challenge for today's featured problem.
- **search_problems** — Searches LeetCode problems by category, tags, difficulty, and keywords (read-only, no auth). Supports pagination via limit/offset. Returns matching problem list as JSON. Use get_problem when you already know the titleSlug; use this to browse or discover problems.
- **get_user_profile** — Retrieves any user's public profile by username (read-only, no auth). Returns ranking, avatar, bio, submission stats, and platform-specific progress. Use this to look up other users or public stats. Use get_user_status (requires auth) instead to verify the current session user's login state—not for looking up arbitrary users.
- **get_recent_submissions** — Retrieves a user's recent submission history on LeetCode Global (read-only, no auth). Includes both accepted and failed submissions. Global only—not available on CN. Use get_recent_ac_submissions for accepted-only results, or get_all_submissions (auth, current user) for paginated full history with filters.
- **get_recent_ac_submissions** — Retrieves a user's recent accepted (AC) submissions (read-only, no auth). Available on both Global and CN. Use get_recent_submissions (Global only) to include failed attempts, or get_all_submissions (auth, current user) for full paginated history.
- **get_user_contest_ranking** — Retrieves a user's contest ranking and participation history (read-only, no auth). Returns overall rating, ranking, and per-contest performance as JSON. Use get_user_profile for general stats and ranking; use this specifically for contest performance data.
- **list_problem_solutions** — Lists community solution articles for a problem (read-only, no auth). Returns metadata only (topicId)—not full content. Use get_problem_solution with the returned topicId to read the full article. Do not call this when you already have a topicId and need the solution text.
- **get_problem_solution** — Retrieves full content of a community solution article (read-only, no auth). Requires topicId from list_problem_solutions. Returns article text, author, and metadata as JSON. Use list_problem_solutions first to discover solutions and obtain topicId.

## Claude Desktop Quick Installation
Install path detected from listing signals. Uses `npx` (confidence: high):

```json
"mcpServers": {
  "leetcode-mcp-server": {
    "command": "npx",
    "args": ["-y","@jinzcdev/leetcode-mcp-server"]
  }
}
```

## Documentation

## 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`:

```bash
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.

_Full upstream README: https://allmcps.com/mcp/jinzcdev-leetcode-mcp-server/readme_

