An MCP server enabling automated access to LeetCode problems, solutions and user data (supports leetcode.com & leetcode.cn).
https://github.com/jinzcdev/leetcode-mcp-serverStop scraping LeetCode pages and wrestling with their undocumented APIs. This MCP server gives you clean, programmatic access to everything LeetCode offers—problems, solutions, user data, and more—through a single, well-documented interface.
You're building LeetCode-integrated tools, training platforms, or interview prep systems. You need reliable access to problem data, user statistics, and submission histories. LeetCode's frontend APIs are undocumented, inconsistent, and prone to breaking changes. Building your own scrapers means constant maintenance headaches.
This server eliminates all of that. It provides a stable, comprehensive interface to both leetcode.com and leetcode.cn, handling authentication, rate limiting, and API quirks for you.
Complete LeetCode Coverage
Dual Platform Support
Authentication When You Need It
Build Interview Prep Tools
// Get today's daily challenge
const daily = await mcp.call('get_daily_challenge');
// Search for specific problem types
const problems = await mcp.call('search_problems', {
tags: ['dynamic-programming', 'binary-tree'],
difficulty: 'MEDIUM',
limit: 50
});
// Analyze user's submission patterns
const report = await mcp.call('get_problem_submission_report', {
id: submissionId
});
Create Learning Analytics
// Track user progress across problem categories
const progress = await mcp.call('get_problem_progress', {
questionStatus: 'SOLVED',
difficulty: ['MEDIUM', 'HARD']
});
// Analyze recent performance
const submissions = await mcp.call('get_recent_ac_submissions', {
username: 'student123',
limit: 100
});
Build Content Systems
// Get problem with full editorial content
const problem = await mcp.call('get_problem', {
titleSlug: 'two-sum'
});
// Fetch community solutions
const solutions = await mcp.call('list_problem_solutions', {
questionSlug: 'two-sum',
orderBy: 'MOST_VOTES',
limit: 10
});
Install globally:
npm install -g @jinzcdev/leetcode-mcp-server
Run immediately for public data:
npx @jinzcdev/leetcode-mcp-server --site global
Add authentication for private data:
npx @jinzcdev/leetcode-mcp-server --site global --session YOUR_SESSION_COOKIE
Claude Desktop Integration Add to your settings.json:
{
"mcp": {
"servers": {
"leetcode": {
"type": "stdio",
"command": "npx",
"args": ["-y", "@jinzcdev/leetcode-mcp-server"],
"env": {
"LEETCODE_SITE": "global",
"LEETCODE_SESSION": "your_session_cookie"
}
}
}
}
}
VS Code Integration Works with any MCP-compatible client. Set up once, use everywhere.
Instead of maintaining fragile scrapers or reverse-engineering APIs, you get a maintained, documented interface that handles:
Your time stays focused on building features, not debugging API integration.
The server supports both quick experimentation and production deployment. Whether you're prototyping an interview prep tool or building a learning management system, you'll have reliable LeetCode integration running in minutes.
Check out the full documentation for complete tool references and advanced configuration options.