Connects Claude directly to LeetCode's platform with full authentication, problem fetching, and solution submission. You can search and retrieve problems by slug or daily challenge, submit code in Java, Python, C++, JavaScript, TypeScript and get back runtime stats, memory usage, and failed test cases. Also exposes user profile data, submission history, and contest rankings. The learning mode prompts are a nice touch: Claude walks you through browser cookie extraction for auth, then provides progressive hints before showing solutions. Reach for this when you want to practice coding problems conversationally without leaving your editor, or if you're building an AI tutoring flow around competitive programming.
Current project is under active development and may not work perfectly
npm install -g @sperekrestova/interactive-leetcode-mcp
git clone https://github.com/SPerekrestova/interactive-leetcode-mcp.git
cd interactive-leetcode-mcp
npm install && npm run build
npm link
You can execute this command in CLI
claude mcp add --transport stdio leetcode -- npx -y @sperekrestova/interactive-leetcode-mcp@latest
Or add to your MCP configuration file (~/.config/claude-code/mcp.json) or (~/Library/Application Support/Claude/claude_desktop_config.json):
{
"mcpServers": {
"leetcode": {
"command": "npx",
"args": ["-y", "interactive-leetcode-mcp"]
}
}
}
{
"mcpServers": {
"leetcode": {
"command": "node",
"args": ["/path/to/this/project/interactive-leetcode-mcp/build/index.js"]
}
}
}
You: "Authorize with LeetCode"
Claude: [Opens LeetCode in your browser and guides you through the process]
Claude: "Please log in to your account. Once logged in, I'll walk you through
getting two cookie values we need. First, press F12 to open DevTools..."
You: [Follows Claude's step-by-step guidance]
You: "Here are my cookies: csrftoken is abc123... and LEETCODE_SESSION is xyz789..."
Claude: "✓ Perfect! Your credentials are validated and saved. Welcome back, johndoe!"
You: "I want to practice two-sum"
Claude: [Fetches problem and creates working file]
You: "Give me a hint"
Claude: [Provides contextual guidance based on your code]
You: "Submit my solution"
Claude: "🎉 Accepted! Runtime: 2ms (beats 95.3%)"
start_leetcode_auth
save_leetcode_credentials
csrftoken, session (cookie values you provide)check_auth_status
get_daily_challenge
get_problem
titleSlug (e.g., "two-sum")search_problems
submit_solution
problemSlug, code, languageget_user_profile
get_user_submissions
get_user_contest_ranking
The Interactive LeetCode MCP includes AI agent guidance through MCP Prompts to create a better learning experience.
Workspace Setup: When learning mode is active, Claude will:
{problem-slug}.{extension}Learning-Guided Mode: When active, Claude follows these guidelines:
Problem Workflow: Guides you through the complete cycle:
To activate learning mode, tell Claude you want to practice with guidance — for example, "Let's practice in learning mode" or "I want to learn two-sum with hints." Once active:
To test the MCP server as a black-box MCP client without live LeetCode traffic:
npm run dogfood:local
This builds the server, spawns build/index.js over stdio, connects with the
MCP SDK client, uses an isolated HOME, serves LeetCode responses from fixtures,
and drives a user-like flow through runner_doctor, start_problem,
request_hint, run_local_tests, and get_session_state.
See DOGFOOD_TESTING.md for the full workflow and a copy-paste prompt for local Claude/agent dogfood testing.
"Not authorized" or "Invalid credentials" error
"Credentials have expired"
Can't find DevTools or cookies
Copied wrong values
Browser doesn't open during authorization
"Unsupported language" error
Submission timeout
This repo also ships an agent skill that teaches Claude (and other AI agents) how to use the MCP server correctly — including session flow, prompt invocations, learning mode, and authentication.
Install the skill directly as a Claude Code plugin:
/plugin marketplace add SPerekrestova/interactive-leetcode-mcp
/plugin install interactive-leetcode-mcp@interactive-leetcode-mcp
Then start a practice session with:
/interactive-leetcode-mcp:interactive-leetcode-mcp
The skill is also published on ClawHub for use with OpenClaw-compatible agents.
Forked from Leetcode mcp)
MIT © SPerekrestova
com.exploit-intel/eip-mcp
dmontgomery40/pentest-mcp
pantheon-security/notebooklm-mcp-secure
cyanheads/pentest-mcp-server
io.github.akhilucky/ai-firewall-mcp