Skip to main content
Glama

github-repo-mcp

GitHub リポジトリ MCP

目次

✨ 主な機能

  • 💻 Cursor、Windsurf、Claude Desktop、およびstdioプロトコルをサポートするその他のMCPクライアントと互換性があります
  • 🔎 GitHubの公開リポジトリの内容を閲覧する
  • 📂 リポジトリのディレクトリとサブディレクトリを移動する
  • 📝 コードとテキストファイルの内容を表示する
  • 📦 パッケージマネージャーによる簡単なインストール

はじめる

前提条件

サーバーをインストールするには、システムに次のものが必要です。

  • Node.js 18歳以上
  • npmまたはyarn

ステップ1. インストール

Smithery、NPX、または IDE の mcp.json の設定を使用して、GitHub Repo MCP をインストールして実行できます。

macOS
npx github-repo-mcp
ウィンドウズNPX
cmd /c npx -y github-repo-mcp
.cursor/mcp.json 経由の Windows NPX
{ "mcpServers": { "github-repo-mcp": { "command": "wsl", "args": [ "bash", "-c", "cmd /c npx -y github-repo-mcp" ], "enabled": true } } }
Windows NPX は .cursor/mcp.json 経由で (パスが設定されていない場合)
# Find the full path to npx first which npx
{ "mcpServers": { "github-repo-mcp": { "command": "wsl", "args": [ "bash", "-c", "'/home/[username]/.nvm/versions/node/v20.18.0/bin/npx github-repo-mcp'" ], "enabled": true } } }
Smithery経由でインストール

Smithery経由で Claude Desktop 用の GitHub Repo MCP を自動的にインストールするには:

npx -y @smithery/cli install @Ryan0204/github-repo-mcp --client claude

反映されない場合は、数秒待つか、更新ボタンを数回クリックしてください。それでも反映されない場合は、正しいコマンドを入力したかどうかを確認してください。

ステップ2. 構成

GitHub Repo MCP サーバーは、GitHub API にアクセスするときに、より高いレート制限のために GitHub トークンを使用できます。

環境変数
変数必須デフォルト説明
GITHUB_TOKENいいえなしより高いレート制限のための GitHub 個人アクセス トークン
GitHub トークンの設定(オプション)

サーバーは認証なしで動作しますが、GitHub API には認証されていないリクエストに対するレート制限が大幅に低く設定されています。レート制限を上げるには、以下の手順を実行してください。

  1. https://github.com/settings/tokensで個人アクセストークンを作成します。
  2. mcp.json でトークンを環境変数として設定します。
{ "mcpServers": { "github-repo-mcp": { "command": "...", "args": [ ... ], "env": { "GITHUB_TOKEN": "Your_Github_Token" } "enabled": true, } } }

機能の概要

リポジトリ閲覧ツール

サーバーは、GitHub リポジトリと対話するための 3 つの主要なツールを提供します。

1. getRepoAllDirectories

GitHub リポジトリのルートにあるすべてのファイルとディレクトリを一覧表示します。

2. getRepoDirectories

GitHub リポジトリ内の特定のディレクトリの内容を一覧表示します。

  • パラメータ:
    • repoUrl : GitHubリポジトリのURL
    • path : 取得するディレクトリパス(例:"src")
3. getRepoFile

GitHub リポジトリから特定のファイルの内容を取得して表示します。

  • パラメータ:
    • repoUrl : GitHubリポジトリのURL
    • path : 取得するファイルパス(例: "src/index.js")

使用例

AI アシスタントでこれらのツールを使用する方法の例をいくつか示します。

  1. リポジトリ ルートの参照: AI アシスタントに「 https://github.com/Ryan0204/github-repo-mcpにあるリポジトリの内容を見せて」と依頼します。
  2. 特定のディレクトリの探索: 「 https://github.com/Ryan0204/github-repo-mcpの src ディレクトリにはどのようなファイルがありますか?」と質問します。
  3. ファイルの表示: 「 https://github.com/Ryan0204/github-repo-mcpの README.md ファイルを表示してください」と質問する

制限事項

  • レート制限:認証がない場合、GitHub API には厳しいレート制限(1 時間あたり 60 リクエスト)があります。
  • プライベートリポジトリ: 適切な権限を持つトークンが提供されない限り、パブリックリポジトリにのみアクセスできます。
  • バイナリファイル: サーバーは一般的なバイナリファイル拡張子を検出し、その内容を表示しません。
  • 大きなファイル: GitHub API では取得できるファイルのサイズに制限があります

トラブルシューティング

以下に一般的な問題とその解決策を示します。

  • レート制限を超えました: 設定セクションの説明に従ってGitHubトークンを設定してください
  • コマンドが見つかりません: パッケージがグローバルにインストールされていることを確認してください
  • 接続エラー: インターネット接続とGitHub APIのステータスを確認してください

問題が発生した場合は、出力でエラー メッセージを確認するか、GitHub リポジトリで問題を作成してください。


お楽しみください!☺️

Install Server
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.

GitHub Repo MCP は、AI アシスタントが GitHub リポジトリを参照し、ディレクトリを探索し、ファイルの内容を表示できるようにするオープンソースの MCP サーバーです。

  1. 目次
    1. ✨ 主な機能
      1. はじめる
        1. 前提条件
        2. ステップ1. インストール
        3. ステップ2. 構成
      2. 機能の概要
        1. リポジトリ閲覧ツール
        2. 使用例
        3. 制限事項
      3. トラブルシューティング

        Related MCP Servers

        • A
          security
          F
          license
          A
          quality
          MCP Server for the GitHub API, providing features for file operations, repository management, and advanced search, with automatic branch creation and comprehensive error handling.
          Last updated -
          18
          0
          4
          TypeScript
          • Linux
          • Apple
        • A
          security
          A
          license
          A
          quality
          A MCP server that provides access to GitHub trending repositories and developers data through a simple API interface.
          Last updated -
          2
          13
          Python
          MIT License
          • Apple
        • A
          security
          A
          license
          A
          quality
          An MCP server that enables analyzing and querying GitHub repositories through the GitHub Chat API, allowing users to index repositories and ask questions about their code, architecture and tech stack.
          Last updated -
          2
          55
          Python
          MIT License
          • Linux
          • Apple
        • -
          security
          A
          license
          -
          quality
          An MCP server that wraps around the GitHub CLI tool, allowing AI assistants to interact with GitHub repositories through commands for pull requests, issues, and repository operations.
          Last updated -
          5
          TypeScript
          MIT License
          • Linux
          • Apple

        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/Ryan0204/github-repo-mcp'

        If you have feedback or need assistance with the MCP directory API, please join our Discord server