# interactive-leetcode-mcp

Wires LeetCode into your agent: fetch problems, step through hints, run sample tests locally, submit code. Handy when you grind interview prep inside the chat.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 12
- Author: SPerekrestova
- License: MIT · policy=link-only · description only; the file stays with the author
- Source: https://github.com/SPerekrestova/interactive-leetcode-mcp
- Updated: 2026-09-15
- HTML: https://affpapa.org/en/nevibecode/mcp/interactive-leetcode-mcp

## What it does

The server gives the agent access to LeetCode problems and your account. You sign in once: the agent opens the browser, you log in and hand over two cookie values, `csrftoken` and `LEETCODE_SESSION`, and the server verifies them before saving. From there it can pull a problem by slug, search by difficulty or tag, and fetch the daily challenge.

Practice happens through sessions. `start_problem` opens or resumes a problem, `request_hint` walks you up the hint ladder one step at a time, and community editorials stay locked until you reach the last level. `run_local_tests` executes your code against the sample cases in a local subprocess; installed runtimes are required, and `runner_doctor` lists which ones it finds.

Submitting goes through `submit_solution`, which returns the verdict along with runtime and memory figures. The project is under active development, so expect rough edges. You need Node.js v20 or newer, a LeetCode account, and a browser for the login step.

## Requirements
- Needs: Node.js (commands run via npx)

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add interactive-leetcode-mcp -- npx -y @sperekrestova/interactive-leetcode-mcp
```

### Codex

**Platform CLI**
```bash
codex mcp add interactive-leetcode-mcp -- npx -y @sperekrestova/interactive-leetcode-mcp
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "interactive-leetcode-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "@sperekrestova/interactive-leetcode-mcp"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "interactive-leetcode-mcp": {
            "type": "stdio",
            "command": "npx",
            "args": [
                "-y",
                "@sperekrestova/interactive-leetcode-mcp"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add interactive-leetcode-mcp npx -y @sperekrestova/interactive-leetcode-mcp
```

## When to use it
- work a LeetCode problem with hints that unlock in stages
- try a solution on sample cases before submitting
- find problems by difficulty and topic
- submit code and read the verdict with runtime stats
- open an editorial after giving the problem a real try

## Example prompts
- Authorize with LeetCode and walk me through it
- Start the two-sum problem in Python
- Give me a hint on the current problem

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
