Skip to main content
Glama

MCP サーバー LeetCode

npmバージョン GitHubライセンス バージョン

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

特徴

  • 🚀 LeetCode APIへの高速アクセス

  • 🔍 問題を検索し、毎日の課題を取得し、ユーザープロフィールを確認します

  • 🏆 クエリコンテストデータとランキング

  • 🧩 MCPツールとリソースの完全サポート

  • 📦 CLIとプログラム可能なAPIの両方を提供

Related MCP server: LeetCode MCP Server

インストール

グローバルインストール

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

ライセンス

マサチューセッツ工科大学

関連プロジェクト

謝辞

Latest Blog Posts

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