Skip to main content
Glama

GitHub Enterprise MCP Server

GitHub Enterprise MCP サーバー

画像

GitHub Enterprise APIとの統合のためのMCP(Model Context Protocol)サーバー。このサーバーは、CursorからGitHub Enterpriseのリポジトリ情報、問題、PRなどに簡単にアクセスするためのMCPインターフェースを提供します。

互換性

このプロジェクトは主に GitHub Enterprise Server 環境向けに設計されていますが、以下の環境でも動作します。

  • GitHub.com

  • GitHubエンタープライズクラウド

: 一部のエンタープライズ固有の機能 (ライセンス情報やエンタープライズ統計など) は、GitHub.com または GitHub Enterprise Cloud では動作しません。

主な特徴

  • GitHub Enterpriseインスタンスからリポジトリリストを取得する

  • 詳細なリポジトリ情報を取得する

  • リポジトリのブランチを一覧表示する

  • ファイルとディレクトリの内容を表示する

  • 問題とプルリクエストを管理する

  • リポジトリ管理(作成、更新、削除)

  • GitHub Actionsワークフロー管理

  • ユーザー管理(ユーザーの一覧表示、作成、更新、削除、一時停止/一時停止解除)

  • 企業統計にアクセスする

  • 強化されたエラー処理とユーザーフレンドリーな応答フォーマット

はじめる

前提条件

  • Node.js 18以上

  • GitHub Enterpriseインスタンスへのアクセス

  • 個人アクセストークン(PAT)

Dockerのインストールとセットアップ

オプション1: Dockerで実行する

  1. Docker イメージをビルドします。

    docker build -t github-enterprise-mcp .
  2. 環境変数を使用して Docker コンテナを実行します。

    docker run -p 3000:3000 \ -e GITHUB_TOKEN="your_github_token" \ -e GITHUB_ENTERPRISE_URL="https://github.your-company.com/api/v3" \ -e DEBUG=true \ github-enterprise-mcp

:Dockerfileはデフォルトで--transport httpで実行されるように設定されています。これを変更する必要がある場合は、コマンドをオーバーライドできます。

docker run -p 3000:3000 \ -e GITHUB_TOKEN="your_github_token" \ -e GITHUB_ENTERPRISE_URL="https://github.your-company.com/api/v3" \ -e DEBUG=true \ github-enterprise-mcp node dist/index.js --transport http --debug

オプション2: Docker Composeを使用する

  1. 必要な環境変数を含む.envファイルをプロジェクト ルートに作成します。

    GITHUB_ENTERPRISE_URL=https://github.your-company.com/api/v3 GITHUB_TOKEN=your_github_token DEBUG=true
  2. Docker Compose を使用してコンテナを起動します。

    docker-compose up -d
  3. ログを確認します:

    docker-compose logs -f
  4. コンテナを停止します。

    docker-compose down

インストールとセットアップ

ローカル開発(並行モードの使用)

自動再コンパイルとサーバーの再起動を伴うアクティブな開発には、この方法をお勧めします。

  1. リポジトリをクローンし、必要なパッケージをインストールします。

    git clone https://github.com/ddukbg/github-enterprise-mcp.git cd github-enterprise-mcp npm install
  2. 開発サーバーを実行します。

    export GITHUB_TOKEN="your_github_token" export GITHUB_ENTERPRISE_URL="https://github.your-company.com/api/v3" npm run dev

    これにより、次のようになります。

    • ファイルが変更されたときに TypeScript コードを自動的にコンパイルする

    • コンパイルされたファイルが更新されたらサーバーを再起動します

    • URLベースの接続ではサーバーをHTTPモードで実行する

  3. 下記の説明に従ってURLモードを使用してカーソルに接続します

生産のためのインストールとセットアップ

オプション 1: URL モードの使用 (ローカル開発に推奨)

この方法は最も安定しており、ローカル開発やテストに推奨されます。

  1. リポジトリをクローンし、必要なパッケージをインストールします。

    git clone https://github.com/ddukbg/github-enterprise-mcp.git cd github-enterprise-mcp npm install
  2. プロジェクトをビルドします。

    npm run build chmod +x dist/index.js
  3. サーバーを実行します。

    export GITHUB_TOKEN="your_github_token" export GITHUB_ENTERPRISE_URL="https://github.your-company.com/api/v3" node dist/index.js --transport http --debug
  4. URL モードを使用してカーソルに接続します。

    • カーソルの.cursor/mcp.jsonファイルに次のコードを追加します。

    { "mcpServers": { "github-enterprise": { "url": "http://localhost:3000/sse" } } }

