leetcode-helper
Provides tools for analyzing LeetCode problems, including approach analysis, hints, complexity breakdowns, and generating discussion posts.
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., "@leetcode-helper Get approach for two sum problem"
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.
leetcode-helper
An MCP server that gives structured, AI-powered DSA guidance inside Claude Desktop or Claude Code — approach analysis, hints, complexity breakdowns, and more, without spoiling the solution.
Tools at a Glance
Tool | Input | What it returns |
| problem | Pattern, steps, TC/SC |
| problem + where stuck | Nudge, no spoilers |
| problem + code | TC/SC breakdown per block |
| problem + accepted code | Discussion post ready to copy |
| problem | 3–5 problems for the same pattern |
| problem + working code | Optimization direction, not solution |
Related MCP server: LeetCode MCP Server
Setup
Prerequisites: Node.js 18+, an ANTHROPIC_API_KEY
git clone https://github.com/Navoren/leetcode-helper.git
cd leetcode-helper
npm install
npm run buildConnect to Claude Code
Add to .claude/settings.json (project or global):
{
"mcpServers": {
"leetcode-helper": {
"command": "node",
"args": ["d:/leetcode-helper/dist/index.js"],
"env": {
"ANTHROPIC_API_KEY": "your-key-here"
}
}
}
}Connect to Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"leetcode-helper": {
"command": "node",
"args": ["/absolute/path/to/leetcode-helper/dist/index.js"],
"env": {
"ANTHROPIC_API_KEY": "your-key-here"
}
}
}
}Example Usage
Getting an approach:
"Use get_approach on: Given an array of integers, return indices of two numbers that add up to target."
Getting a hint when stuck:
"Use get_hint — problem: two sum, stuck on: my nested loop works but is too slow"
Generating a discussion post:
"Use post_solution with my accepted Python solution for two sum"
Upsolving:
"Use upsolve — here's my O(n²) solution, help me think toward better"
Project Structure
leetcode-mcp/
├── src/
│ ├── index.ts # Entry point
│ ├── server.ts # McpServer setup
│ ├── lib/
│ │ └── claude.ts # Anthropic API client
│ └── tools/
│ ├── registry.ts # Registers all tools (one line per tool)
│ ├── get_approach.ts
│ ├── get_hint.ts
│ ├── get_complexity.ts
│ ├── post_solution.ts
│ ├── similar_questions.ts
│ └── upsolve.ts
├── dist/ # Compiled output
├── functional_requirement.md
├── technical_document.md
└── CLAUDE.mdAdding a New Tool
Create
src/tools/your_tool.ts— exportname,description,schema(Zod),handlerAdd one import + one entry in
src/tools/registry.tsnpm run build
No changes to server.ts, index.ts, or claude.ts.
Tech Stack
Layer | Choice |
Runtime | Node.js (ESM) |
Language | TypeScript 5 |
MCP SDK |
|
Schema validation | Zod |
LLM | Anthropic |
Transport | stdio |
Available Tools
6 toolsget_approachB
Takes a LeetCode problem statement and returns the recommended DSA approach, pattern name, and time/space complexity.
Inputs: problem (required).
get_complexityA
Takes a LeetCode problem and the user's solution code, returns time and space complexity analysis with explanation.
Inputs: problem (required), solution_code (required).
get_hintA
Takes a LeetCode problem and where the user is stuck, returns a targeted nudge without revealing the solution.
Inputs: problem (required), stuck_on (required).
post_solutionA
Takes a user's accepted solution and generates a structured LeetCode discussion post with approach, complexity, estimated beat %, and why it's better than brute force.
Inputs: problem (required), solution_code (required), language.
similar_questionsA
Given a LeetCode problem, returns 3-5 similar problems that reinforce the same DSA pattern.
Inputs: problem (required).
upsolveA
Given a working but suboptimal solution, nudges the user toward a better approach without revealing it. Focuses on optimization, not correctness.
Inputs: problem (required), solution_code (required).
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 6 tools
Most tools target clearly separate stages: approach selection, hinting, complexity analysis, discussion posting, and similar-problem lookup. The only real risk is get_hint versus upsolve, since both return non-revealing nudges, but their descriptions distinguish correctness guidance from optimization guidance.
Three tools follow a clean get_noun pattern (get_approach, get_hint, get_complexity) and post_solution is consistent with that style. However, similar_questions has no verb and upsolve is a bare verb, so the set mixes conventions even though each name remains readable.
Six tools is a tight, well-scoped surface for a LeetCode study helper. Each tool maps to a distinct user need and none feels redundant or like padding.
The surface covers the full solve-and-learn loop: approach, hints, complexity review, optimization nudges, similar practice, and publishing a write-up. Minor gaps exist, such as no way to fetch/parse a problem from a URL or track progress, but agents can work around these by supplying the problem text.
Related MCP Connectors
An MCP server that integrates with Discord to provide AI-powered features.
Driflyte MCP server which lets AI assistants query topic-specific knowledge from web and GitHub.
MCP server for AI agent profiles and smart notes. 60+ coding prompt packs with expert personas.
Official MCP server for Agentwork — delegate tasks to AI agents with human-in-the-loop
Related MCP Servers
- AlicenseCqualityDmaintenanceA Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data.755 npm44MIT
- FlicenseAqualityDmaintenanceAn MCP server that provides tools to interact with the LeetCode API, enabling problem fetching, code template generation, and solution execution/submission.71-
- AlicenseAqualityCmaintenanceAn MCP server for agent-guided DSA practice that generates LeetCode-style problems and provides tutoring with escalating hints, concept explanations, and progress tracking.77 npmMIT
- 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-