Skip to main content
Glama

mcp-server-leetcode

MCP Server LeetCode

A Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data.

Features

  • 🚀 Fast access to LeetCode API
  • 🔍 Search problems, retrieve daily challenges, and check user profiles
  • 🏆 Query contest data and rankings
  • 🧩 Full support for MCP tools and resources
  • 📦 Provides both CLI and programmable API

Installation

Global Installation

npm install -g @mcpfun/mcp-server-leetcode

Once installed, you can run it directly from the command line:

mcp-server-leetcode

Local Installation

npm install @mcpfun/mcp-server-leetcode

Usage

Integration with Claude for Desktop

Add the following to your Claude for Desktop claude_desktop_config.json file:

{ "mcpServers": { "leetcode": { "command": "mcp-server-leetcode" } } }

For local development:

{ "mcpServers": { "leetcode": { "command": "node", "args": ["/path/to/dist/index.js"] } } }

Use as a Library

import { LeetCodeService } from '@mcpfun/mcp-server-leetcode'; // Initialize the service const leetcodeService = new LeetCodeService(); // Get daily challenge const dailyChallenge = await leetcodeService.getDailyChallenge(); // Search problems const problems = await leetcodeService.searchProblems({ difficulty: 'MEDIUM', tags: 'array+dynamic-programming' });

Available Tools

Tool NameDescriptionParameters
get-daily-challengeGet the daily challengeNone
get-problemGet details for a specific problemtitleSlug (string)
search-problemsSearch for problems based on criteriatags (optional), difficulty (optional), limit (default 20), skip (default 0)
Tool NameDescriptionParameters
get-user-profileGet user informationusername (string)
get-user-submissionsGet user submission historyusername (string), limit (optional, default 20)
get-user-contest-rankingGet user contest rankingsusername (string)
Tool NameDescriptionParameters
get-contest-detailsGet contest detailscontestSlug (string)

Available Resources

Problem Resources

  • leetcode://daily-challenge: Daily challenge
  • leetcode://problem/{titleSlug}: Problem details
  • leetcode://problems{?tags,difficulty,limit,skip}: Problem list

User Resources

  • leetcode://user/{username}/profile: User profile
  • leetcode://user/{username}/submissions{?limit}: User submissions
  • leetcode://user/{username}/contest-ranking: User contest ranking

Local Development

Clone the repository and install dependencies:

git clone https://github.com/doggybee/mcp-server-leetcode.git cd mcp-server-leetcode npm install

Run in development mode:

npm run dev

Build the project:

npm run build

License

MIT

Acknowledgements

Install Server
A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

remote-capable server

The server can be hosted and run remotely because it primarily relies on remote services or has no dependency on the local environment.

A Model Context Protocol (MCP) server for LeetCode that enables AI assistants to access LeetCode problems, user information, and contest data.

  1. Features
    1. Installation
      1. Global Installation
      2. Local Installation
    2. Usage
      1. Integration with Claude for Desktop
      2. Use as a Library
    3. Available Tools
      1. Problem-related Tools
      2. User-related Tools
      3. Contest-related Tools
    4. Available Resources
      1. Problem Resources
      2. User Resources
    5. Local Development
      1. License
        1. Related Projects
          1. Acknowledgements

            Related MCP Servers

            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol (MCP) server that allows AI assistants like Claude to interact with Go's Language Server Protocol (LSP) and benefit from advanced Go code analysis features.
              Last updated -
              35
              Go
              Apache 2.0
            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol server that provides integration with LeetCode APIs, enabling automated interaction with programming problems, contests, solutions, and user data across both leetcode.com and leetcode.cn platforms.
              Last updated -
              13
              129
              39
              TypeScript
              MIT License
            • -
              security
              A
              license
              -
              quality
              A Model Context Protocol (MCP) server that implements AI-First Development framework principles, allowing LLMs to interact with context-first documentation tools and workflows for preserving knowledge and intent alongside code.
              Last updated -
              332
              Python
              AGPL 3.0
            • A
              security
              F
              license
              A
              quality
              An all-in-one Model Context Protocol (MCP) server that connects your coding AI to numerous databases, data warehouses, data pipelines, and cloud services, streamlining development workflow through seamless integrations.
              Last updated -
              2
              Python
              • Apple
              • Linux

            View all related MCP servers

            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/doggybee/mcp-server-leetcode'

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