Loading...

The LeetCode MCP server provides access to LeetCode problems, user data, solutions, and notes, enabling automation and intelligent interaction with the platform.
Boost this tool
Subscribe to listing upgrades or segmented pushes.
The LeetCode MCP server provides access to LeetCode problems, user data, solutions, and notes, enabling automation and intelligent interaction with the platform.
This server is generally safe for read-only operations. Accessing and modifying user notes requires authentication, which introduces a moderate risk if the session cookie is compromised. Ensure proper handling and storage of the session cookie to mitigate potential risks.
Performance depends on the LeetCode API response times and network latency. Consider caching frequently accessed data to improve performance.
Cost depends on the frequency of API calls to LeetCode. Be mindful of rate limits and potential charges for excessive usage.
npx -y @smithery/cli install @jinzcdev/leetcode-mcp-server --client claude{
"mcp": {
"servers": {
"leetcode": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@jinzcdev/leetcode-mcp-server"],
"env": {
"LEETCODE_SITE": "global",
"LEETCODE_SESSION": "<YOUR_LEETCODE_SESSION_COOKIE>"
}
}
}
}
}LEETCODE_SITEget_daily_challengeRetrieves today's LeetCode Daily Challenge problem.
Read-only access to problem data.
get_problemRetrieves details for a specific LeetCode problem.
Read-only access to problem data.
search_problemsSearches for LeetCode problems with multiple filter criteria.
Read-only access to problem data.
get_user_profileRetrieves profile information for a LeetCode user.
Read-only access to user profile data.
get_user_contest_rankingObtains contest ranking statistics for a user.
Read-only access to contest ranking data.
get_recent_ac_submissionsRetrieves a user's recent accepted submissions.
Read-only access to submission data.
get_recent_submissionsRetrieves a user's recent submissions history.
Read-only access to submission data.
get_user_statusRetrieves current user's current status.
Read-only access to user status data.
get_problem_submission_reportProvides detailed submission analysis for a specific problem.
Read-only access to submission report data.
get_problem_progressRetrieves current user's problem-solving progress.
Read-only access to problem progress data.
get_all_submissionsRetrieves current user's submission history.
Read-only access to submission history data.
search_notesSearches for user notes with filtering options.
Read-only access to note data.
get_noteRetrieves notes for a specific problem by question ID.
Read-only access to note data.
create_noteCreates a new note for a specific problem.
Creates a new note for the user.
update_noteUpdates an existing note with new content.
Updates an existing note for the user.
list_problem_solutionsRetrieves a list of community solutions for a specific problem.
Read-only access to community solutions.
get_problem_solutionRetrieves the complete content of a specific solution.
Read-only access to solution content.
Environment Variable
hybrid
This server is generally safe for read-only operations. Accessing and modifying user notes requires authentication, which introduces a moderate risk if the session cookie is compromised. Ensure proper handling and storage of the session cookie to mitigate potential risks.
Autonomy is limited by the need for authentication to access private data and the read-only nature of most tools. The ability to create and update notes introduces a small degree of write access.
Production Tip
Monitor LeetCode API usage to avoid rate limiting and ensure stable performance.
The session cookie is used for authentication, allowing access to private user data and the ability to create and modify notes.
You can typically find your session cookie in your browser's developer tools after logging in to LeetCode.
A compromised session cookie could allow unauthorized access to your LeetCode account, including your notes and submission history. Revoke the cookie immediately.
The documentation does not explicitly mention rate limits, but it's best practice to implement rate limiting in your application to avoid overloading the API.
No, this server primarily provides read access to LeetCode data. It does not support code submission.
Yes, the server supports both leetcode.com (Global) and leetcode.cn (China) platforms. Use the `--site` parameter to specify the desired platform.
`get_recent_submissions` retrieves all recent submissions, while `get_recent_ac_submissions` only retrieves accepted submissions.