Skip to content
Back to search

leetcode-mcp-server

An MCP server enabling automated access to LeetCode's problems, solutions, and public data with optional authentication for user-specific features, supporting leetcode.com & leetcode.cn sites.

Safety scan

A static text scan, not a guarantee. Select the badge to see what was scanned and every finding.

Checked today

Check it deeper on your machine

It has changed since its scan on 11 Nov 2026.

As a Claude Code plugin, install it and then ask Claude Code:

/plugin marketplace add keithmackay/mackayi/plugin install scanskillsafety@mackayiDo a deep scan of https://github.com/jinzcdev/leetcode-mcp-server with scanskillsafety

Or from a terminal, clone it and run it:

git clone https://github.com/keithmackay/scanskillsafety-skill ~/.claude/skills/scanskillsafetynode ~/.claude/skills/scanskillsafety/cli.cjs --deep 'https://github.com/jinzcdev/leetcode-mcp-server'

It checks the exact commit: every file, its packages against OSV (api.osv.dev), how it compares with this page's scan (findsafeskills.com receives the repository's address), and, if you agree, Claude reading every file with your own Claude subscription. It never runs the code.

Badge for your README
findsafeskills safety rating

Markdown

[![findsafeskills safety rating](/api/listings/jinzcdev--leetcode-mcp-server/badge.svg)](/listings/jinzcdev--leetcode-mcp-server)

HTML

<a href="/listings/jinzcdev--leetcode-mcp-server"><img src="/api/listings/jinzcdev--leetcode-mcp-server/badge.svg" alt="findsafeskills safety rating" /></a>

Install

i

Install instructions from the README

As written by the repo's author. findsafeskills has not verified these steps.

# Install from npm
npm install @jinzcdev/leetcode-mcp-server -g

# Run with Global site configuration (stdio transport, default)
npx -y @jinzcdev/leetcode-mcp-server --site global

# Run with authentication (for accessing private data)
npx -y @jinzcdev/leetcode-mcp-server --site global --session <YOUR_LEETCODE_SESSION_COOKIE>

# Run as a Streamable HTTP server
npx -y @jinzcdev/leetcode-mcp-server --transport http --port 3000 --site global

Alternatively, you can clone the repository and run it locally:

# Clone the repository
git clone https://github.com/jinzcdev/leetcode-mcp-server.git

# Navigate to the project directory
cd leetcode-mcp-server

# Build the project
npm install && npm run build

# Run the server (stdio transport)
node build/index.js --site global

# Or run as a Streamable HTTP server
node build/index.js --transport http --port 3000 --site global

What was scanned

The files the safety scan read, as written by the repository's author and shown as plain text. Lines with a finding are marked.

README.md · README · 472 lines

