Price Per TokenPrice Per Token
LeetCode MCP Server

LeetCode MCP Server

by doggybee

GitHub 38 14 uses
0

About

LeetCode MCP Server connects AI assistants to LeetCode's extensive library of coding problems, user profiles, and competitive programming data. It provides fast, programmatic access to algorithmic challenges and contest statistics to support coding interview preparation and technical assessment workflows. Key capabilities include: - Search problems with filters for difficulty level (Easy, Medium, Hard) and topic tags like arrays, dynamic programming, and trees - Retrieve daily coding challenges for consistent practice routines - Access detailed user profiles including submission history and solved problem counts - Query contest rankings and competition performance data - Flexible integration via both command-line interface and programmable JavaScript/TypeScript API

README

MCP Server LeetCode

[](https://www.npmjs.com/package/@mcpfun/mcp-server-leetcode) [](https://github.com/doggybee/mcp-server-leetcode/blob/main/LICENSE) [](https://github.com/doggybee/mcp-server-leetcode/releases) [](https://smithery.ai/server/@doggybee/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

    Installing via Smithery

    To install mcp-server-leetcode for Claude Desktop automatically via Smithery:

    npx -y @smithery/cli install @doggybee/mcp-server-leetcode --client claude
    

    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

    Problem-related Tools

    | Tool Name | Description | Parameters | |--------|------|------| | get-daily-challenge | Get the daily challenge | None | | get-problem | Get details for a specific problem | titleSlug (string) | | search-problems | Search for problems based on criteria | tags (optional), difficulty (optional), limit (default 20), skip (default 0) |

    User-related Tools

    | Tool Name | Description | Parameters | |--------|------|------| | get-user-profile | Get user information | username (string) | | get-user-submissions | Get user submission history | username (string), limit (optional, default 20) | | get-user-contest-ranking | Get user contest rankings | username (string) |

    Contest-related Tools

    | Tool Name | Description | Parameters | |--------|------|------| | get-contest-details | Get contest details | contestSlug (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

    Related Projects

  • Model Context Protocol - MCP specifications and documentation
  • Claude for Desktop - AI assistant with MCP support
  • Acknowledgements

  • This project was inspired by alfa-leetcode-api
  • Related MCP Servers

    AI Research Assistant

    AI Research Assistant

    hamid-vakilzadeh

    AI Research Assistant provides comprehensive access to millions of academic papers through the Semantic Scholar and arXiv databases. This MCP server enables AI coding assistants to perform intelligent literature searches, citation network analysis, and paper content extraction without requiring an API key. Key features include: - Advanced paper search with multi-filter support by year ranges, citation thresholds, field of study, and publication type - Title matching with confidence scoring for finding specific papers - Batch operations supporting up to 500 papers per request - Citation analysis and network exploration for understanding research relationships - Full-text PDF extraction from arXiv and Wiley open-access content (Wiley TDM token required for institutional access) - Rate limits of 100 requests per 5 minutes with options to request higher limits through Semantic Scholar

    Web & Search
    12 8
    Linkup

    Linkup

    LinkupPlatform

    Linkup is a real-time web search and content extraction service that enables AI assistants to search the web and retrieve information from trusted sources. It provides source-backed answers with citations, making it ideal for fact-checking, news gathering, and research tasks. Key features of Linkup: - Real-time web search using natural language queries to find current information, news, and data - Page fetching to extract and read content from any webpage URL - Search depth modes: Standard for direct-answer queries and Deep for complex research across multiple sources - Source-backed results with citations and context from relevant, trustworthy websites - JavaScript rendering support for accessing dynamic content on JavaScript-heavy pages

    Web & Search
    2 24
    Math-MCP

    Math-MCP

    EthanHenrickson

    Math-MCP is a computation server that enables Large Language Models (LLMs) to perform accurate numerical calculations through the Model Context Protocol. It provides precise mathematical operations via a simple API to overcome LLM limitations in arithmetic and statistical reasoning. Key features of Math-MCP: - Basic arithmetic operations: addition, subtraction, multiplication, division, modulo, and bulk summation - Statistical analysis functions: mean, median, mode, minimum, and maximum calculations - Rounding utilities: floor, ceiling, and nearest integer rounding - Trigonometric functions: sine, cosine, tangent, and their inverses with degrees and radians conversion support

    Developer Tools
    22 81