interactive-leetcode
An MCP server enabling guided DSA learning with AI on leetcode.com
claude mcp add --transport stdio sperekrestova-interactive-leetcode-mcp npx -y @sperekrestova/interactive-leetcode-mcp
How to use
Interactive LeetCode MCP provides an AI-assisted workflow to practice LeetCode problems through Claude-guided prompts. It supports authentication with LeetCode, problem retrieval and exploration, and code submission across multiple languages. Core tools exposed by the MCP server include: getting daily or specific problem details, submitting solutions and receiving real-time feedback, and a learning mode that offers progressively hint-based guidance before revealing full solutions. You can also fetch user profile and submission history to track progress. To use it, connect via the MCP client (Claude integration or your preferred MCP consumer) and run the available commands to authorize, select a problem, and submit your solution. The workflow is designed to simulate a guided problem-solving session with AI-assisted prompts to help you learn and improve your approach.
How to install
Prerequisites:
- Node.js v20.x or above
- npm (bundled with Node.js)
- A modern web browser for LeetCode interaction
Installation (recommended):
- Install the MCP server package globally:
npm install -g @sperekrestova/interactive-leetcode-mcp
- Verify installation:
interactive-leetcode-mcp --version
- (Optional) Build from source if you prefer cloning the repo:
git clone https://github.com/SPerekrestova/interactive-leetcode-mcp.git
cd interactive-leetcode-mcp
npm install && npm run build
npm link
- Run the MCP server locally (example):
npx -y @sperekrestova/interactive-leetcode-mcp
Prerequisites recap:
- Ensure Node.js is installed and accessible in your PATH
- Have a LeetCode account for authentication flow
- Ensure you have a suitable browser for the authentication steps when prompted
Additional notes
Tips and common considerations:
- Authentication: The flow relies on LeetCode cookie-based authentication. Follow Claude's prompts to authorize, then provide the required cookies (csrftoken and LEETCODE_SESSION) when prompted.
- Credentials expiry: LeetCode cookies may expire; re-authenticate via the MCP workflow when you encounter credentials expiry messages.
- Language support: Supported languages include java, python, python3, cpp, c++, javascript, js, typescript, ts. Ensure you choose a compatible language when submitting solutions.
- Troubleshooting: If the browser doesn’t open during authorization, you can manually navigate to https://leetcode.com/accounts/login/ and continue with the provided prompts. For issues with cookies, copy the VALUE of the cookie fields exactly and avoid extra spaces.
- Environment variables: The MCP config can be extended with environment variables if your deployment requires API keys or custom endpoints. Start with an empty env block and populate as needed.
- Usage with Claude: The MCP is designed to work with Claude prompts to guide the learning process. You can enable learning mode to receive hints before solutions and to work through problems step-by-step.
Related MCP Servers
mcp-graphql
Model Context Protocol server for GraphQL
mcp-google-map
A powerful Model Context Protocol (MCP) server providing comprehensive Google Maps API integration with LLM processing capabilities.
systemprompt-code-orchestrator
MCP server for orchestrating AI coding agents (Claude Code CLI & Gemini CLI). Features task management, process execution, Git integration, and dynamic resource discovery. Full TypeScript implementation with Docker support and Cloudflare Tunnel integration.
leetcode
An MCP server enabling automated access to LeetCode's problems, solutions, and public data with optional authentication for user-specific features, supporting leetcode.com & leetcode.cn sites.
pluggedin-app
The Crossroads for AI Data Exchanges. A unified, self-hostable web interface for discovering, configuring, and managing Model Context Protocol (MCP) servers—bringing together AI tools, workspaces, prompts, and logs from multiple MCP sources (Claude, Cursor, etc.) under one roof.
rohlik
MCP server that lets you shop groceries across the Rohlik Group platforms (Rohlik.cz, Knuspr.de, Gurkerl.at, Kifli.hu, Sezamo.ro)