LeetCode MCP Server

The LeetCode MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with LeetCode APIs, enabling advanced automation and intelligent interaction with LeetCode's…

Local serverstdioMIT

What is the LeetCode MCP Server?

LeetCode MCP Server is an MCP project maintained in the jinzcdev/leetcode-mcp-server repository. The maintainer describes its purpose as “The LeetCode MCP Server is a Model Context Protocol (MCP) server that provides seamless integration with LeetCode APIs, enabling advanced automation and intelligent interaction with…”. Read the project documentation for the complete scope.

Installation

The documented npm package is @jinzcdev/leetcode-mcp-server. The configuration below comes from the maintainer’s example; adapt its paths and account values to your environment.

Configuration values

The example declares LEETCODE_SITE, LEETCODE_SESSION. Secret-looking values have been replaced with placeholders. Required and optional labels are shown only when the documentation states them.

Source

Project documentation · Repository · Discovery listing. This profile records the public documentation checked on 2026-10-08.

Recorded tools

Check the linked publisher documentation and your connected client's tool list. Names and availability can vary with the server version and account permissions.

ToolWhat it does
get_daily_challengeRetrieves today's LeetCode Daily Challenge problem with complete details
get_problemRetrieves details about a specific LeetCode problem
search_problemsSearches for LeetCode problems based on multiple filter criteria
get_user_profileRetrieves profile information about a LeetCode user
get_user_contest_rankingRetrieves a user's contest ranking information
get_recent_ac_submissionsRetrieves a user's recent accepted submissions
get_recent_submissionsRetrieves a user's recent submissions on LeetCode Global
get_user_statusRetrieves the current user's status
get_problem_submission_reportRetrieves detailed information about a specific submission
get_problem_progressRetrieves the current user's problem-solving progress
get_all_submissionsRetrieves paginated list of user's submissions
run_codeRuns code for a specific problem and waits until finished (requires authentication)
submit_solutionSubmits code for a specific problem and waits until finished (requires authentication)
search_notesSearches for user notes on LeetCode China
get_noteRetrieves user notes for a specific LeetCode problem
create_noteCreates a new note for a specific LeetCode problem
update_noteUpdates an existing note with new content or summary
list_problem_solutionsRetrieves a list of community solutions for a specific problem
get_problem_solutionRetrieves the complete content of a specific solution
titleSlugThe URL slug/identifier of the problem (string, required)
categoryProblem category filter (string, optional, default: "all-code-essentials")
tagsList of topic tags to filter problems by (string[], optional)
difficultyFilter by difficulty levels (string[], optional)
searchKeywordsKeywords to search in problem titles and descriptions (string, optional)
limitMaximum number of solutions to return (number, optional, default: 10)
offsetNumber of submissions to skip (number, default: 0)
usernameLeetCode username (string, required)
attendedWhether to include only the contests the user has participated in (boolean, optional, default: true)
idThe numerical submission ID (number, required)
questionStatusFilter by question status (enum: "ATTEMPTED", "SOLVED", optional)
questionSlugThe URL slug/identifier of the problem (string, required)
langProgramming language (string enum, required)
statusSubmission status filter (enum: "AC", "WA", optional, CN only)
lastKeyPagination token for retrieving next page (string, optional, CN only)
typedCodeSource code to submit (string, required)
dataInputCustom input to run (string, optional)
timeoutMsPolling timeout in milliseconds (number, optional, default: 120000)
pollIntervalMsPolling interval in milliseconds (number, optional, default: 1500)
keywordSearch term to filter notes (string, optional)
skipNumber of solutions to skip (number, optional)
orderBySorting criteria for the returned solutions
questionIdThe question ID of the LeetCode problem (string, required)
contentThe new content for the note, supports markdown format (string, required)
summaryAn optional new short summary or title for the note (string, optional)
noteIdThe ID of the note to update (string, required)
userInputSearch term to filter solutions (string, optional)
tagSlugsArray of tag identifiers to filter solutions (string[], optional, default: [])
Globalenum: "HOT", "MOST_RECENT", "MOST_VOTES", optional, default: "HOT"
CNenum: "DEFAULT", "MOST_UPVOTE", "HOT", "NEWEST_TO_OLDEST", "OLDEST_TO_NEWEST", optional, default: "DEFAULT"
topicIdUnique topic ID of the solution (string, required, Global only)
slugUnique slug/identifier of the solution (string, required, CN only)

How to install the LeetCode MCP Server

{
  "mcpServers": {
    "leetcode": {
      "command": "npx",
      "args": [
        "-y",
        "@jinzcdev/leetcode-mcp-server"
      ],
      "env": {
        "LEETCODE_SITE": "global",
        "LEETCODE_SESSION": "<YOUR_LEETCODE_SESSION_COOKIE>"
      }
    }
  }
}

From the project documentation. Replace placeholders and example paths before connecting.

Configuration

VariableDescriptionRequired
LEETCODE_SITEDeclared in the maintainer’s client configuration.Check documentation
LEETCODE_SESSIONDeclared in the maintainer’s client configuration.Check documentation