Skip to main content
Glama

LeetCode MCP Server

A Model Context Protocol (MCP) server built with Python that enables Claude Desktop to access LeetCode through natural language. The server exposes LeetCode functionality as MCP tools, allowing Claude to retrieve problem information, user statistics, and other resources directly from a conversation.

Features

  • Search LeetCode problems

  • Retrieve problem details

  • Fetch user profile information

  • View user statistics

  • Native integration with Claude Desktop using MCP

Related MCP server: MCP Claude Hacker News

Tech Stack

  • Python 3.11+

  • Model Context Protocol (MCP)

  • Claude Desktop

  • LeetCode API

Project Structure

.
├── server.py
├── tools/
├── utils/
├── requirements.txt
├── pyproject.toml
└── README.md

Adjust the structure above to match your repository.

Installation

Clone the repository.

git clone https://github.com/<username>/leetcode-mcp-server.git
cd leetcode-mcp-server

Create a virtual environment.

python -m venv .venv

Activate it.

Windows

.venv\Scripts\activate

Linux/macOS

source .venv/bin/activate

Install dependencies.

pip install -r requirements.txt

Running the Server

python server.py

Claude Desktop Configuration

Add the server to your Claude Desktop MCP configuration.

{
  "mcpServers": {
    "leetcode": {
      "command": "python",
      "args": [
        "/absolute/path/to/server.py"
      ]
    }
  }
}

Restart Claude Desktop after updating the configuration.

Example Prompts

Search for Medium Binary Search problems.
Show me the problem statement for Two Sum.
Display my LeetCode profile.
How many Hard problems have I solved?

Available Tools

Tool

Description

Search Problems

Search problems using filters or keywords

Problem Details

Retrieve complete problem information

User Profile

Fetch LeetCode profile information

User Statistics

Retrieve solved problem statistics

Architecture

Claude Desktop
      │
      │ MCP
      ▼
LeetCode MCP Server
      │
      ▼
 LeetCode API

Future Improvements

  • Daily Challenge support

  • Contest information

  • Company-specific problems

  • Topic-based recommendations

  • Submission history

  • AI-assisted problem recommendations

License

MIT License

F
license - not found
-
quality - not tested
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/spryzen-devs/Leetcode-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server