leetcode-mcp-server
by jinzcdev·★ 113·Score 47
MCP server providing automated access to LeetCode problems, solutions, and user data with optional authentication.
Overview
The LeetCode MCP Server is a comprehensive tool that bridges AI assistants with LeetCode's extensive programming problem database. It enables both read-only access to public problem data and authenticated access to user-specific features like submission history and personal notes. The server supports both LeetCode Global (leetcode.com) and China (leetcode.cn) platforms, making it versatile for international users.
Try asking AI
After installing, here are 6 things you can ask your AI assistant:
When to choose this
Choose this server if you're a developer preparing for coding interviews or practicing algorithms who wants automated access to LeetCode's problem database and solution analysis.
When NOT to choose this
Don't choose this if you need access to premium LeetCode content or features not exposed through their API, or if you're concerned about sharing your LeetCode credentials.
Tools this server exposes
12 tools extracted from the READMEget_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
get_user_profileRetrieves profile information for a LeetCode user
get_recent_ac_submissionsRetrieves a user's recent accepted submissions
run_codeRuns code for a problem and waits until finished
submit_solutionSubmits code for a problem and waits until finished
list_problem_solutionsRetrieves a list of community solutions for a specific problem
get_noteRetrieves notes for a specific LeetCode problem
create_noteCreates a new note for a specific LeetCode problem
get_problem_submission_reportProvides detailed submission analysis for a specific problem
get_problem_progressRetrieves current user's problem-solving progress
Comparable tools
Installation
Installation
Via Smithery (Recommended for Claude Desktop)
npx -y @smithery/cli install @jinzcdev/leetcode-mcp-server --client claudeManual Installation
npm install @jinzcdev/leetcode-mcp-server -gClaude Desktop Configuration
Add to your settings.json:
{
"mcp": {
"servers": {
"leetcode": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@jinzcdev/leetcode-mcp-server"],
"env": {
"LEETCODE_SITE": "global",
"LEETCODE_SESSION": "<YOUR_LEETCODE_SESSION_COOKIE>"
}
}
}
}
}FAQ
- Do I need a LeetCode account to use this server?
- No, you can access basic problem data without authentication. However, features like submission history, personal notes, and running code require authentication with a LeetCode session cookie.
- Can I use this server with both leetcode.com and leetcode.cn?
- Yes, the server supports both LeetCode Global (leetcode.com) and LeetCode China (leetcode.cn) platforms. You can specify the site using the --site parameter or LEETCODE_SITE environment variable.
- Is the source code available?
- Yes, this is an open-source project. You can clone the repository and run it locally after building the project with npm install && npm run build.
Compare leetcode-mcp-server with
Last updated · Auto-generated from public README + GitHub signals.