leetcode-helper
An MCP server that provides structured, AI-powered guidance for LeetCode problems, including approach analysis, hints, complexity breakdowns, and optimization directions without spoiling solutions.
README
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 |
|---|---|---|
get_approach |
problem | Pattern, steps, TC/SC |
get_hint |
problem + where stuck | Nudge, no spoilers |
get_complexity |
problem + code | TC/SC breakdown per block |
post_solution |
problem + accepted code | Discussion post ready to copy |
similar_questions |
problem | 3–5 problems for the same pattern |
upsolve |
problem + working code | Optimization direction, not solution |
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 build
Connect 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.md
Adding a New Tool
- Create
src/tools/your_tool.ts— exportname,description,schema(Zod),handler - Add one import + one entry in
src/tools/registry.ts npm 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 | @modelcontextprotocol/sdk |
| Schema validation | Zod |
| LLM | Anthropic claude-sonnet-4-6 |
| Transport | stdio |
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.