The mcp-server-leetcode is a Model Context Protocol (MCP) server that provides access to LeetCode data, enabling AI assistants to interact with LeetCode problems, user profiles, and contest information.
With this server you can:
- Access LeetCode problems: Retrieve daily challenges, search for problems by tags/difficulty, and get problem details by slug
- Fetch user data: Access user profiles, submission history, and contest rankings
- Contest information: Retrieve details about specific contests by slug
- Integration: Supports integration with AI assistants like Claude for Desktop
- Programmable API: Can be used as a library for custom applications
Provides access to LeetCode problems, daily challenges, user profiles, submission history, contest data, and rankings through the LeetCode API.
MCP Server LeetCode
A Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data.
Features
- 🚀 Fast access to LeetCode API
- 🔍 Search problems, retrieve daily challenges, and check user profiles
- 🏆 Query contest data and rankings
- 🧩 Full support for MCP tools and resources
- 📦 Provides both CLI and programmable API
Installation
Global Installation
Once installed, you can run it directly from the command line:
Local Installation
Usage
Integration with Claude for Desktop
Add the following to your Claude for Desktop claude_desktop_config.json
file:
For local development:
Use as a Library
Available Tools
Problem-related Tools
Tool Name | Description | Parameters |
---|---|---|
get-daily-challenge | Get the daily challenge | None |
get-problem | Get details for a specific problem | titleSlug (string) |
search-problems | Search for problems based on criteria | tags (optional), difficulty (optional), limit (default 20), skip (default 0) |
User-related Tools
Tool Name | Description | Parameters |
---|---|---|
get-user-profile | Get user information | username (string) |
get-user-submissions | Get user submission history | username (string), limit (optional, default 20) |
get-user-contest-ranking | Get user contest rankings | username (string) |
Contest-related Tools
Tool Name | Description | Parameters |
---|---|---|
get-contest-details | Get contest details | contestSlug (string) |
Available Resources
Problem Resources
leetcode://daily-challenge
: Daily challengeleetcode://problem/{titleSlug}
: Problem detailsleetcode://problems{?tags,difficulty,limit,skip}
: Problem list
User Resources
leetcode://user/{username}/profile
: User profileleetcode://user/{username}/submissions{?limit}
: User submissionsleetcode://user/{username}/contest-ranking
: User contest ranking
Local Development
Clone the repository and install dependencies:
Run in development mode:
Build the project:
License
MIT
Related Projects
- Model Context Protocol - MCP specifications and documentation
- Claude for Desktop - AI assistant with MCP support
Acknowledgements
- This project was inspired by alfa-leetcode-api
You must be authenticated.
remote-capable server
The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.
Tools
A Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data.
- Features
- Installation
- Usage
- Available Tools
- Available Resources
- Local Development
- License
- Related Projects
- Acknowledgements
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.Last updated -11,9641,697TypeScriptMIT License
- -securityFlicense-qualityImplements the Model Context Protocol (MCP) to provide AI models with a standardized interface for connecting to external data sources and tools like file systems, databases, or APIs.Last updated -90Python
- AsecurityAlicenseAqualityA Model Context Protocol (MCP) server that enables AI assistants to control and interact with Android devices, allowing for device management, app debugging, system analysis, and UI automation through natural language commands.Last updated -29143PythonApache 2.0
- AsecurityAlicenseAqualityA Model Context Protocol server that provides integration with LeetCode APIs, enabling automated interaction with programming problems, contests, solutions, and user data across both leetcode.com and leetcode.cn platforms.Last updated -1318622TypeScriptMIT License