mcp-server-leetcode
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.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-server-leetcode get today's daily challenge"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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
Related MCP server: LeetCode MCP Server
Installation
Installing via Smithery
To install mcp-server-leetcode for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @doggybee/mcp-server-leetcode --client claudeGlobal Installation
npm install -g @mcpfun/mcp-server-leetcodeOnce installed, you can run it directly from the command line:
mcp-server-leetcodeLocal Installation
npm install @mcpfun/mcp-server-leetcodeUsage
Integration with Claude for Desktop
Add the following to your Claude for Desktop claude_desktop_config.json file:
{
"mcpServers": {
"leetcode": {
"command": "mcp-server-leetcode"
}
}
}For local development:
{
"mcpServers": {
"leetcode": {
"command": "node",
"args": ["/path/to/dist/index.js"]
}
}
}Use as a Library
import { LeetCodeService } from '@mcpfun/mcp-server-leetcode';
// Initialize the service
const leetcodeService = new LeetCodeService();
// Get daily challenge
const dailyChallenge = await leetcodeService.getDailyChallenge();
// Search problems
const problems = await leetcodeService.searchProblems({
difficulty: 'MEDIUM',
tags: 'array+dynamic-programming'
});Available Tools
Problem-related Tools
Tool Name | Description | Parameters |
| Get the daily challenge | None |
| Get details for a specific problem |
|
| Search for problems based on criteria |
|
User-related Tools
Tool Name | Description | Parameters |
| Get user information |
|
| Get user submission history |
|
| Get user contest rankings |
|
Contest-related Tools
Tool Name | Description | Parameters |
| Get contest details |
|
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:
git clone https://github.com/doggybee/mcp-server-leetcode.git
cd mcp-server-leetcode
npm installRun in development mode:
npm run devBuild the project:
npm run buildLicense
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
Available Tools
7 toolsget-contest-detailsD
Inputs: contestSlug (required).
get-daily-challengeD
Inputs: no named parameters.
get-problemD
Inputs: titleSlug (required).
get-user-contest-rankingD
Inputs: username (required).
get-user-profileD
Inputs: username (required).
get-user-submissionsD
Inputs: username (required), limit.
search-problemsD
Inputs: tags, difficulty, limit, skip.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 7 tools
Each tool has a clearly distinct purpose targeting different LeetCode resources: contests, daily challenges, problems, user rankings, profiles, submissions, and problem search. There is no overlap in functionality, making tool selection straightforward for an agent.
All tool names follow a consistent verb_noun pattern using kebab-case (e.g., get-contest-details, search-problems). The naming is uniform throughout with no deviations in style or convention.
With 7 tools, the server is well-scoped for a LeetCode integration, covering key areas like problem access, user data, and contests. Each tool serves a specific, necessary function without bloat.
The tool set provides comprehensive read-only coverage for LeetCode data, including problems, user profiles, contests, and submissions. A minor gap exists in write operations (e.g., submitting solutions or managing account settings), but core retrieval needs are fully met.
Maintenance
Related MCP Connectors
A comprehensive Model Context Protocol (MCP) server that enables AI assistants to interact with yo…
MCP server for LeadDelta — manage LinkedIn connections and CRM data via AI assistants.
A Model Context Protocol server for Wix AI tools
MCP server that lets your AI assistant build and deploy apps, hosting each one at a live URL.
Related MCP Servers
- AlicenseAqualityAmaintenanceA 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.9940 npm158MIT
- FlicenseAqualityDmaintenanceAn MCP server that provides tools to interact with the LeetCode API, enabling problem fetching, code template generation, and solution execution/submission.71-
- FlicenseAqualityCmaintenanceAn MCP server that provides structured, AI-powered guidance for LeetCode problems, including approach analysis, hints, complexity breakdowns, and optimization directions without spoiling solutions.61-
- FlicenseNot gradedqualityDmaintenanceA tutorial and working MCP server that connects to your LeetCode profile, enabling AI assistants to check solved problems and recommend new ones by topic and difficulty.1-