オプション2: グローバルコマンドとしてインストールする (npm リンク)

この方法はローカル開発に役立ちます。

# After cloning the repository git clone https://github.com/ddukbg/github-enterprise-mcp.git cd github-enterprise-mcp # Install required packages npm install # Build npm run build chmod +x dist/index.js # Link globally npm link # Run as a global command export GITHUB_TOKEN="your_github_token" export GITHUB_ENTERPRISE_URL="https://github.your-company.com/api/v3" github-enterprise-mcp --transport=http --debug

オプション3: npx を使用する (パッケージが公開されている場合)

パッケージがパブリック npm レジストリに公開されている場合:

npx @ddukbg/github-enterprise-mcp --token=your_github_token --github-enterprise-url=https://github.your-company.com/api/v3

AIツールとの統合

クロードデスクトップ

claude_desktop_config.jsonに以下を追加します。

{ "mcpServers": { "github-enterprise": { "command": "npx", "args": ["-y", "@ddukbg/github-enterprise-mcp", "--token=YOUR_GITHUB_TOKEN", "--github-enterprise-url=YOUR_GITHUB_ENTERPRISE_URL"] } } }

YOUR_GITHUB_TOKENYOUR_GITHUB_ENTERPRISE_URLを実際の値に置き換えます。

カーソル

推奨: URL モード (最も安定)

カーソルで最も信頼性の高い操作を行うには、URL モードの使用をお勧めします。

  1. 別のターミナル ウィンドウでサーバーを起動します。

    cd /path/to/github-enterprise-mcp GITHUB_ENTERPRISE_URL="https://github.your-company.com/api/v3" GITHUB_TOKEN="your_github_token" node dist/index.js --transport http
  2. カーソルの MCP 設定を構成します。

    • カーソルを開いて設定へ移動します

    • AI > MCPサーバーへ移動

    • .cursor/mcp.jsonファイルを編集します。

    { "mcpServers": { "github-enterprise": { "url": "http://localhost:3000/sse" } } }
  3. 変更を適用するにはカーソルを再起動してください

代替手段: コマンドモード

あるいは、コマンド モードを使用するように Cursor を構成することもできますが、URL モードの方が信頼性が高いです。

  1. カーソルを開いて設定へ移動します

  2. AI > MCPサーバーへ移動

  3. MCPサーバーの追加をクリック

  4. 次の詳細を入力してください。

    • 名前: GitHub Enterprise

    • コマンド: npx

    • 引数: @ddukbg/github-enterprise-mcp

    • 環境変数:

      • GITHUB_ENTERPRISE_URL : GitHub Enterprise API の URL

      • GITHUB_TOKEN : GitHub個人アクセストークン

あるいは、 .cursor/mcp.jsonファイルを手動で編集して、次の内容を含めることもできます。

{ "mcpServers": { "github-enterprise": { "command": "npx", "args": [ "@ddukbg/github-enterprise-mcp" ], "env": { "GITHUB_ENTERPRISE_URL": "https://github.your-company.com/api/v3", "GITHUB_TOKEN": "your_github_token" } } } }

言語設定

このMCPサーバーは英語と韓国語の両方をサポートしています。言語は以下の方法で設定できます。

環境変数

# Set language to Korean export LANGUAGE=ko # Or in .env file LANGUAGE=ko

コマンドライン引数

# Set language to Korean node dist/index.js --language ko

指定されていない場合はデフォルトの言語は英語になります。

HTTPモードの追加オプション

  • --debug : デバッグログを有効にする

  • --github-enterprise-url <URL> : GitHub Enterprise API URL を設定する

  • --token <TOKEN> : GitHub個人アクセストークンを設定する

  • --language <LANG> : 言語を設定します (en または ko、デフォルト: en)

利用可能なMCPツール

この MCP サーバーは次のツールを提供します。

ツール名

説明

パラメータ

