LeetCode
Access LeetCode problems, user information, and contest data.
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
Related Servers
Scout Monitoring MCP
sponsorPut performance and error data directly in the hands of your AI assistant.
Alpha Vantage MCP Server
sponsorAccess financial market data: realtime & historical stock, ETF, options, forex, crypto, commodities, fundamentals, technical indicators, & more
Icons8 MCP server
Get access to MCP server SVG and MCP server PNG icons in your vibe-coding projects
CocoaPods Package README
Retrieve README files and package information from CocoaPods.
Tatara MCP Server
An MCP server for interacting with the Tatara blockchain ecosystem. Requires configuration for the Tatara RPC endpoint and a wallet private key.
stdout-mcp-server
Captures and manages stdout logs from multiple processes via a named pipe system for real-time debugging and analysis.
EOL MCP Server
Check software end-of-life (EOL) dates and support status using the endoflife.date API to provide accurate lifecycle and security information.
OpenAPI Invoker
Invokes any OpenAPI specification through a Model Context Protocol (MCP) server.
Web3 Playground & Sandbox - Learn, Develop, Test MCP Servers + Toolkit SDK
Free Solidity compiler & Web3 IDE with interactive tutorials. Learn blockchain development, deploy smart contracts to 8+ chains (Ethereum, Polygon, Base, Arbitrum, Solana). Templates for tokens, NFTs, DeFi, DAOs. Monaco Editor, AI assistance, WCAG accessible. Remix alternative. Gas optimization, MetaMask integration, open source. Beginner-friendly. MCP toolkit.
Authn8
Access your team's 2FA codes from AI agents without sharing secrets. List accounts, generate TOTP codes, and maintain full audit trails
MCP Expert Server
An MCP server for query generation and documentation assistance using Claude AI.
Lerian MCP Server
Provides educational content, model information, and read-only API interactions for Lerian developers.