{"at":"2026-11-23T01:26:43.489Z","dir":"sent","era":"server_discover","message":{"id":1,"jsonrpc":"2.0","method":"server/discover","params":{"_meta":{"io.modelcontextprotocol/clientCapabilities":{},"io.modelcontextprotocol/clientInfo":{"name":"didrun-lab","version":"0.1.0"},"io.modelcontextprotocol/protocolVersion":"2026-07-28"}}}}
{"at":"2026-11-23T01:26:44.020Z","dir":"received","era":"server_discover","message":{"error":{"code":-32601,"message":"Method not found"},"id":1,"jsonrpc":"2.0"}}
{"at":"2026-11-23T01:26:44.121Z","dir":"sent","era":"initialize","message":{"id":1,"jsonrpc":"2.0","method":"initialize","params":{"capabilities":{},"clientInfo":{"name":"didrun-lab","version":"0.1.0"},"protocolVersion":"2025-11-25"}}}
{"at":"2026-11-23T01:26:44.697Z","dir":"received","era":"initialize","message":{"id":1,"jsonrpc":"2.0","result":{"capabilities":{"prompts":{"listChanged":true},"resources":{"listChanged":true},"tools":{"listChanged":true}},"instructions":"You are connected to the LeetCode MCP server, an AI tutor — not a solution oracle.\n\n# Pedagogy contract (server-enforced)\n\n- Every problem the user works on lives in a session. Open one with **start_problem({ titleSlug, language? })** before any other problem-specific call.\n- Hints are progressive and gated. Use **request_hint({ titleSlug })** to advance the user from clarification → approach → implementation sketch → optimal solution. Do not paraphrase later levels before they are unlocked.\n- The community-solutions tools (`list_problem_solutions`, `get_problem_solution`) are gated by the server. They will reject with `HINT_LEVEL_TOO_LOW` until the session has reached the maximum hint level. Drive the user there through hints rather than trying to bypass the gate.\n- Inspect progress with **get_session_state({ titleSlug })**; restart a problem with **reset_session({ titleSlug })**.\n\n# Authoring style\n\n- Match the user's language. The session remembers it; honour it.\n- When you produce hints yourself (vs. paraphrasing the server's hint payload), reference what the user has actually written when possible — generic hints are worse than no hint.\n- Submissions cost the user a real LeetCode submission. Prefer reasoning + `run_local_tests` before calling `submit_solution`.\n\n# Authentication\n\n- Credentials are auto-restored at startup if the user has saved them. If `check_auth_status` reports unauthenticated, point the user at `start_leetcode_auth` and the **leetcode_authentication_guide** prompt.","protocolVersion":"2025-11-25","serverInfo":{"name":"LeetCode MCP Server","version":"3.2.6"}}}}
{"at":"2026-11-23T01:26:44.697Z","dir":"sent","era":"initialize","message":{"jsonrpc":"2.0","method":"notifications/initialized"}}
{"at":"2026-11-23T01:26:44.697Z","dir":"sent","era":"initialize","message":{"id":2,"jsonrpc":"2.0","method":"tools/list","params":{}}}
{"at":"2026-11-23T01:26:44.701Z","dir":"received","era":"initialize","message":{"id":2,"jsonrpc":"2.0","result":{"tools":[{"description":"Returns 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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"properties":{},"type":"object"},"name":"get_started"},{"description":"Retrieves 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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"properties":{},"type":"object"},"name":"get_daily_challenge"},{"description":"Retrieves 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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"titleSlug":{"description":"The URL slug/identifier of the problem (e.g., 'two-sum', 'add-two-numbers') as it appears in the LeetCode URL","type":"string"}},"required":["titleSlug"],"type":"object"},"name":"get_problem"},{"description":"Searches for LeetCode problems based on multiple filter criteria including categories, tags, difficulty levels, and keywords, with pagination support","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"category":{"default":"all-code-essentials","description":"Problem category filter (e.g., 'algorithms', 'database', 'shell') to narrow down the problem domain","enum":["all-code-essentials","algorithms","database","pandas","javascript","shell","concurrency"],"type":"string"},"difficulty":{"description":"Problem difficulty level filter to show only problems of a specific difficulty","enum":["EASY","MEDIUM","HARD"],"type":"string"},"limit":{"default":10,"description":"Maximum number of problems to return in a single request (for pagination)","type":"number"},"offset":{"description":"Number of problems to skip (for pagination)","type":"number"},"searchKeywords":{"description":"Keywords to search in problem titles and descriptions","type":"string"},"tags":{"description":"List of topic tags to filter problems by (e.g., ['array', 'dynamic-programming', 'tree'])","items":{"enum":["array","string","hash-table","dynamic-programming","math","sorting","greedy","depth-first-search","binary-search","database","tree","breadth-first-search","matrix","bit-manipulation","two-pointers","binary-tree","heap-priority-queue","prefix-sum","stack","simulation","graph","counting","sliding-window","design","backtracking","enumeration","linked-list","union-find","ordered-set","monotonic-stack","number-theory","trie","segment-tree","recursion","divide-and-conquer","queue","combinatorics","binary-search-tree","bitmask","memoization","geometry","binary-indexed-tree","hash-function","topological-sort","string-matching","shortest-path","rolling-hash","game-theory","data-stream","interactive","monotonic-queue","brainteaser","doubly-linked-list","merge-sort","randomized","quickselect","counting-sort","iterator","probability-and-statistics","concurrency","bucket-sort","suffix-array","line-sweep","minimum-spanning-tree","shell","reservoir-sampling","strongly-connected-component","eulerian-circuit","radix-sort","biconnected-component","rejection-sampling"],"type":"string"},"type":"array"}},"type":"object"},"name":"search_problems"},{"description":"Retrieves profile information about a LeetCode user, including user stats, solved problems, and profile details","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"username":{"description":"LeetCode username to retrieve profile information for","type":"string"}},"required":["username"],"type":"object"},"name":"get_user_profile"},{"description":"Retrieves a user's recent submissions on LeetCode Global, including both accepted and failed submissions with detailed metadata","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"limit":{"default":10,"description":"Maximum number of submissions to return (optional, defaults to server-defined limit)","type":"number"},"username":{"description":"LeetCode username to retrieve recent submissions for","type":"string"}},"required":["username"],"type":"object"},"name":"get_recent_submissions"},{"description":"Retrieves a user's recent accepted (AC) submissions on LeetCode Global, focusing only on successfully completed problems","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"limit":{"default":10,"description":"Maximum number of accepted submissions to return (optional, defaults to server-defined limit)","type":"number"},"username":{"description":"LeetCode username to retrieve recent accepted submissions for","type":"string"}},"required":["username"],"type":"object"},"name":"get_recent_ac_submissions"},{"description":"Retrieves the current user's status on LeetCode, including login status, premium membership details, and user information (requires authentication)","execution":{"taskSupport":"forbidden"},"inputSchema":{"properties":{},"type":"object"},"name":"get_user_status"},{"description":"Retrieves detailed information about a specific LeetCode submission by its ID, including source code, runtime stats, and test results (requires authentication)","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"id":{"description":"The numerical submission ID to retrieve detailed information for","type":"number"}},"required":["id"],"type":"object"},"name":"get_problem_submission_report"},{"description":"Retrieves the current user's problem-solving status with filtering options, including detailed solution history for attempted or solved questions (requires authentication)","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"difficulty":{"description":"Filter by difficulty levels as an array (e.g., ['EASY', 'MEDIUM', 'HARD']); if not provided, questions of all difficulty levels will be returned","items":{"type":"string"},"type":"array"},"limit":{"default":100,"description":"The maximum number of questions to return in a single request","type":"number"},"offset":{"default":0,"description":"The number of questions to skip for pagination purposes","type":"number"},"questionStatus":{"description":"Filter by question status: 'ATTEMPTED' for questions that have been tried but not necessarily solved, 'SOLVED' for questions that have been successfully completed","enum":["ATTEMPTED","SOLVED"],"type":"string"}},"type":"object"},"name":"get_problem_progress"},{"description":"Retrieves 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)","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"limit":{"default":20,"description":"Maximum number of submissions to return per page (typically defaults to 20 if not specified)","type":"number"},"offset":{"default":0,"description":"Number of submissions to skip for pagination purposes","type":"number"},"questionSlug":{"description":"Optional problem identifier (slug) to filter submissions for a specific problem (e.g., 'two-sum'); if omitted, returns submissions across all problems","type":"string"}},"type":"object"},"name":"get_all_submissions"},{"description":"Retrieves a user's contest ranking information on LeetCode, including overall ranking, participation history, and performance metrics across contests","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"attended":{"default":true,"description":"Whether to include only the contests the user has participated in (true) or all contests (false); defaults to true","type":"boolean"},"username":{"description":"LeetCode username to retrieve contest ranking information for","type":"string"}},"required":["username"],"type":"object"},"name":"get_user_contest_ranking"},{"description":"Opens (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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"language":{"description":"Optional: the language the user is solving in. Recorded on the session for future workspace / runner phases.","type":"string"},"titleSlug":{"description":"The URL slug of the problem (e.g., 'two-sum').","minLength":1,"type":"string"}},"required":["titleSlug"],"type":"object"},"name":"start_problem"},{"description":"Advances 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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"titleSlug":{"description":"The URL slug of the problem the user is working on.","minLength":1,"type":"string"}},"required":["titleSlug"],"type":"object"},"name":"request_hint"},{"description":"Returns 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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"titleSlug":{"description":"The URL slug of the problem.","minLength":1,"type":"string"}},"required":["titleSlug"],"type":"object"},"name":"get_session_state"},{"description":"Resets the tutoring session for a problem back to hint level 0. Use when the user wants to re-attempt the problem from scratch.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"titleSlug":{"description":"The URL slug of the problem to reset.","minLength":1,"type":"string"}},"required":["titleSlug"],"type":"object"},"name":"reset_session"},{"description":"Retrieves 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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"limit":{"default":10,"description":"Maximum number of solutions to return per request. Default 10. Must be a positive integer.","maximum":50,"minimum":1,"type":"integer"},"orderBy":{"default":"HOT","description":"Sorting criteria. 'HOT' is LeetCode's default (recency × popularity), 'MOST_VOTES' = upvotes, 'MOST_RECENT' = newest.","enum":["HOT","MOST_RECENT","MOST_VOTES"],"type":"string"},"questionSlug":{"description":"The URL slug of the problem (e.g., 'two-sum').","type":"string"},"skip":{"default":0,"description":"Number of solutions to skip before collecting results. Used with `limit` for pagination.","minimum":0,"type":"integer"},"tagSlugs":{"default":[],"description":"Tag slugs to filter by (languages or algorithm tags). Solutions must match at least one tag.","items":{"type":"string"},"type":"array"},"userInput":{"description":"Search term to filter solutions by title, content, or author name. Case-insensitive.","type":"string"}},"required":["questionSlug"],"type":"object"},"name":"list_problem_solutions"},{"description":"Retrieves 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`.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"titleSlug":{"description":"The URL slug of the problem the solution belongs to. Required to verify the session has reached the unlock level.","type":"string"},"topicId":{"description":"The unique topic ID of the solution, returned by list_problem_solutions.","type":"string"}},"required":["topicId","titleSlug"],"type":"object"},"name":"get_problem_solution"},{"description":"Runs 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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"code":{"description":"Complete source code to execute. Should include test invocations that print results / raise on failure.","minLength":1,"type":"string"},"language":{"description":"Language to execute as. Currently runnable: python3, go, java. Other LeetCode languages remain valid for submit_solution.","enum":["python3","go","java"],"type":"string"},"timeoutMs":{"description":"Optional wall-clock budget in milliseconds. Defaults are language-specific.","maximum":60000,"minimum":100,"type":"integer"},"titleSlug":{"description":"The URL slug of the problem (must match an active session opened with start_problem).","minLength":1,"type":"string"}},"required":["titleSlug","language","code"],"type":"object"},"name":"run_local_tests"},{"description":"Reports 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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","properties":{},"type":"object"},"name":"runner_doctor"},{"description":"Initiates 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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"properties":{},"type":"object"},"name":"start_leetcode_auth"},{"description":"Validates 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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"csrftoken":{"description":"CSRF token from LeetCode cookies (csrftoken)","minLength":1,"type":"string"},"session":{"description":"Session token from LeetCode cookies (LEETCODE_SESSION)","minLength":1,"type":"string"}},"required":["csrftoken","session"],"type":"object"},"name":"save_leetcode_credentials"},{"description":"Checks if LeetCode credentials exist and are still valid. Returns authentication status, username if authenticated, and credential age information.","execution":{"taskSupport":"forbidden"},"inputSchema":{"properties":{},"type":"object"},"name":"check_auth_status"},{"description":"Submit 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.","execution":{"taskSupport":"forbidden"},"inputSchema":{"$schema":"http://json-schema.org/draft-07/schema#","additionalProperties":false,"properties":{"code":{"description":"The solution code to submit","type":"string"},"language":{"description":"Programming language for the solution","enum":["java","python","python3","c","cpp","c++","csharp","c#","javascript","js","typescript","ts","php","swift","kotlin","dart","golang","go","ruby","scala","rust","racket","erlang","elixir"],"type":"string"},"problemSlug":{"description":"The problem slug (e.g., \"two-sum\")","type":"string"}},"required":["problemSlug","code","language"],"type":"object"},"name":"submit_solution"}]}}}
