DM

doggybee/mcp-server-leetcode

开发工具

本页由 AI 翻译,技术细节请以原文为准。 查看原文

44 stars 16 forks 质量 63 趋势 0MIT

doggybee/mcp-server-leetcode 是从 https://github.com/doggybee/mcp-server-leetcode. 导入的 MCP 服务器候选

概览

doggybee/mcp-server-leetcode 是从 https://github.com/doggybee/mcp-server-leetcode. 导入的 MCP 服务器候选

概述(AI 翻译)

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

特色

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

安装

通过Smithery安装

要通过 Smithery 自动安装 Claude Desktop 的 mcp-server-leetcode:

全球安装

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

本地安装

用途

与桌面版Claude的集成

将以下内容添加到您的Claude桌面版claude_desktop_config.json文件中:

关于本地发展:

作为图书馆的使用

可用工具

与问题相关的工具

工具名称 说明 参数
get-daily-challenge 获取每日挑战 无
get-problem 获取特定问题的详细信息 titleSlug(字符串)

本页由 AI 翻译,技术细节请以原文为准。

README

以下为原文 README 节选,完整内容请查看原文。

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

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)
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)
在 GitHub 查看完整 README

安装

npx -y @smithery/cli install @doggybee/mcp-server-leetcode --client claude
新手?先看 mcpskill.org 教程 →

配置

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