
mcp-server-leetcode
A Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data.
Tools
get-daily-challenge
get-problem
search-problems
get-user-profile
get-user-submissions
get-contest-details
get-user-contest-ranking
README
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
Installing via Smithery
To install mcp-server-leetcode for Claude Desktop automatically via Smithery:
npx -y @smithery/cli install @doggybee/mcp-server-leetcode --client claude
Global Installation
npm install -g @mcpfun/mcp-server-leetcode
Once installed, you can run it directly from the command line:
mcp-server-leetcode
Local Installation
npm install @mcpfun/mcp-server-leetcode
Usage
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-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:
git clone https://github.com/doggybee/mcp-server-leetcode.git
cd mcp-server-leetcode
npm install
Run in development mode:
npm run dev
Build the project:
npm run build
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
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.

VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.

E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A 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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.