Skip to main content
Glama

mcp-server-leetcode

MCP 服务器 LeetCode

LeetCode 的模型上下文协议 (MCP) 服务器,使 AI 助手能够访问 LeetCode 问题、用户信息和竞赛数据。

特征

  • 🚀 快速访问 LeetCode API
  • 🔍 搜索问题、检索每日挑战并查看用户资料
  • 🏆 查询比赛数据和排名
  • 🧩 全面支持 MCP 工具和资源
  • 📦提供 CLI 和可编程 API

安装

全局安装

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

安装后,您可以直接从命令行运行它:

mcp-server-leetcode

本地安装

npm install @mcpfun/mcp-server-leetcode

用法

与 Claude for Desktop 集成

将以下内容添加到您的 Claude for Desktop claude_desktop_config.json文件中:

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

对于本地开发:

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

用作图书馆

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' });

可用工具

问题相关工具

工具名称描述参数
get-daily-challenge接受每日挑战没有任何
get-problem获取特定问题的详细信息titleSlug (字符串)
search-problems根据标准搜索问题tags (可选)、 difficulty (可选)、 limit (默认 20)、 skip (默认 0)

用户相关工具

工具名称描述参数
get-user-profile获取用户信息username (字符串)
get-user-submissions获取用户提交历史记录username (字符串), limit (可选,默认 20)
get-user-contest-ranking获取用户竞赛排名username (字符串)

比赛相关工具

工具名称描述参数
get-contest-details获取比赛详情contestSlug (字符串)

可用资源

问题资源

  • leetcode://daily-challenge :每日挑战
  • leetcode://problem/{titleSlug} :问题详情
  • leetcode://problems{?tags,difficulty,limit,skip} :问题列表

用户资源

  • leetcode://user/{username}/profile :用户个人资料
  • leetcode://user/{username}/submissions{?limit} :用户提交
  • leetcode://user/{username}/contest-ranking :用户竞赛排名

本地开发

克隆存储库并安装依赖项:

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

以开发模式运行:

npm run dev

构建项目:

npm run build

执照

麻省理工学院

相关项目

致谢

You must be authenticated.

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.

LeetCode 的模型上下文协议 (MCP) 服务器,使 AI 助手能够访问 LeetCode 问题、用户信息和竞赛数据。

  1. 特征
    1. 安装
      1. 全局安装
      2. 本地安装
    2. 用法
      1. 与 Claude for Desktop 集成
      2. 用作图书馆
    3. 可用工具
      1. 问题相关工具
      2. 用户相关工具
      3. 比赛相关工具
    4. 可用资源
      1. 问题资源
      2. 用户资源
    5. 本地开发
      1. 执照
        1. 相关项目
          1. 致谢

            Related MCP Servers

            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
              Last updated -
              1
              1,930
              1,674
              TypeScript
              MIT License
              • Apple
            • -
              security
              F
              license
              -
              quality
              Implements the Model Context Protocol (MCP) to provide AI models with a standardized interface for connecting to external data sources and tools like file systems, databases, or APIs.
              Last updated -
              90
              Python
              • Apple
              • Linux
            • A
              security
              A
              license
              A
              quality
              A Model Context Protocol (MCP) server that enables AI assistants to control and interact with Android devices, allowing for device management, app debugging, system analysis, and UI automation through natural language commands.
              Last updated -
              29
              143
              Python
              Apache 2.0
              • Linux
              • Apple
            • 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
              186
              22
              TypeScript
              MIT License

            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