mcpField
G
GitHub Enterprise MCP Server

GitHub Enterprise MCP Server

ローカル
github.com/piyushgIITianバージョン管理433 週間前に更新

GitHub Enterprise MCP Server について

GitHub Enterprise MCP Serverは、ClineなどのMCPクライアントにGitHub API操作を提供し、リポジトリ、ファイル、Issueを扱う開発者向けです。コード、リポジトリ、ユーザー、Issue、PRの検索や、複数ファイルの一括プッシュに対応します。

主な機能

  1. 01リポジトリ内ファイルの作成・更新
  2. 02複数ファイルの一括コミット
  3. 03リポジトリ、ブランチ、PRの作成
  4. 04Issueとコメントの管理
  5. 05コード、リポジトリ、Issue、ユーザーの検索

活用シーン

  1. 01リポジトリ内のファイル作成・更新
  2. 02複数ファイル変更の一括コミット
  3. 03コードやGitHub Issueの検索
  4. 04PR作成とリポジトリIssueの処理

MCP 対応

このMCPサーバーは、リポジトリやファイルの操作、検索、IssueとPRの管理を行うツールを通じて、GitHub API機能をMCPクライアントに公開します。

設定

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

インストール方法は未掲載です

このサーバーのパッケージやリモートエンドポイントはまだ取得できていません。プロジェクトの README の手順に従ってください。

リポジトリ

ツール

ツール一覧はまだ取得されていません

ローカルサーバーのツールはマシン上で起動して初めて取得できます。メンテナーはまだツール一覧を提供していません。

詳細

MseeP.ai セキュリティ評価バッジ

GitHub Enterprise MCP サーバー

GitHub API 用 MCP サーバーです。ファイル操作、リポジトリ管理、検索機能などを利用できます。

機能

  • ブランチの自動作成:ファイルの作成・更新や変更のプッシュ時に、ブランチが存在しない場合は自動的に作成されます
  • 包括的なエラー処理:よくある問題について明確なエラーメッセージが表示されます
  • Git 履歴の保持:強制プッシュを行わず、適切な Git 履歴を維持して操作します
  • バッチ操作:単一ファイルと複数ファイルの両方の操作に対応しています
  • 高度な検索:コード、Issue/PR、ユーザーの検索に対応しています

Cline のインストールガイド

このガイドでは、GitHub API の機能を Cline から直接利用できるように、GitHub Enterprise MCP サーバーを Cline にインストールして設定する方法を説明します。

前提条件
  1. システムに Node.js がインストールされていること
  2. 適切な権限を持つ GitHub Personal Access Token があること
  3. システムに Cline がインストールされていること
インストール手順
1. リポジトリをクローンする
git clone https://github.com/yourusername/github-enterprise-mcp.git
cd github-enterprise-mcp
2. 依存関係をインストールしてビルドする
npm install
npm run build

これにより、コンパイル済みの JavaScript ファイルを含む dist ディレクトリが作成されます。

3. GitHub Personal Access Token を作成する
  1. GitHub Personal Access Tokens に移動します(GitHub の Settings > Developer settings 内)。
  2. 「Generate new token」をクリックします。
  3. このトークンでアクセスするリポジトリを選択します(Public、All、または Select)。
  4. repo スコープ(「Full control of private repositories」)を持つトークンを作成します
    • 公開リポジトリのみを使用する場合は、代わりに public_repo スコープのみを選択してください
  5. 生成されたトークンをコピーします
4. Cline MCP の設定
Cline VS Code 拡張機能の場合
  1. VS Code を開きます

  2. Cline MCP の設定ファイルを次の場所で確認します:

    • Windows:%APPDATA%\Code\User\globalStorage\saoudrizwan.claude-dev\settings\cline_mcp_settings.json
    • macOS:~/Library/Application Support/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
    • Linux:~/.config/Code/User/globalStorage/saoudrizwan.claude-dev/settings/cline_mcp_settings.json
  3. mcpServers オブジェクトに GitHub Enterprise MCP サーバーの設定を追加します:

