check_auth_status
Checks if LeetCode credentials exist and are still valid. Returns authentication status, username if authenticated, and credential age information.
Work a LeetCode problem through a hint ladder that unlocks community solutions only at the end, and run your code locally before spending a real submission.
LABSCO SUMMARY
start_problem opens a session per problem and request_hint walks it up one level at a time; list_problem_solutions and get_problem_solution reject with HINT_LEVEL_TOO_LOW until that session has reached the maximum, so the community write-ups are not reachable on the first turn. run_local_tests keeps the inner loop off LeetCode entirely, and with LEETCODE_MCP_STRICT_MODE=1 set, submit_solution refuses until a local run has passed for that problem. The 24 tools only work as designed if the client actually calls get_started first — the flow is carried by convention, not enforced at every step.
An MCP server in front of LeetCode that adds a tutoring session on top of it: per-problem hint levels, a local test runner, and a gate on community solutions.
A LeetCode account for anything marked as needing authentication: start_leetcode_auth opens the login and walks the agent through pulling the session and csrftoken values out of browser DevTools, and save_leetcode_credentials validates and stores them. run_local_tests needs a language runtime on the host — runner_doctor reports whether python3, go, java and the sandboxes bwrap, firejail or sandbox-exec were found.
One command plus credentials — npx -y @sperekrestova/interactive-leetcode-mcp@latest, then supply credentials
USE CASES
Open a session for the problem and pull hints one level at a time, so the assistant escalates only when you are stuck.
Run the code locally in the inner loop and only submit once it passes; the code you pass in has to carry its own test invocations, and runner_doctor says whether the host has the runtime for it.
Drive the hints to the top of the ladder, then take the metadata list and open the write-up you want in full.
Pull today's problem with its constraints and examples and open a session on it in the same turn.
Read the account's own history rather than guessing — what has been solved, what was attempted, and how contests went.
Counted once with only startup setup. Other versions, modes or optional credentials may expose a different list.
check_auth_statusChecks if LeetCode credentials exist and are still valid. Returns authentication status, username if authenticated, and credential age information.
get_all_submissionsRetrieves a paginated list of the current user's submissions for a specific problem or all problems on LeetCode Global, with detailed submission metadata (requires authentication)
get_daily_challengeRetrieves today's LeetCode Daily Challenge problem with complete details, including problem description, constraints, and examples. After fetching, invoke the leetcode_learning_mode and leetcode_problem_workflow prompts before helping the user work on it.
get_problemRetrieves details about a specific LeetCode problem, including its description, examples, constraints, and related information. After fetching, invoke the leetcode_learning_mode and leetcode_problem_workflow prompts before helping the user work on it.
get_problem_progressRetrieves the current user's problem-solving status with filtering options, including detailed solution history for attempted or solved questions (requires authentication)
get_problem_solutionRetrieves the full content of a specific community solution. GATED: rejects with HINT_LEVEL_TOO_LOW unless the session for titleSlug has reached the maximum hint level. Pass the topicId returned by list_problem_solutions.
get_problem_submission_reportRetrieves detailed information about a specific LeetCode submission by its ID, including source code, runtime stats, and test results (requires authentication)
get_recent_ac_submissionsRetrieves a user's recent accepted (AC) submissions on LeetCode Global, focusing only on successfully completed problems
get_recent_submissionsRetrieves a user's recent submissions on LeetCode Global, including both accepted and failed submissions with detailed metadata
get_session_stateReturns the persisted session for a problem, or null if the user has not called start_problem for it. Useful for restoring context after a restart.
get_startedReturns the usage guide for this MCP server: which prompts to invoke and when, session flow, auth flow, and submission language map. Call this at the start of any LeetCode practice session.
get_user_contest_rankingRetrieves a user's contest ranking information on LeetCode, including overall ranking, participation history, and performance metrics across contests
get_user_profileRetrieves profile information about a LeetCode user, including user stats, solved problems, and profile details
get_user_statusRetrieves the current user's status on LeetCode, including login status, premium membership details, and user information (requires authentication)
list_problem_solutionsRetrieves community solution metadata (topicIds) for a problem. GATED: rejects with HINT_LEVEL_TOO_LOW unless the active session for the slug has reached the maximum hint level. Drive the user through request_hint until that level is reached.
request_hintAdvances the hint level for an active session and returns the next hint. Levels: 1 clarification → 2 approach → 3 implementation sketch → 4 solution unlock. The community-solutions tools become callable only after this has been driven to level 4.
reset_sessionResets the tutoring session for a problem back to hint level 0. Use when the user wants to re-attempt the problem from scratch.
run_local_testsRuns the user's code locally in an isolated subprocess, captures stdout / stderr / exit code, and updates the session's lastLocalRunPassed flag. Use this in the inner loop instead of submit_solution — it costs no LeetCode submission and turns around in seconds. The agent is responsible for including test invocations (e.g. print(Solution().twoSum([2,7,11,15], 9))) in the code passed in. Currently runnable: python3, go, and java.
runner_doctorReports which language runtimes (python3, go, java) and OS sandbox tools (bwrap, firejail, sandbox-exec) are detected on this host. Useful for diagnosing 'LANGUAGE_RUNTIME_NOT_FOUND' errors and confirming whether run_local_tests will be sandboxed.
save_leetcode_credentialsValidates and saves LeetCode credentials provided by the user. Validates credentials by making a test API call to LeetCode, then securely stores them for future authenticated requests.
search_problemsSearches for LeetCode problems based on multiple filter criteria including categories, tags, difficulty levels, and keywords, with pagination support
start_leetcode_authInitiates LeetCode authentication flow. Opens browser to LeetCode login (if possible) and provides instructions for the AI agent to guide the user through manual credential extraction from browser DevTools.
start_problemOpens (or resumes) a tutoring session for a LeetCode problem. Must be called before request_hint, list_problem_solutions, or get_problem_solution. Idempotent: re-running on a slug the user is already mid-way through preserves their hint progress.
submit_solutionSubmit a solution to a LeetCode problem and get results. Returns acceptance status, runtime/memory stats, or failed test case details. When LEETCODE_MCP_STRICT_MODE=1 is set, requires run_local_tests to have last passed for the problem first — saves real LeetCode submissions for solutions that pass examples locally.
BEFORE YOU INSTALL
24 tools when we connected. start_problem must run before the hint and solution tools, list_problem_solutions and get_problem_solution unlock only at the solution hint level, and account tools need saved LeetCode cookies.
Node.js v20.x or above
The documented client runs the server on your machine.
CONTEXT COST
Rated by the size of the 24 tool definitions that ride along on every turn, not by how many there are
INSTALLATION
git clone https://github.com/SPerekrestova/interactive-leetcode-mcp.git
cd interactive-leetcode-mcp
npm install && npm run build
npm linknpx -y @sperekrestova/interactive-leetcode-mcp@latest{
"mcpServers": {
"leetcode": {
"command": "npx",
"args": [
"-y",
"@sperekrestova/interactive-leetcode-mcp@latest"
]
}
}
}