Leetcode-MCP

ashwinnmit/Leetcode-MCP

3.2

If you are the rightful owner of Leetcode-MCP and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

A custom Model Context Protocol (MCP) server designed to integrate with LeetCode using a third-party API proxy, enabling tracking and storage of personal LeetCode progress.

Tools
4
Resources
0
Prompts
0

📘 LeetCode MCP Server

A custom Model Context Protocol (MCP) server that integrates with LeetCode using a third-party API proxy.
Built to track and store my personal LeetCode progress — including solved snapshots, daily questions, calendar history, and more.


🚀 Features

✅ Fetch Profile Details

Returns stats such as ranking, XP, contest rating, badges, and more.

✅ Daily Question Fetcher

Retrieves the daily LeetCode question for convenience inside any MCP-compatible client.

✅ Solved Snapshot Tracker (SQLite)

Automatically:

  • Fetches total solved data
  • Takes a snapshot
  • Stores it with a timestamp
  • Maintains a history of all snapshots

This allows LLMs or dashboards to generate graphs, compute deltas, or analyze trends.

✅ Progress History + Calendar

A combined tool returns:

  • Entire solving history stored by my MCP server
  • LeetCode heatmap-style calendar from the API

🏗️ Architecture

FastMCP (Python)

  • Tools (MCP API)
  • get_profile_details
  • get_daily_questions
  • get_questions_solved_details <-- snapshot storage
  • get_history
  • SQLite (aiosqlite)
  • Docker-based LeetCode API proxy (open-source project)

The LeetCode API does not provide official public endpoints, so I use an open-source proxy (https://github.com/alfaarghya/alfa-leetcode-api) This MCP server talks to that proxy running locally in Docker.