必要なPAT権限

list-repositories

ユーザーまたは組織のリポジトリリストを取得する

owner

: ユーザー名/組織名

isOrg

: 組織かどうか

type

: リポジトリの種類

sort

: 並べ替えの基準

page

: ページ数

perPage

: ページあたりの項目数

repo

get-repository

詳細なリポジトリ情報を取得する

owner

: リポジトリの所有者

repo

: リポジトリ名

repo

list-branches

リポジトリのブランチを一覧表示する

owner

: リポジトリの所有者

repo

: リポジトリ名

protected_only

: 保護されたブランチのみを表示するかどうか

page

: ページ番号

perPage

: ページあたりの項目数

repo

get-content

ファイルまたはディレクトリの内容を取得する

owner

: リポジトリの所有者

repo

: リポジトリ名

path

: ファイル/ディレクトリパス

ref

: ブランチ/コミット(オプション)

repo

list-pull-requests

リポジトリ内のプルリクエストを一覧表示する

owner

: リポジトリの所有者

repo

: リポジトリ名

state

: PRの状態 filter

sort

: 並べ替えの基準

direction

: 並べ替えの方向

page

: ページ番号

per_page

: ページあたりの項目数

repo

get-pull-request

プルリクエストの詳細を取得する

owner

: リポジトリのオーナー

repo

: リポジトリ名

pull_number

: プルリクエスト番号

repo

create-pull-request

新しいプルリクエストを作成する

owner

: リポジトリの所有者

repo

: リポジトリ名

title

: PR のタイトル

head

: ヘッドブランチ

base

: ベースブランチ

body

: PR の説明

draft

: ドラフト PR として作成

repo

merge-pull-request

プルリクエストをマージする

owner

: リポジトリのオーナー

repo

: リポジトリ名

pull_number

: プルリクエスト番号

merge_method

: マージ方法

commit_title

: コミットタイトル

commit_message

: コミットメッセージ

repo

list-issues

リポジトリ内の問題を一覧表示する

owner

: リポジトリの所有者

repo

: リポジトリ名

state

: 問題の状態 filter

sort

: 並べ替えの基準

direction

: 並べ替えの方向

page

: ページ番号

per_page

: ページあたりの項目数

repo

get-issue

問題の詳細を取得する

owner

: リポジトリの所有者

repo

: リポジトリ名

issue_number

: 問題番号

repo

list-issue-comments

問題またはプルリクエストのコメントを一覧表示する

owner

: リポジトリの所有者

repo

: リポジトリ名

issue_number

: Issue/PR番号

page

: ページ番号

per_page

: ページあたりの項目数

repo

create-issue

新しい問題を作成する

owner

: リポジトリの所有者

repo

: リポジトリ名

title

: 課題のタイトル

body

: 課題の本文

labels

: ラベル名の配列

assignees

: ユーザーログインの配列

milestone

: マイルストーンID

repo

create-repository

新しいリポジトリを作成する

name

: リポジトリ名

description

: リポジトリの説明

private

: プライベートかどうか

auto_init

: README で初期化

gitignore_template

: .gitignore を追加

license_template

: ライセンスを追加

org

: 組織名

repo

update-repository

リポジトリ設定を更新する

owner

: リポジトリの所有者

repo

: リポジトリ名

description

: 新しい説明

private

: プライバシーの変更

default_branch

: デフォルトブランチの変更

has_issues

: 課題の有効化/無効化

has_projects

: プロジェクトの有効化/無効化

has_wiki

: wiki の有効化/無効化

archived

: アーカイブ/アーカイブ解除

repo

delete-repository

リポジトリを削除する

owner

: リポジトリの所有者

repo

: リポジトリ名

confirm

: 確認(trueである必要があります)

delete_repo

list-workflows

GitHub Actionsワークフローの一覧

owner

: リポジトリの所有者

repo

: リポジトリ名

page

: ページ番号

perPage

: ページあたりの項目数

actions:read

list-workflow-runs

ワークフロー実行の一覧

owner

: リポジトリの所有者

repo

: リポジトリ名

workflow_id

: ワークフローID/ファイル名

branch

: ブランチでフィルタリング

status

: ステータスでフィルタリング

page

: ページ番号

perPage