View this file on GitHub (read at the repository's current version: the scan did not record which commit it read)

This file has changed since it was scanned, so this is not exactly the text that was scanned, and no line is marked. The findings are listed with the safety scan above.

  1. # LeetCode MCP Server
  2. [![NPM Version](https://img.shields.io/npm/v/@jinzcdev/leetcode-mcp-server.svg)](https://www.npmjs.com/package/@jinzcdev/leetcode-mcp-server)
  3. [![Chinese Doc](https://img.shields.io/badge/docs-中文-blue)](README_zh-CN.md)
  4. [![NPM Downloads](https://img.shields.io/npm/dm/@jinzcdev/leetcode-mcp-server.svg)](https://www.npmjs.com/package/@jinzcdev/leetcode-mcp-server)
  5. [![GitHub License](https://img.shields.io/github/license/jinzcdev/leetcode-mcp-server.svg)](./LICENSE)
  6. [![LeetCode MCP Server on Glama](https://glama.ai/mcp/servers/jinzcdev/leetcode-mcp-server/badges/score.svg)](https://glama.ai/mcp/servers/jinzcdev/leetcode-mcp-server)
  7. [![Stars](https://img.shields.io/github/stars/jinzcdev/leetcode-mcp-server)](https://github.com/jinzcdev/leetcode-mcp-server)
  8. The LeetCode MCP Server is a [Model Context Protocol (MCP)](https://modelcontextprotocol.io/introduction) server that provides seamless integration with LeetCode APIs, enabling advanced automation and intelligent interaction with LeetCode's programming problems, contests, solutions, and user data.
  9. ## Features
  10. - 🌐 **Multi-site Support**: Support​ both leetcode.com (Global) and leetcode.cn (China) platforms
  11. - 🔌 **Dual Transport Modes**: Run as a stdio process (default) or as a [Streamable HTTP](https://modelcontextprotocol.io/docs/concepts/transports) server for web-based integrations
  12. - 📊 **Problem Data Retrieval**: Obtain detailed problem descriptions, constraints, examples, official editorials, and ​user-submitted solutions
  13. - 👤 **User Data Access**: Retrieve user profiles, submission history, and contest performance
  14. - 🔒 **​Private Data Access**: Create and query user notes, manage problem lists, track problem-solving progress, and analyze submission details (AC/WA analysis)
  15. - 🔍 **Advanced Search Capabilities**: Filter problems by tags, difficulty levels, categories, and keywords
  16. - 📅 **Daily Challenge Access**: Easily access daily challenge problems
  17. ## Prerequisites
  18. 1. Node.js (v20.x or above)
  19. 2. (Optional) LeetCode session cookie for authenticated API access
  20. ## Installation
  21. ```bash
  22. # Install from npm
  23. npm install @jinzcdev/leetcode-mcp-server -g
  24. # Run with Global site configuration (stdio transport, default)
  25. npx -y @jinzcdev/leetcode-mcp-server --site global
  26. # Run with authentication (for accessing private data)
  27. npx -y @jinzcdev/leetcode-mcp-server --site global --session <YOUR_LEETCODE_SESSION_COOKIE>
  28. # Run as a Streamable HTTP server
  29. npx -y @jinzcdev/leetcode-mcp-server --transport http --port 3000 --site global
  30. ```
  31. Alternatively, you can clone the repository and run it locally:
  32. ```bash
  33. # Clone the repository
  34. git clone https://github.com/jinzcdev/leetcode-mcp-server.git
  35. # Navigate to the project directory
  36. cd leetcode-mcp-server
  37. # Build the project
  38. npm install && npm run build
  39. # Run the server (stdio transport)
  40. node build/index.js --site global
  41. # Or run as a Streamable HTTP server
  42. node build/index.js --transport http --port 3000 --site global
  43. ```
  44. ## Usage
  45. The server supports two transport modes:
  46. | Transport | Description |
  47. | ----------------- | ---------------------------------------------------------------------------------------------------------------------------------- |
  48. | `stdio` (default) | Standard input/output transport for local MCP clients |
  49. | `http` | [Streamable HTTP](https://modelcontextprotocol.io/docs/concepts/transports) transport for web-based integrations and remote access |
  50. ### Command-Line Options
  51. | Option | Alias | Default | Description |
  52. | ------------- | ----- | ----------- | ---------------------------------------------------------------- |
  53. | `--site` | `-s` | `global` | LeetCode API site: `global` (leetcode.com) or `cn` (leetcode.cn) |
  54. | `--session` | `-c` | — | LeetCode session cookie for authenticated requests |
  55. | `--transport` | `-t` | `stdio` | Transport mode: `stdio` or `http` |
  56. | `--port` | — | `3000` | HTTP server port (Streamable HTTP only) |
  57. | `--host` | — | `127.0.0.1` | HTTP server host (Streamable HTTP only) |
  58. | `--endpoint` | — | `/mcp` | HTTP endpoint path (Streamable HTTP only) |
  59. ### MCP Client Configuration (stdio)
  60. Add the following server entry to your MCP client configuration file:
  61. #### Option 1: Using Environment Variables
  62. ```json
  63. {
  64. "mcpServers": {
  65. "leetcode": {
  66. "command": "npx",
  67. "args": ["-y", "@jinzcdev/leetcode-mcp-server"],
  68. "env": {
  69. "LEETCODE_SITE": "global",
  70. "LEETCODE_SESSION": "<YOUR_LEETCODE_SESSION_COOKIE>"
  71. }
  72. }
  73. }
  74. }
  75. ```
  76. #### Option 2: Using Command Line Arguments
  77. ```json
  78. {
  79. "mcpServers": {
  80. "leetcode": {
  81. "command": "npx",
  82. "args": [
  83. "-y",
  84. "@jinzcdev/leetcode-mcp-server",
  85. "--site",
  86. "global",
  87. "--session",
  88. "<YOUR_LEETCODE_SESSION_COOKIE>"
  89. ]
  90. }
  91. }
  92. }
  93. ```
  94. For LeetCode China site, modify the `--site` parameter to `cn`.
  95. > [!NOTE]
  96. >
  97. > The exact configuration file location and JSON structure may vary by MCP client. Some clients use an `mcp.servers` wrapper or a `type` field — refer to your client's documentation and adapt the example accordingly.
  98. ### MCP Client Configuration (Streamable HTTP)
  99. First, start the server in HTTP mode:
  100. ```bash
  101. npx -y @jinzcdev/leetcode-mcp-server --transport http --port 3000 --site global
  102. ```
  103. Then connect your MCP client to the running server:
  104. ```json
  105. {
  106. "mcpServers": {
  107. "leetcode": {
  108. "type": "http",
  109. "url": "http://127.0.0.1:3000/mcp"
  110. }
  111. }
  112. }
  113. ```
  114. To use authenticated endpoints, pass the session cookie when starting the server:
  115. ```bash
  116. npx -y @jinzcdev/leetcode-mcp-server --transport http --port 3000 --site global --session <YOUR_LEETCODE_SESSION_COOKIE>
  117. ```
  118. > [!NOTE]
  119. > Some MCP clients use `"type": "http"` or `"type": "streamableHttp"` alongside the `url` field. Refer to your client's documentation for the exact HTTP transport configuration format.
  120. > [!TIP]
  121. >
  122. > The server supports the following optional environment variables:
  123. >
  124. > - `LEETCODE_SITE`: LeetCode API endpoint (`global` or `cn`, default: `global`)
  125. > - `LEETCODE_SESSION`: LeetCode session cookie for authenticated API access (default: empty)
  126. > - `LEETCODE_TRANSPORT`: Transport mode (`stdio` or `http`, default: `stdio`)
  127. > - `LEETCODE_HTTP_PORT`: HTTP server port when using Streamable HTTP (default: `3000`)
  128. > - `LEETCODE_HTTP_HOST`: HTTP server host when using Streamable HTTP (default: `127.0.0.1`)
  129. > - `LEETCODE_HTTP_ENDPOINT`: HTTP endpoint path when using Streamable HTTP (default: `/mcp`)
  130. >
  131. > **Priority Note**:
  132. > Command-line arguments take precedence over environment variables when both are specified. For example:
  133. >
  134. > - If `LEETCODE_SITE=cn` is set but you run `leetcode-mcp-server --site global`, the server will use `global`.
  135. > - If `LEETCODE_SESSION` exists but you provide `--session "new_cookie"`, the command-line session value will be used.
  136. ## Available Tools
  137. ### Problems
  138. | Tool | Global | CN | Auth Required | Description |
  139. | ----------------------- | :----: | :-: | :-----------: | ------------------------------------------------------------ |
  140. | **get_daily_challenge** | ✅ | ✅ | ❌ | Retrieves today's LeetCode Daily Challenge problem |
  141. | **get_problem** | ✅ | ✅ | ❌ | Retrieves details for a specific LeetCode problem |
  142. | **search_problems** | ✅ | ✅ | ❌ | Searches for LeetCode problems with multiple filter criteria |
  143. ### Users
  144. | Tool | Global | CN | Auth Required | Description |
  145. | --------------------------------- | :----: | :-: | :-----------: | ------------------------------------------------------------ |
  146. | **get_user_profile** | ✅ | ✅ | ❌ | Retrieves profile information for a LeetCode user |
  147. | **get_user_contest_ranking** | ✅ | ✅ | ❌ | Obtains contest ranking statistics for a user |
  148. | **get_recent_ac_submissions** | ✅ | ✅ | ❌ | Retrieves a user's recent accepted submissions |
  149. | **get_recent_submissions** | ✅ | ❌ | ❌ | Retrieves a user's recent submissions history |
  150. | **get_user_status** | ✅ | ✅ | ✅ | Retrieves current user's current status |
  151. | **get_problem_submission_report** | ✅ | ✅ | ✅ | Provides detailed submission analysis for a specific problem |
  152. | **get_problem_progress** | ✅ | ✅ | ✅ | Retrieves current user's problem-solving progress |
  153. | **get_all_submissions** | ✅ | ✅ | ✅ | Retrieves current user's submission history |
  154. ### Submissions
  155. | Tool | Global | CN | Auth Required | Description |
  156. | ------------------- | :----: | :-: | :-----------: | ------------------------------------------------------------- |
  157. | **run_code** | ✅ | ✅ | ✅ | Runs code for a problem and polls `/check/` until finished |
  158. | **submit_solution** | ✅ | ✅ | ✅ | Submits code for a problem and polls `/check/` until finished |
  159. ### Notes
  160. | Tool | Global | CN | Auth Required | Description |
  161. | ---------------- | :----: | :-: | :-----------: | ----------------------------------------------------- |
  162. | **search_notes** | ❌ | ✅ | ✅ | Searches for user notes with filtering options |
  163. | **get_note** | ❌ | ✅ | ✅ | Retrieves notes for a specific problem by question ID |
  164. | **create_note** | ❌ | ✅ | ✅ | Creates a new note for a specific problem |
  165. | **update_note** | ❌ | ✅ | ✅ | Updates an existing note with new content |
  166. ### Problem Lists
  167. | Tool | Global | CN | Auth Required | Description |
  168. | ----------------------------- | :----: | :-: | :-----------: | ------------------------------------------------------------ |
  169. | **list_problem_lists** | ✅ | ✅ | ✅ | Lists the current user's problem lists (favorites) |
  170. | **get_problem_list** | ✅ | ✅ | ✅ | Retrieves a problem list's metadata and its questions |
  171. | **create_problem_list** | ✅ | ✅ | ✅ | Creates a new problem list, optionally with initial problems |
  172. | **update_problem_list** | ✅ | ✅ | ✅ | Renames a problem list, edits its description or visibility |
  173. | **add_problems_to_list** | ✅ | ✅ | ✅ | Adds problems to a problem list by slug or problem number |
  174. | **remove_problems_from_list** | ✅ | ✅ | ✅ | Removes problems from a problem list |
  175. | **reorder_problem_list** | ✅ | ✅ | ✅ | Reorders the problems inside a problem list |
  176. ### Solutions
  177. | Tool | Global | CN | Auth Required | Description |
  178. | -------------------------- | :----: | :-: | :-----------: | -------------------------------------------------------------- |
  179. | **list_problem_solutions** | ✅ | ✅ | ❌ | Retrieves a list of community solutions for a specific problem |
  180. | **get_problem_solution** | ✅ | ✅ | ❌ | Retrieves the complete content of a specific solution |
  181. ## Tool Parameters
  182. ### Problems
  183. - **get_daily_challenge** - Retrieves today's LeetCode Daily Challenge problem with complete details
  184. - No parameters required
  185. - **get_problem** - Retrieves details about a specific LeetCode problem
  186. - `titleSlug`: The URL slug/identifier of the problem (string, required)
  187. - **search_problems** - Searches for LeetCode problems based on multiple filter criteria
  188. - `category`: Problem category filter (string, optional, default: "all-code-essentials")
  189. - `tags`: List of topic tags to filter problems by (string[], optional)
  190. - `difficulty`: Problem difficulty level filter (enum: "EASY", "MEDIUM", "HARD", optional)
  191. - `searchKeywords`: Keywords to search in problem titles and descriptions (string, optional)
  192. - `limit`: Maximum number of problems to return (number, optional, default: 10)
  193. - `offset`: Number of problems to skip (number, optional)
  194. ### Users
  195. - **get_user_profile** - Retrieves profile information about a LeetCode user
  196. - `username`: LeetCode username (string, required)
  197. - **get_user_contest_ranking** - Retrieves a user's contest ranking information
  198. - `username`: LeetCode username (string, required)
  199. - `attended`: Whether to include only the contests the user has participated in (boolean, optional, default: true)
  200. - **get_recent_submissions** - Retrieves a user's recent submissions on LeetCode Global
  201. - `username`: LeetCode username (string, required)
  202. - `limit`: Maximum number of submissions to return (number, optional, default: 10)
  203. - **get_recent_ac_submissions** - Retrieves a user's recent accepted submissions
  204. - `username`: LeetCode username (string, required)
  205. - `limit`: Maximum number of submissions to return (number, optional, default: 10)
  206. - **get_user_status** - Retrieves the current user's status
  207. - No parameters required
  208. - **get_problem_submission_report** - Retrieves detailed information about a specific submission
  209. - `id`: The numerical submission ID (number, required)
  210. - **get_problem_progress** - Retrieves the current user's problem-solving progress
  211. - `offset`: Number of questions to skip (number, optional, default: 0)
  212. - `limit`: Maximum number of questions to return (number, optional, default: 100)
  213. - `questionStatus`: Filter by question status (enum: "ATTEMPTED", "SOLVED", optional)
  214. - `difficulty`: Filter by difficulty levels (string[], optional)
  215. - **get_all_submissions** - Retrieves paginated list of user's submissions
  216. - `limit`: Maximum number of submissions to return (number, default: 20)
  217. - `offset`: Number of submissions to skip (number, default: 0)
  218. - `questionSlug`: Optional problem identifier (string, optional)
  219. - `lang`: Programming language filter (string, optional, CN only)
  220. - `status`: Submission status filter (enum: "AC", "WA", optional, CN only)
  221. - `lastKey`: Pagination token for retrieving next page (string, optional, CN only)
  222. ### Submissions
  223. - **run_code** - Runs code for a specific problem and waits until finished (requires authentication)
  224. - `titleSlug`: The URL slug/identifier of the problem (string, required)
  225. - `lang`: Programming language (string enum, required)
  226. - `typedCode`: Source code to run (string, required)
  227. - `dataInput`: Custom input to run (string, optional)
  228. - `timeoutMs`: Polling timeout in milliseconds (number, optional, default: 120000)
  229. - `pollIntervalMs`: Polling interval in milliseconds (number, optional, default: 1500)
  230. - **submit_solution** - Submits code for a specific problem and waits until finished (requires authentication)
  231. - `titleSlug`: The URL slug/identifier of the problem (string, required)
  232. - `lang`: Programming language (string enum, required)
  233. - `typedCode`: Source code to submit (string, required)
  234. - `timeoutMs`: Polling timeout in milliseconds (number, optional, default: 120000)
  235. - `pollIntervalMs`: Polling interval in milliseconds (number, optional, default: 1500)
  236. ### Notes
  237. - **search_notes** - Searches for user notes on LeetCode China
  238. - `keyword`: Search term to filter notes (string, optional)
  239. - `limit`: Maximum number of notes to return (number, optional, default: 10)
  240. - `skip`: Number of notes to skip (number, optional, default: 0)
  241. - `orderBy`: Sort order for returned notes (enum: "ASCENDING", "DESCENDING", optional, default: "DESCENDING")
  242. - **get_note** - Retrieves user notes for a specific LeetCode problem
  243. - `questionId`: The question ID of the LeetCode problem (string, required)
  244. - `limit`: Maximum number of notes to return (number, optional, default: 10)
  245. - `skip`: Number of notes to skip (number, optional, default: 0)
  246. - **create_note** - Creates a new note for a specific LeetCode problem
  247. - `questionId`: The question ID of the LeetCode problem (string, required)
  248. - `content`: The content of the note, supports markdown format (string, required)
  249. - `summary`: An optional short summary or title for the note (string, optional)
  250. - **update_note** - Updates an existing note with new content or summary
  251. - `noteId`: The ID of the note to update (string, required)
  252. - `content`: The new content for the note, supports markdown format (string, required)
  253. - `summary`: An optional new short summary or title for the note (string, optional)
  254. ### Problem Lists
  255. Problem lists are identified by their `favoriteSlug`, the path segment after `/problem-list/` in the list URL.
  256. - **list_problem_lists** - Lists the current user's problem lists
  257. - `includeCollected`: Also return lists saved from other creators (boolean, optional, default: false)
  258. - **get_problem_list** - Retrieves a problem list's metadata and a page of its questions
  259. - `favoriteSlug`: The slug of the problem list (string, required)
  260. - `limit`: Maximum number of questions to return (number, optional, default: 50)
  261. - `skip`: Number of questions to skip (number, optional, default: 0)
  262. - `searchKeyword`: Keyword to filter questions by title (string, optional)
  263. - `sortField`: Sort field: `CUSTOM` (the order shown on the website), `FRONTEND_ID`, `DIFFICULTY`, `AC_RATE`, `FREQUENCY` or `CONTEST_POINT` (string, optional, default: `CUSTOM`)
  264. - `sortOrder`: `ASCENDING` or `DESCENDING` (string, optional, default: `ASCENDING`)
  265. - **create_problem_list** - Creates a new problem list
  266. - `name`: Display name of the list (string, required)
  267. - `description`: Description of the list (string, optional, default: "")
  268. - `isPublic`: Whether the list is publicly visible (boolean, optional, default: false)
  269. - `questionSlugs`: Problem slugs to add right after creation (string[], optional)
  270. - `questionIds`: Problem numbers to add right after creation, e.g. `[1, 1143]`; numbers that cannot be resolved are returned in `unresolved` ((string | number)[], optional)
  271. - **update_problem_list** - Renames a problem list, changes its description or toggles its visibility (at least one optional field is required)
  272. - `favoriteSlug`: The slug of the problem list (string, required)
  273. - `name`: New display name (string, optional)
  274. - `description`: New description (string, optional)
  275. - `isPublic`: New visibility (boolean, optional)
  276. - **add_problems_to_list** - Adds problems to a problem list (at least one of `questionSlugs` / `questionIds` is required; problems are appended in the given order, slugs first)
  277. - `favoriteSlug`: The slug of the problem list (string, required)
  278. - `questionSlugs`: Problem slugs to add, e.g. `["two-sum"]` (string[], optional)
  279. - `questionIds`: Problem numbers to add, e.g. `[1, 1143]` or `["LCP 82"]`; numbers that cannot be resolved are returned in `unresolved` ((string | number)[], optional)
  280. - **remove_problems_from_list** - Removes problems from a problem list
  281. - `favoriteSlug`: The slug of the problem list (string, required)
  282. - `questionSlugs`: Problem slugs to remove (string[], required)
  283. - **reorder_problem_list** - Reorders the problems inside a problem list (exactly one of `sortField` / `questionSlugs` is required; one problem is moved per request)
  284. - `favoriteSlug`: The slug of the problem list (string, required)
  285. - `sortField`: Sort the whole list by `FRONTEND_ID`, `DIFFICULTY`, `AC_RATE`, `FREQUENCY` or `CONTEST_POINT` (string, optional)
  286. - `sortOrder`: `ASCENDING` or `DESCENDING` (string, optional, default: `ASCENDING`)
  287. - `questionSlugs`: Problem slugs to move to the top, in this order; the remaining problems keep their relative order (string[], optional)
  288. ### Solutions
  289. - **list_problem_solutions** - Retrieves a list of community solutions for a specific problem
  290. - `questionSlug`: The URL slug/identifier of the problem (string, required)
  291. - `limit`: Maximum number of solutions to return (number, optional, default: 10)
  292. - `skip`: Number of solutions to skip (number, optional)
  293. - `userInput`: Search term to filter solutions (string, optional)
  294. - `tagSlugs`: Array of tag identifiers to filter solutions (string[], optional, default: [])
  295. - `orderBy`: Sorting criteria for the returned solutions
  296. - Global: enum: "HOT", "MOST_RECENT", "MOST_VOTES", optional, default: "HOT"
  297. - CN: enum: "DEFAULT", "MOST_UPVOTE", "HOT", "NEWEST_TO_OLDEST", "OLDEST_TO_NEWEST", optional, default: "DEFAULT"
  298. - **get_problem_solution** - Retrieves the complete content of a specific solution
  299. - `topicId`: Unique topic ID of the solution (string, required, Global only)
  300. - `slug`: Unique slug/identifier of the solution (string, required, CN only)
  301. ## Available Resources
  302. | Resource Name | Global | CN | Auth Required | Description |
  303. | ---------------------- | :----: | :-: | :-----------: | ------------------------------------------------------------ |
  304. | **problem-categories** | ✅ | ✅ | ❌ | A list of all problem classification categories |
  305. | **problem-tags** | ✅ | ✅ | ❌ | A detailed collection of algorithmic and data structure tags |
  306. | **problem-langs** | ✅ | ✅ | ❌ | A complete list of all supported programming languages |
  307. | **problem-detail** | ✅ | ✅ | ❌ | Provides details about a specific problem |
  308. | **problem-solution** | ✅ | ✅ | ❌ | Provides the complete content of a specific solution |
  309. ## Resource URIs
  310. - **problem-categories** - A list of all problem classification categories
  311. - URI: `categories://problems/all`
  312. - **problem-tags** - A detailed collection of algorithmic and data structure tags
  313. - URI: `tags://problems/all`
  314. - **problem-langs** - A complete list of all programming languages supported by LeetCode
  315. - URI: `langs://problems/all`
  316. - **problem-detail** - Provides details about a specific LeetCode problem
  317. - URI: `problem://{titleSlug}`
  318. - Parameters:
  319. - `titleSlug`: Problem identifier as it appears in the LeetCode URL
  320. - **problem-solution** - Provides the complete content of a specific solution
  321. - Global URI: `solution://{topicId}`
  322. - Parameters:
  323. - `topicId`: Unique topic ID of the solution
  324. - CN URI: `solution://{slug}`
  325. - Parameters:
  326. - `slug`: Unique slug/identifier of the solution
  327. ## Authentication
  328. User-specific data access requires LeetCode session authentication:
  329. 1. Log in to LeetCode ([Global](https://leetcode.com) or [China](https://leetcode.cn) site)
  330. 2. Extract `LEETCODE_SESSION` cookie from browser developer tools
  331. 3. Configure server with `--session` flag or `LEETCODE_SESSION` environment variable
  332. ## Response Format
  333. All tools return JSON-formatted responses with the following structure:
  334. ```json
  335. {
  336. "content": [
  337. {
  338. "type": "text",
  339. "text": "JSON_DATA_STRING"
  340. }
  341. ]
  342. }
  343. ```
  344. The `JSON_DATA_STRING` contains either the requested data or an error message for failed requests.
  345. ## License
  346. This project is licensed under the MIT License.

Ratings and comments

Sign in to rate this skill.

Sign in

Free to use. If it’s helped, pass it on.