mcpField
M
MCP Server LeetCode

MCP Server LeetCode

ローカル
github.com/doggybee開発ツール4482 週間前に更新

MCP Server LeetCode について

MCP Server LeetCode は LeetCode 向けの MCP サーバーで、GraphQL を通じて問題、ユーザー情報、コンテストデータにアクセスできます。AI アシスタントから LeetCode の情報を照会したい開発者に向いており、コマンドラインとライブラリの両方で利用できます。

主な機能

  1. 01問題の詳細とデイリーチャレンジの取得
  2. 02タグと難易度による問題検索
  3. 03ユーザープロフィールと提出履歴の照会
  4. 04コンテストの詳細とユーザーのランキング取得
  5. 05コマンドラインとプログラムから使える API

活用シーン

  1. 01指定したタグや難易度に合う問題の検索
  2. 02ユーザーの提出履歴やコンテストランキングの確認
  3. 03スクリプトやアプリケーションからの LeetCode データ呼び出し

MCP 対応

本プロジェクトは MCP サーバーとして動作し、get-problem や search-problems などのツール、leetcode://daily-challenge などのリソースを MCP クライアントに公開します。

設定

ローカルサーバーの設定はどのクライアントでも共通です。コピーしてクライアントの MCP 設定ファイルに貼り付けてください。

mcp.json · 共通設定
{
"mcpServers": {
"leetcode": {
"command": "npx",
"args": [
"-y",
"@mcpfun/mcp-server-leetcode"
]
}
}
}
起動コマンドnpx -y @mcpfun/mcp-server-leetcode

ローカルサーバーにはマシン上の実行環境(Node.js 18 以上など)が必要です。設定ファイルの場所はクライアントごとに異なります。

パッケージ
npm@mcpfun/mcp-server-leetcode

ツール

7

掲載時のツール一覧 · 3 週間前に更新

このツールにパラメーターはありません。

詳細

MCP Server LeetCode

npm version GitHub license Version smithery badge

AI アシスタントが LeetCode の問題、ユーザー情報、コンテストデータにアクセスできるようにする、LeetCode 向けの Model Context Protocol(MCP)サーバーです。

特長

  • 🚀 LeetCode API にすばやくアクセス
  • 🔍 問題の検索、今日のチャレンジの取得、ユーザープロフィールの確認
  • 🏆 コンテストデータとランキングの照会
  • 🧩 MCP のツールとリソースを完全サポート
  • 📦 CLI とプログラムから利用できる API の両方を提供

インストール

Smithery 経由でのインストール

Smithery 経由で mcp-server-leetcode を Claude Desktop に自動インストールするには:

npx -y @smithery/cli install @doggybee/mcp-server-leetcode --client claude
グローバルインストール
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

ライセンス

MIT

関連プロジェクト

謝辞

コメント

MCP は初めてですか?

プロトコルの概要から最初のサーバーの導入まで、よくある疑問にまとめて答えます。

AI アプリケーションが外部のツールやデータソースに統一的な方法で接続するためのオープンなプロトコルです。クライアントはモデルとの対話を担い、MCP サーバーはツール・リソース・プロンプトテンプレートを提供します。標準メッセージでやり取りするため、1 つのサーバーを複数のクライアントで再利用できます。