leetcode-mcp-server

v1.5.1
@jinzcdev/leetcode-mcp-server Checked 9 hours ago Published 19 days ago

MCP Server for LeetCode API (supports leetcode.com and leetcode.cn)

These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.

get_daily_challenge

Retrieves today's Daily Challenge problem with full description (read-only, no auth). Returns problem details for the current date as JSON. Use get_problem when you know a specific titleSlug; use search_problems to discover problems by filters.

get_problem

Retrieves a single LeetCode problem by titleSlug (read-only, no auth). Returns description, examples, constraints, and metadata as JSON. Use search_problems to find problems by keyword/tag/difficulty; use get_daily_challenge for today's featured problem.

ParameterTypeDescription
titleSlug *stringProblem URL slug (e.g., 'two-sum', 'add-two-numbers')—the path segment after /problems/

search_problems

Searches LeetCode problems by category, tags, difficulty, and keywords (read-only, no auth). Supports pagination via limit/offset. Returns matching problem list as JSON. Use get_problem when you already know the titleSlug; use this to browse or discover problems.

ParameterTypeDescription
categorystringProblem set category (e.g., 'algorithms', 'database'). Default: 'all-code-essentials'.
difficultystringDifficulty filter. Omit for all levels.
limitnumberMax results per page (default: 10)
offsetnumberResults to skip for pagination (default: 0)
searchKeywordsstringKeyword search in problem titles and descriptions
tagsarrayTopic tags to filter by, e.g. ['array', 'dynamic-programming']. Omit for no tag filter.

get_user_profile

Retrieves any user's public profile by username (read-only, no auth). Returns ranking, avatar, bio, submission stats, and platform-specific progress. Use this to look up other users or public stats. Use get_user_status (requires auth) instead to verify the current session user's login state—not for looking up arbitrary users.

ParameterTypeDescription
username *stringLeetCode username (case-sensitive). Public profile lookup; no authentication required.

get_recent_submissions

Retrieves a user's recent submission history on LeetCode Global (read-only, no auth). Includes both accepted and failed submissions. Global only—not available on CN. Use get_recent_ac_submissions for accepted-only results, or get_all_submissions (auth, current user) for paginated full history with filters.

ParameterTypeDescription
username *stringLeetCode username whose public recent submissions to fetch
limitnumberMax submissions to return (default: 10). Increase for more history within the recent window.

get_recent_ac_submissions

Retrieves a user's recent accepted (AC) submissions (read-only, no auth). Available on both Global and CN. Use get_recent_submissions (Global only) to include failed attempts, or get_all_submissions (auth, current user) for full paginated history.

ParameterTypeDescription
username *stringLeetCode username whose public recent AC submissions to fetch
limitnumberMax AC submissions to return (default: 10)

get_user_contest_ranking

Retrieves a user's contest ranking and participation history (read-only, no auth). Returns overall rating, ranking, and per-contest performance as JSON. Use get_user_profile for general stats and ranking; use this specifically for contest performance data.

ParameterTypeDescription
username *stringLeetCode username whose contest ranking to fetch
attendedbooleantrue = only contests the user attended (default); false = include all contests in history

list_problem_solutions

Lists community solution articles for a problem (read-only, no auth). Returns metadata only (topicId)—not full content. Use get_problem_solution with the returned topicId to read the full article. Do not call this when you already have a topicId and need the solution text.

ParameterTypeDescription
questionSlug *stringProblem URL slug (e.g., 'two-sum')—same as in /problems/{slug}
limitnumberMax solutions per page (default: 10)
orderBystringSort order: 'HOT' (default), 'MOST_VOTES', or 'MOST_RECENT'
skipnumberSolutions to skip for pagination (default: 0)
tagSlugsarrayFilter by language or algorithm tags, e.g. ['python', 'dynamic-programming']
userInputstringKeyword filter on solution title, content, or author (case-insensitive)

get_problem_solution

Retrieves full content of a community solution article (read-only, no auth). Requires topicId from list_problem_solutions. Returns article text, author, and metadata as JSON. Use list_problem_solutions first to discover solutions and obtain topicId.

ParameterTypeDescription
topicId *stringSolution topicId from list_problem_solutions response