LeetCode

v1.0.0โ€ขDeveloper Toolsโ€ขstable

๐Ÿ“‡ โ˜๏ธ - An MCP server that enables AI models to search, retrieve, and solve LeetCode problems. Supports metadata filtering, user profiles, submissions, and contest data access.

leetcodemcpai-integration
Share:
42
Stars
0
Downloads
0
Weekly
0/5

What is LeetCode?

LeetCode is a Model Context Protocol (MCP) server that allows AI assistants like Claude, Cursor, and VS Code to ๐Ÿ“‡ โ˜๏ธ - an mcp server that enables ai models to search, retrieve, and solve leetcode problems. supports metadata filtering, user profiles, submissions, and contest data access.

๐Ÿ“‡ โ˜๏ธ - An MCP server that enables AI models to search, retrieve, and solve LeetCode problems. Supports metadata filtering, user profiles, submissions, and contest data access.

This server falls under the Developer Tools category on MCPgee, the world's largest MCP server directory with 33,000+ servers.

Features

  • ๐Ÿ“‡ โ˜๏ธ - An MCP server that enables AI models to search, retri

Use Cases

Search and retrieve LeetCode problems with metadata filtering.
Access user profiles and submission history.
Browse contest data and solve problems with AI assistance.
doggybee

Maintainer

LicenseMIT License
Languagetypescript
Versionv1.0.0
UpdatedMay 5, 2026
Statushealthy
Maintenanceactive

Works with

ClaudeOpenAIwindowsmacoslinux

Installation

NPM

npx -y @jinzcdev/leetcode-mcp-server

Manual Installation

npx -y @jinzcdev/leetcode-mcp-server

Configuration

Configuration Details

Config File

claude_desktop_config.json

Performance

Response Metrics

Response Time< 200ms
ThroughputMedium

Resource Usage

Memory UsageLow
CPU UsageLow

How to Set Up and Use LeetCode

mcp-server-leetcode is an MCP server that gives AI assistants direct access to LeetCode's problem set, user profiles, submission history, and contest data through a clean set of tools. It uses the LeetCode public GraphQL API to let Claude search problems by difficulty or tag, fetch daily challenges, retrieve problem details with examples and constraints, and look up a user's contest rankings and accepted submissions. Competitive programmers and interview preppers use it to have Claude explain problems, generate solutions, review their submission history, and track progress โ€” all from within their AI client.

Prerequisites

  • Node.js 18 or later (or npm for global install)
  • An MCP client such as Claude Desktop or Claude Code
  • No API keys required โ€” the server uses the public LeetCode GraphQL API
  • Optional: a LeetCode account username if you want to access submission history or contest rankings
1

Install the package globally

Install the LeetCode MCP server globally via npm so it is available as a command on your PATH.

npm install -g @jinzcdev/leetcode-mcp-server
2

Run the server to verify it starts

Start the server directly to confirm it launches correctly before adding it to your MCP client.

npx -y @jinzcdev/leetcode-mcp-server
3

Configure Claude Desktop

Add the server to your claude_desktop_config.json. No environment variables are required.

{
  "mcpServers": {
    "leetcode": {
      "command": "npx",
      "args": ["-y", "@jinzcdev/leetcode-mcp-server"]
    }
  }
}
4

Install via Smithery (alternative)

You can also install and register the server in one step using the Smithery CLI.

npx -y @smithery/cli install @doggybee/mcp-server-leetcode --client claude
5

Verify tools are available

Ask your AI client to fetch today's LeetCode daily challenge as a quick smoke test to confirm the server is connected and working.

LeetCode Examples

Client configuration

Claude Desktop config for the LeetCode MCP server โ€” no environment variables needed.

{
  "mcpServers": {
    "leetcode": {
      "command": "npx",
      "args": ["-y", "@jinzcdev/leetcode-mcp-server"]
    }
  }
}

Prompts to try

Sample prompts for problem search, daily challenges, user stats, and contest data.

- "Fetch today's LeetCode daily challenge and explain the problem"
- "Search for medium difficulty dynamic programming problems and suggest one for me to practice"
- "Show me the LeetCode profile and contest ranking for user 'leetcode'"
- "Retrieve problem #1 Two Sum with full examples and constraints, then write a Python solution"
- "Find all hard-difficulty graph problems tagged 'shortest path'"

Troubleshooting LeetCode

Server returns empty results when searching problems

LeetCode's GraphQL API may rate-limit unauthenticated requests. Try again after a short wait. If the issue persists, the API schema may have changed โ€” check the GitHub repo for updates.

User submission history returns empty or not found

Submission history requires a valid LeetCode username. Make sure you are providing the exact username (case-sensitive) as it appears on the LeetCode profile page.

npx command takes a long time to start the server

Install the package globally with npm install -g @jinzcdev/leetcode-mcp-server so subsequent runs skip the download step and start immediately.

Frequently Asked Questions about LeetCode

What is LeetCode?

LeetCode is a Model Context Protocol (MCP) server that ๐Ÿ“‡ โ˜๏ธ - an mcp server that enables ai models to search, retrieve, and solve leetcode problems. supports metadata filtering, user profiles, submissions, and contest data access. It connects AI assistants to external tools and data sources through a standardized interface.

How do I install LeetCode?

Install via npm with the command: npx -y @jinzcdev/leetcode-mcp-server. Then add the server configuration to your AI client's JSON config file (e.g., claude_desktop_config.json or .cursor/mcp.json).

Which AI clients work with LeetCode?

LeetCode works with all major MCP-compatible AI clients including Claude Desktop, Claude Code, Cursor, VS Code (GitHub Copilot), Windsurf, and Cline.

Is LeetCode free to use?

Yes, LeetCode is open source and available under the MIT License license. You can use it freely in both personal and commercial projects.

Browse More Developer Tools MCP Servers

Explore all developer tools servers available in the MCPgee directory. Each server includes setup guides for Claude, Cursor, and VS Code.

Quick Config Preview

{ "mcpServers": { "leetcode": { "command": "npx", "args": ["-y", "@jinzcdev/leetcode-mcp-server"] } } }

Add this to your claude_desktop_config.json or .cursor/mcp.json

Read the full setup guide โ†’

Ready to use LeetCode?

Browse our complete directory of 33,000+ MCP servers, read setup guides for your editor, and start building with the Model Context Protocol.

33,000+ ServersFree & Open SourceStep-by-Step Guides