: ページあたりの項目数

actions:read

trigger-workflow

ワークフローをトリガーする

owner

: リポジトリの所有者

repo

: リポジトリ名

workflow_id

: ワークフローID/ファイル名

ref

: Git参照

inputs

: ワークフローの入力

actions:write

get-license-info

GitHub Enterprise ライセンス情報を取得する

-

site_admin(管理者)アカウントが必要です

get-enterprise-stats

GitHub Enterprise のシステム統計を取得する

-

site_admin(管理者)アカウントが必要です

:エンタープライズ固有のツール( get-license-infoおよびget-enterprise-stats )を使用するには、サイト管理者権限を持つユーザーが必要です。Fine-grained トークンではこれらのエンタープライズレベルの権限をサポートできない可能性があるため、Classic Personal Access Token の使用を推奨します。

カーソルのツールの使用

MCPサーバーをセットアップし、CursorをMCPサーバーに接続するように設定したら、CursorのAIチャットでGitHub Enterpriseツールを直接使用できるようになります。以下に例をいくつか示します。

リポジトリの一覧表示

mcp_github_enterprise_list_repositories(owner="octocat")

リポジトリ情報の取得

mcp_github_enterprise_get_repository(owner="octocat", repo="hello-world")

プルリクエストの一覧表示

mcp_github_enterprise_list_pull_requests(owner="octocat", repo="hello-world", state="open")

問題の管理

# List issues mcp_github_enterprise_list_issues(owner="octocat", repo="hello-world", state="all") # Get issue details mcp_github_enterprise_get_issue(owner="octocat", repo="hello-world", issue_number=1) # Get issue/PR comments mcp_github_enterprise_list_issue_comments(owner="octocat", repo="hello-world", issue_number=1) # Create a new issue mcp_github_enterprise_create_issue( owner="octocat", repo="hello-world", title="Found a bug", body="Here is a description of the bug", labels=["bug", "important"] )

リポジトリコンテンツの操作

mcp_github_enterprise_get_content(owner="octocat", repo="hello-world", path="README.md")

リポジトリ管理

# Create a new repository mcp_github_enterprise_create_repository( name="new-project", description="This is a new project", private=true, auto_init=true ) # Update repository settings mcp_github_enterprise_update_repository( owner="octocat", repo="hello-world", description="Updated description", has_issues=true )

ユーザー管理(エンタープライズのみ)

これらの機能は、GitHub Enterprise Server 環境向けに特別に設計されており、管理者権限が必要です。

# List all users in the GitHub Enterprise instance mcp_github_enterprise_list_users(filter="active", per_page=100) # Get a specific user's details mcp_github_enterprise_get_user(username="octocat") # Create a new user (Enterprise only) mcp_github_enterprise_create_user( login="newuser", email="newuser@example.com", name="New User", company="ACME Inc." ) # Update a user's information (Enterprise only) mcp_github_enterprise_update_user( username="octocat", email="updated-email@example.com", location="San Francisco" ) # Suspend a user (Enterprise only) mcp_github_enterprise_suspend_user( username="octocat", reason="Violation of terms of service" ) # Unsuspend a user (Enterprise only) mcp_github_enterprise_unsuspend_user(username="octocat") # List organizations a user belongs to mcp_github_enterprise_list_user_orgs(username="octocat")

APIの改善

  • 柔軟な API URL 構成 (さまざまな環境変数とコマンドライン引数をサポート)

  • 強化されたエラー処理とタイムアウト管理

  • ユーザーフレンドリーな応答フォーマットとメッセージ

貢献

貢献を歓迎します!お気軽にプルリクエストを送信してください。

ライセンス

ISC

Related MCP Servers

  • A
    security
    -
    license
    A
    quality
    MCP Server for the GitHub API, enabling file operations, repository management, search functionality, and more.
    Last updated -
    22,573
    71,962
    MIT License
  • A
    security
    -
    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
    • Linux
    • Apple
  • A
    security
    -
    license
    A
    quality
    A MCP server that provides access to GitHub trending repositories and developers data through a simple API interface.
    Last updated -
    2
    35
    MIT License
    • Apple
  • -
    security
    -
    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 -
    2
    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/ddukbg/github-enterprise-mcp'

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