by jinzcdev
An MCP server enabling automated access to LeetCode's problems, solutions, and public data with optional authentication for user-specific features, supporting leetcode.com & leetcode.cn sites.
# Add to your Claude Code skills
git clone https://github.com/jinzcdev/leetcode-mcp-serverGuides for using mcp servers skills like leetcode-mcp-server.
Last scanned: 5/30/2026
{
"issues": [
{
"type": "npm-audit",
"message": "@eslint/plugin-kit: @eslint/plugin-kit is vulnerable to Regular Expression Denial of Service attacks through ConfigCommentParser",
"severity": "low"
},
{
"type": "npm-audit",
"message": "@modelcontextprotocol/sdk: Anthropic's MCP TypeScript SDK has a ReDoS vulnerability",
"severity": "high"
},
{
"type": "npm-audit",
"message": "ajv: ajv has ReDoS when using `$data` option",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "body-parser: body-parser is vulnerable to denial of service when url encoding is used",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "brace-expansion: brace-expansion Regular Expression Denial of Service vulnerability",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "diff: jsdiff has a Denial of Service vulnerability in parsePatch and applyPatch",
"severity": "low"
},
{
"type": "npm-audit",
"message": "flatted: flatted vulnerable to unbounded recursion DoS in parse() revive phase",
"severity": "high"
},
{
"type": "npm-audit",
"message": "js-yaml: js-yaml has prototype pollution in merge (<<)",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "minimatch: minimatch has a ReDoS via repeated wildcards with non-matching literal in pattern",
"severity": "high"
},
{
"type": "npm-audit",
"message": "path-to-regexp: path-to-regexp vulnerable to Denial of Service via sequential optional groups",
"severity": "high"
},
{
"type": "npm-audit",
"message": "picomatch: Picomatch: Method Injection in POSIX Character Classes causes incorrect Glob Matching",
"severity": "high"
},
{
"type": "npm-audit",
"message": "postcss: PostCSS has XSS via Unescaped </style> in its CSS Stringify Output",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "qs: qs's arrayLimit bypass in comma parsing allows denial of service",
"severity": "medium"
},
{
"type": "npm-audit",
"message": "rollup: Rollup 4 has Arbitrary File Write via Path Traversal",
"severity": "high"
},
{
"type": "npm-audit",
"message": "vite: Vite middleware may serve files starting with the same name with the public directory",
"severity": "high"
},
{
"type": "npm-audit",
"message": "yaml: yaml is vulnerable to Stack Overflow via deeply nested YAML collections",
"severity": "medium"
}
],
"status": "WARNING",
"scannedAt": "2026-05-30T16:32:14.610Z",
"npmAuditRan": true,
"pipAuditRan": true
}leetcode-mcp-server is an open-source mcp servers skill for AI coding assistants such as Claude Code, Codex CLI, and ChatGPT, built by jinzcdev. An MCP server enabling automated access to LeetCode's problems, solutions, and public data with optional authentication for user-specific features, supporting leetcode.com & leetcode.cn sites. It has 136 GitHub stars.
leetcode-mcp-server returned warnings in SkillsLLM's automated security scan. It has no critical vulnerabilities, but review the flagged issues in the Security Report section before adding it to your workflow.
Clone the repository with "git clone https://github.com/jinzcdev/leetcode-mcp-server" and add it to your Claude Code skills directory (see the Installation section above).
leetcode-mcp-server is primarily written in TypeScript. It is open-source under jinzcdev on GitHub, so you can review or fork the full source.
Yes. SkillsLLM lists many other MCP Servers skills you can browse and compare side by side. Open the MCP Servers category from the badge at the top of this page, or use the Related Skills and comparison links further down to weigh leetcode-mcp-server against similar tools.
No comments yet. Be the first to share your thoughts!
Top skills in this category by stars
Requires a passing catalog security scan. Resolve the flagged issues and resubmit to enable featuring.
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.
# Install from npm
npm install @jinzcdev/leetcode-mcp-server -g
# Run with Global site configuration (stdio transport, default)
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>
# Run as a Streamable HTTP server
npx -y @jinzcdev/leetcode-mcp-server --transport http --port 3000 --site global
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 (stdio transport)
node build/index.js --site global
# Or run as a Streamable HTTP server
node build/index.js --transport http --port 3000 --site global
The server supports two transport modes:
| Transport | Description |
|---|---|
stdio (default) |
Standard input/output transport for local MCP clients |
http |
Streamable HTTP transport for web-based integrations and remote access |
| Option | Alias | Default | Description |
|---|---|---|---|
--site |
-s |
global |
LeetCode API site: global (leetcode.com) or cn (leetcode.cn) |
--session |
-c |
โ | LeetCode session cookie for authenticated requests |
--transport |
-t |
stdio |
Transport mode: stdio or http |
--port |
โ | 3000 |
HTTP server port (Streamable HTTP only) |
--host |
โ | 127.0.0.1 |
HTTP server host (Streamable HTTP only) |
--endpoint |
โ | /mcp |
HTTP endpoint path (Streamable HTTP only) |
Add the following server entry to your MCP client configuration file:
{
"mcpServers": {
"leetcode": {
"command": "npx",
"args": ["-y", "@jinzcdev/leetcode-mcp-server"],
"env": {
"LEETCODE_SITE": "global",
"LEETCODE_SESSION": "<YOUR_LEETCODE_SESSION_COOKIE>"
}
}
}
}
{
"mcpServers": {
"leetcode": {
"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.
[!NOTE]
The exact configuration file location and JSON structure may vary by MCP client. Some clients use an
mcp.serverswrapper or atypefield โ refer to your client's documentation and adapt the example accordingly.
First, start the server in HTTP mode:
npx -y @jinzcdev/leetcode-mcp-server --transport http --port 3000 --site global
Then connect your MCP client to the running server:
{
"mcpServers": {
"leetcode": {
"type": "http",
"url": "http://127.0.0.1:3000/mcp"
}
}
}
To use authenticated endpoints, pass the session cookie when starting the server:
npx -y @jinzcdev/leetcode-mcp-server --transport http --port 3000 --site global --session <YOUR_LEETCODE_SESSION_COOKIE>
[!NOTE] Some MCP clients use
"type": "http"or"type": "streamableHttp"alongside theurlfield. Refer to your client's documentation for the exact HTTP transport configuration format.
[!TIP]
The server supports the following optional environment variables:
LEETCODE_SITE: LeetCode API endpoint (globalorcn, default:global)LEETCODE_SESSION: LeetCode session cookie for authenticated API access (default: empty)LEETCODE_TRANSPORT: Transport mode (stdioorhttp, default:stdio)LEETCODE_HTTP_PORT: HTTP server port when using Streamable HTTP (default:3000)LEETCODE_HTTP_HOST: HTTP server host when using Streamable HTTP (default:127.0.0.1)LEETCODE_HTTP_ENDPOINT: HTTP endpoint path when using Streamable HTTP (default:/mcp)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.
| 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 |
| 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 |
| Tool | Global | CN | Auth Required | Description |
|---|---|---|---|---|
| run_code | โ | โ | โ | Runs code for a problem and polls /check/ until finished |
| submit_solution | โ | โ | โ | Submits code for a problem and polls /check/ until finished |
| Tool | Global | CN | Auth Required | Description |
|---|---|---|---|---|
| search_notes | โ | โ | โ |