mcp-server-leetcode

by doggybee
Verified

Integrations

  • Provides access to LeetCode problems, daily challenges, user profiles, submission history, contest data, and rankings through the LeetCode API.

MCP サーバー LeetCode

AI アシスタントが LeetCode の問題、ユーザー情報、コンテスト データにアクセスできるようにする、LeetCode 用のモデル コンテキスト プロトコル (MCP) サーバー。

特徴

  • 🚀 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

AI アシスタントが LeetCode の問題、ユーザー情報、コンテスト データにアクセスできるようにする、LeetCode 用のモデル コンテキスト プロトコル (MCP) サーバー。

  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
            ID: hj5pz4f2go