{
  "mcpServers": {
    "github-enterprise": {
      "command": "node",
      "args": [
        "/absolute/path/to/github-enterprise-mcp/dist/index.js"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your-personal-access-token",
        "GITHUB_API_URL": "https://api.github.com" // For GitHub.com
        // For GitHub Enterprise, use your instance URL, e.g., "https://github.yourdomain.com/api/v3"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}

/absolute/path/to/github-enterprise-mcp/dist/index.js を、ビルドした index.js ファイルの絶対パスに置き換えます。

Claude Desktop アプリの場合
  1. Claude Desktop の設定ファイルを次の場所で確認します:

    • Windows:%APPDATA%\Claude\claude_desktop_config.json
    • macOS:~/Library/Application Support/Claude/claude_desktop_config.json
    • Linux:~/.config/Claude/claude_desktop_config.json
  2. mcpServers オブジェクトに GitHub Enterprise MCP サーバーの設定を追加します:

{
  "mcpServers": {
    "github-enterprise": {
      "command": "node",
      "args": [
        "/absolute/path/to/github-enterprise-mcp/dist/index.js"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your-personal-access-token",
        "GITHUB_API_URL": "https://api.github.com" // For GitHub.com
        // For GitHub Enterprise, use your instance URL, e.g., "https://github.yourdomain.com/api/v3"
      },
      "disabled": false,
      "autoApprove": []
    }
  }
}
5. Cline を再起動する

MCP の設定後、Cline(VS Code または Claude Desktop)を再起動して変更を適用します。

動作確認

GitHub Enterprise MCP サーバーが正しくインストールされ、設定されていることを確認するには、Cline に GitHub ツールのいずれかを使うよう依頼します:

Can you search for repositories with the keyword "react" using the GitHub Enterprise MCP server?

Cline は search_repositories ツールを使って、キーワード「react」を含むリポジトリを検索できます。

Cline による対話型インストール

対話型のインストールを行うには、以下のテキストをコピーして Cline に貼り付けてください。インストール手順が案内されます:

I want you to help me install the GitHub Enterprise MCP server. Here's what I need you to do:

1. First, explain what the GitHub Enterprise MCP server is and what capabilities it will give you.

2. Guide me through the installation process:
   - Help me clone the repository (if I haven't already)
   - Help me install dependencies and build the project
   - Guide me through creating a GitHub Personal Access Token if I don't have one
   - Help me configure the MCP settings in either VS Code or Claude Desktop
   - Verify the installation is working

3. Show me some examples of how I can use the GitHub Enterprise MCP server once it's installed.

Please start by explaining what the GitHub Enterprise MCP server is and what it will allow you to do for me.
使用例

インストール後、次のような GitHub 操作を Cline に直接依頼できます:

  • 「my-project という新しいリポジトリを作成して」
  • 「機械学習に関連するリポジトリを検索して」
  • 「自分の feature ブランチから main にプルリクエストを作成して」
  • 「リポジトリ X の README.md ファイルの内容を取得して」
  • 「自分のリポジトリのオープンな Issue を一覧表示して」
トラブルシューティング

GitHub Enterprise MCP サーバーで問題が発生した場合は、次の点を確認してください。

  1. MCP の設定で、index.js ファイルへのパスが正しいことを確認します
  2. GitHub Personal Access Token に必要な権限があることを確認します
  3. GitHub インスタンスに対応する GitHub API URL が正しいことを確認します
  4. エラーメッセージがないか、ログを確認します
追加の設定オプション
GitHub API バージョン

GITHUB_API_VERSION 環境変数を追加すると、GitHub API のバージョンを指定できます。

"env": {
  "GITHUB_PERSONAL_ACCESS_TOKEN": "your-personal-access-token",
  "GITHUB_API_URL": "https://api.github.com",
  "GITHUB_API_VERSION": "2022-11-28"
}
Enterprise 認証

異なる認証方式を使用する GitHub Enterprise インスタンスでは、追加の設定が必要になる場合があります。詳しくは、Octokit のドキュメントを参照してください。

ツール

  1. create_or_update_file

    • リポジトリ内の単一ファイルを作成または更新します
    • 入力:
      • owner (string):リポジトリの所有者(ユーザー名または組織)
      • repo (string):リポジトリ名
      • path (string):ファイルを作成または更新するパス
      • content (string):ファイルの内容
      • message (string):コミットメッセージ
      • branch (string):ファイルを作成または更新するブランチ
      • sha (optional string):置き換えるファイルの SHA(更新の場合)
    • 戻り値:ファイルの内容とコミットの詳細
  2. push_files

    • 複数のファイルを単一のコミットでプッシュします
    • 入力:
      • owner (string):リポジトリの所有者
      • repo (string):リポジトリ名
      • branch (string):プッシュ先のブランチ
      • files (array):プッシュするファイル。各ファイルには path と content が含まれます
      • message (string):コミットメッセージ
    • 戻り値:更新されたブランチ参照
  3. search_repositories

    • GitHub リポジトリを検索します
    • 入力:
      • query (string):検索クエリ
      • page (optional number):ページネーションのページ番号
      • perPage (optional number):1 ページあたりの結果数(最大 100)
    • 戻り値:リポジトリの検索結果
  4. create_repository

    • 新しい GitHub リポジトリを作成します
    • 入力:
      • name (string):リポジトリ名
      • description (optional string):リポジトリの説明
      • private (optional boolean):リポジトリをプライベートにするかどうか
      • autoInit (optional boolean):README を含めて初期化するかどうか
    • 戻り値:作成したリポジトリの詳細
  5. get_file_contents

    • ファイルまたはディレクトリの内容を取得します
    • 入力:
      • owner (string):リポジトリの所有者
      • repo (string):リポジトリ名
      • path (string):ファイルまたはディレクトリへのパス
      • branch (optional string):内容を取得するブランチ
    • 戻り値:ファイルまたはディレクトリの内容
  6. create_issue

    • 新しい issue を作成します
    • 入力:
      • owner (string):リポジトリの所有者
      • repo (string):リポジトリ名
      • title (string):issue のタイトル
      • body (optional string):issue の説明
      • assignees (optional string[]):割り当てるユーザー名
      • labels (optional string[]):追加するラベル
      • milestone (optional number):マイルストーン番号
    • 戻り値:作成した issue の詳細
  7. create_pull_request

    • 新しいプルリクエストを作成します
    • 入力:
      • owner (string):リポジトリの所有者
      • repo (string):リポジトリ名
      • title (string):PR のタイトル
      • body (optional string):PR の説明
      • head (string):変更を含むブランチ
      • base (string):マージ先のブランチ
      • draft (optional boolean):ドラフト PR として作成するかどうか
      • maintainer_can_modify (optional boolean):メンテナーによる編集を許可するかどうか
    • 戻り値:作成したプルリクエストの詳細
  8. fork_repository

    • リポジトリをフォークします
    • 入力:
      • owner (string):リポジトリの所有者
      • repo (string):リポジトリ名
      • organization (optional string):フォーク先の組織
    • 戻り値:フォークしたリポジトリの詳細
  9. create_branch

    • 新しいブランチを作成します
    • 入力:
      • owner (string):リポジトリの所有者
      • repo (string):リポジトリ名
      • branch (string):新しいブランチ名
      • from_branch (optional string):元のブランチ(デフォルトはリポジトリのデフォルトブランチ)
    • 戻り値:作成されたブランチの参照
  10. list_issues

    • リポジトリのイシューを一覧表示して絞り込みます
    • 入力:
      • owner (string):リポジトリの所有者
      • repo (string):リポジトリ名
      • state (optional string):状態で絞り込みます('open'、'closed'、'all')
      • labels (optional string[]):ラベルで絞り込みます
      • sort (optional string):並べ替えの基準('created'、'updated'、'comments')
      • direction (optional string):並べ替えの順序('asc'、'desc')
      • since (optional string):日付で絞り込みます(ISO 8601 タイムスタンプ)
      • page (optional number):ページ番号
      • per_page (optional number):1 ページあたりの結果数
    • 戻り値:イシューの詳細の配列
  11. update_issue

    • 既存のイシューを更新します
    • 入力:
      • owner (string):リポジトリの所有者
      • repo (string):リポジトリ名
      • issue_number (number):更新するイシュー番号
      • title (optional string):新しいタイトル
      • body (optional string):新しい説明
      • state (optional string):新しい状態('open' または 'closed')
      • labels (optional string[]):新しいラベル
      • assignees (optional string[]):新しい担当者
      • milestone (optional number):新しいマイルストーン番号
    • 戻り値:更新されたイシューの詳細
  12. add_issue_comment

    • イシューにコメントを追加します
    • 入力:
      • owner (string):リポジトリの所有者
      • repo (string):リポジトリ名
      • issue_number (number):コメントするイシュー番号
      • body (string):コメント本文
    • 戻り値:作成されたコメントの詳細
  13. search_code

    • GitHub リポジトリ全体からコードを検索します
    • 入力:
      • q (string):GitHub のコード検索構文を使用した検索クエリ
      • sort (optional string):並べ替えフィールド('indexed' のみ)
      • order (optional string):並べ替え順序('asc' または 'desc')
      • per_page (optional number):1 ページあたりの結果数(最大 100)
      • page (optional number):ページ番号
    • 戻り値:リポジトリのコンテキストを含むコード検索結果
  14. search_issues

    • イシューとプルリクエストを検索します
    • 入力:
      • q (string):GitHub のイシュー検索構文を使用した検索クエリ
      • sort (optional string):並べ替えフィールド(comments、reactions、created など)
      • order (optional string):並べ替え順序('asc' または 'desc')
      • per_page (optional number):1 ページあたりの結果数(最大 100)
      • page (optional number):ページ番号
    • 戻り値:イシューとプルリクエストの検索結果
  15. search_users

    • GitHub ユーザーを検索します
    • 入力:
      • q (string):GitHub のユーザー検索構文を使用した検索クエリ
      • sort (optional string):並べ替えフィールド(followers、repositories、joined)
      • order (optional string):並べ替え順序('asc' または 'desc')
      • per_page (optional number):1 ページあたりの結果数(最大 100)
      • page (optional number):ページ番号
    • 戻り値:ユーザーの検索結果
  16. list_commits

  • リポジトリ内のブランチのコミットを取得します
  • 入力:
    • owner (string):リポジトリの所有者
    • repo (string):リポジトリ名
    • page (optional string):ページ番号
    • per_page (optional string):1 ページあたりのレコード数
    • sha (optional string):ブランチ名
  • 戻り値:コミットの一覧
  1. get_issue
  • リポジトリ内のイシューの内容を取得します
  • 入力:
    • owner (string):リポジトリの所有者
    • repo (string):リポジトリ名
    • issue_number (number):取得するイシュー番号
  • 戻り値:Github Issue オブジェクトと詳細
  1. get_pull_request
  • 特定のプルリクエストの詳細を取得します
  • 入力:
    • owner (string):リポジトリのオーナー
    • repo (string):リポジトリ名
    • pull_number (number):プルリクエスト番号
  • 戻り値:差分やレビュー状況を含むプルリクエストの詳細
  1. list_pull_requests
  • リポジトリのプルリクエストを一覧表示し、絞り込みます
  • 入力:
    • owner (string):リポジトリのオーナー
    • repo (string):リポジトリ名
    • state (optional string):状態で絞り込みます('open'、'closed'、'all')
    • head (optional string):head のユーザー/組織とブランチで絞り込みます
    • base (optional string):base ブランチで絞り込みます
    • sort (optional string):並べ替え基準('created'、'updated'、'popularity'、'long-running')
    • direction (optional string):並べ替え順('asc'、'desc')
    • per_page (optional number):1ページあたりの結果数(最大100)
    • page (optional number):ページ番号
  • 戻り値:プルリクエストの詳細の配列
  1. create_pull_request_review
  • プルリクエストにレビューを作成します
  • 入力:
    • owner (string):リポジトリのオーナー
    • repo (string):リポジトリ名
    • pull_number (number):プルリクエスト番号
    • body (string):レビューコメントのテキスト
    • event (string):レビューアクション('APPROVE'、'REQUEST_CHANGES'、'COMMENT')
    • commit_id (optional string):レビュー対象のコミットの SHA
    • comments (optional array):行ごとのコメント。各コメントには以下を指定します:
      • path (string):ファイルパス
      • position (number):差分内の行位置
      • body (string):コメントのテキスト
  • 戻り値:作成されたレビューの詳細
  1. merge_pull_request
  • プルリクエストをマージします
  • 入力:
    • owner (string):リポジトリのオーナー
    • repo (string):リポジトリ名
    • pull_number (number):プルリクエスト番号
    • commit_title (optional string):マージコミットのタイトル
    • commit_message (optional string):マージコミットの追加説明
    • merge_method (optional string):マージ方法('merge'、'squash'、'rebase')
  • 戻り値:マージ結果の詳細
  1. get_pull_request_files
  • プルリクエストで変更されたファイルの一覧を取得します
  • 入力:
    • owner (string):リポジトリのオーナー
    • repo (string):リポジトリ名
    • pull_number (number):プルリクエスト番号
  • 戻り値:パッチとステータスの詳細を含む、変更されたファイルの配列
  1. get_pull_request_status
  • プルリクエストのすべてのステータスチェックを統合した結果を取得します
  • 入力:
    • owner (string):リポジトリのオーナー
    • repo (string):リポジトリ名
    • pull_number (number):プルリクエスト番号
  • 戻り値:統合されたステータスチェック結果と個々のチェックの詳細
  1. update_pull_request_branch
  • base ブランチの最新の変更をプルリクエストのブランチに反映します(GitHub の「Update branch」ボタンと同等です)
  • 入力:
    • owner (string):リポジトリのオーナー
    • repo (string):リポジトリ名
    • pull_number (number):プルリクエスト番号
    • expected_head_sha (optional string):プルリクエストの HEAD ref に期待される SHA
  • 戻り値:ブランチが更新された際の成功メッセージ
  1. get_pull_request_comments
  • プルリクエストのレビューコメントを取得します
  • 入力:
    • owner (string):リポジトリのオーナー
    • repo (string):リポジトリ名
    • pull_number (number):プルリクエスト番号
  • 戻り値:コメントのテキスト、投稿者、差分内の位置などの詳細を含む、プルリクエストのレビューコメントの配列
  1. get_pull_request_reviews
  • プルリクエストのレビューを取得します
  • 入力:
    • owner (string):リポジトリのオーナー
    • repo (string):リポジトリ名
    • pull_number (number):プルリクエスト番号
  • 戻り値:レビュー状態(APPROVED、CHANGES_REQUESTED など)、レビュアー、レビュー本文などの詳細を含む、プルリクエストのレビューの配列

検索クエリ構文

コード検索
  • language:javascript:プログラミング言語で検索します
  • repo:owner/name:特定のリポジトリを検索します
  • path:app/src:特定のパスを検索します
  • extension:js:ファイル拡張子で検索します
  • 例:q: "import express" language:typescript path:src/
Issue の検索
  • is:issue または is:pr:種類で絞り込みます
  • is:open または is:closed:状態で絞り込みます
  • label:bug:ラベルで検索します
  • author:username:作成者で検索します
  • 例:q: "memory leak" is:issue is:open label:bug
ユーザーの検索
  • type:user または type:org:アカウントの種類で絞り込みます
  • followers:>1000:フォロワー数で絞り込みます
  • location:London:場所で検索します
  • 例:q: "fullstack developer" location:London followers:>100

詳しい検索構文については、GitHub の検索に関するドキュメントをご覧ください。

セットアップ

Personal Access Token

適切な権限を持つGitHub Personal Access Tokenを作成してください:

  • GitHub の設定 > Developer settings にあるPersonal access tokensに移動します
  • このトークンがアクセスできるリポジトリ(Public、All、または Select)を選択します
  • repo スコープ(「Full control of private repositories」)を持つトークンを作成します
    • または、パブリックリポジトリのみで使用する場合は、public_repo スコープのみを選択します
  • 生成されたトークンをコピーします
Claude Desktop での使用方法

Claude Desktop で使用するには、以下を claude_desktop_config.json に追加します:

{
  "mcpServers": {
    "github": {
      "command": "node",
      "args": [
        "/path/to/github-enterprise-mcp/dist/index.js"
      ],
      "env": {
        "GITHUB_PERSONAL_ACCESS_TOKEN": "<YOUR_TOKEN>"
      }
    }
  }
}

ビルド

# Install dependencies
npm install

# Build the project
npm run build

# Start the server
npm start

ライセンス

この MCP サーバーは MIT License の下でライセンスされています。MIT License の利用規約に従うことを条件に、ソフトウェアを自由に使用、変更、配布できます。詳しくは、プロジェクトリポジトリ内の LICENSE ファイルをご覧ください。

コメント

MCP は初めてですか?

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

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