mcpField
G
GitHub Enterprise MCP Server

GitHub Enterprise MCP Server

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

GitHub Enterprise MCP Server について

GitHub Enterprise MCP Server は、GitHub Enterprise API に接続し、Cursor などのクライアントからリポジトリ、Issue、プルリクエスト、Actions ワークフローを扱えるようにするMCPサーバーです。主に GitHub Enterprise Server 向けで、GitHub.com や GitHub Enterprise Cloud でも利用できます。

主な機能

  1. 01リポジトリ一覧と詳細情報の取得
  2. 02Issue とプルリクエストの管理
  3. 03リポジトリの作成、更新、削除
  4. 04GitHub Actions ワークフローの一覧取得と実行
  5. 05ユーザー管理とエンタープライズ統計の参照

活用シーン

  1. 01Cursor からプルリクエストを作成・確認する
  2. 02社内の GitHub Enterprise で Issue を管理する
  3. 03GitHub Actions ワークフローを一覧表示して実行する

MCP 対応

MCP サーバーとして、list-repositories、create-issue、trigger-workflow などのツールを MCP クライアントに公開し、GitHub Enterprise の操作を提供します。

設定

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

mcp.json · 共通設定
{
"mcpServers": {
"github-enterprise": {
"command": "npx",
"args": [
"-y",
"@ddukbg/github-enterprise-mcp"
],
"env": {
"GITHUB_ENTERPRISE_URL": "<GITHUB_ENTERPRISE_URL>",
"GITHUB_TOKEN": "<GITHUB_TOKEN>"
}
}
}
}
起動コマンドnpx -y @ddukbg/github-enterprise-mcp
設定が必要な環境変数
GITHUB_ENTERPRISE_URL
GITHUB_TOKENシークレット

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

パッケージ
npm@ddukbg/github-enterprise-mcp

ツール

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

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

詳細

MseeP.ai Security Assessment Badge

Trust Score

GitHub Enterprise MCP サーバー

image

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

互換性

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

  • GitHub.com
  • GitHub Enterprise Cloud

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

主な機能

  • GitHub Enterprise インスタンスからリポジトリ一覧を取得
  • リポジトリの詳細情報を取得
  • リポジトリのブランチ一覧を表示
  • ファイルとディレクトリの内容を表示
  • イシューとプルリクエストを管理
  • リポジトリ管理(作成、更新、削除)
  • GitHub Actions ワークフロー管理
  • ユーザー管理(ユーザーの一覧表示、作成、更新、削除、停止/停止解除)
  • エンタープライズ統計にアクセス
  • エラー処理の強化と、使いやすいレスポンス形式

はじめに

前提条件
  • Node.js 18 以降
  • GitHub Enterprise インスタンスへのアクセス
  • Personal Access Token(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 モードを使用して Cursor に接続します。

本番環境向けのインストールとセットアップ
オプション 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 に接続します。

    • 次の内容を Cursor の .cursor/mcp.json ファイルに追加します。
    {
      "mcpServers": {
        "github-enterprise": {
          "url": "http://localhost:3000/sse"
        }
      }
    }
    
オプション 2:グローバルコマンドとしてインストールする(npm link)

この方法はローカル開発に便利です。

# 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

次の内容を 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_TOKEN と YOUR_GITHUB_ENTERPRISE_URL を実際の値に置き換えてください。

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

Cursor で最も安定して動作させるには、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. Cursor の MCP 設定を構成します。

    • Cursor を開き、Settings に移動します。
    • AI > MCP Servers に移動します。
    • .cursor/mcp.json ファイルを編集します。
    {
      "mcpServers": {
        "github-enterprise": {
          "url": "http://localhost:3000/sse"
        }
      }
    }
    
  3. Cursor を再起動して変更を適用します。

代替方法:コマンドモード

URL モードの方が安定していますが、コマンドモードを使用するよう Cursor を構成することもできます。

  1. Cursor を開き、Settings に移動します。
  2. AI > MCP Servers に移動します。
  3. Add MCP Server をクリックします。
  4. 次の詳細を入力します。
    • Name:GitHub Enterprise
    • Command:npx
    • Arguments:@ddukbg/github-enterprise-mcp
    • Environment Variables:
      • 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: 1ページあたりの項目数
repo
get-repositoryリポジトリの詳細情報を取得しますowner: リポジトリの所有者
repo: リポジトリ名
repo
list-branchesリポジトリのブランチ一覧を取得しますowner: リポジトリの所有者
repo: リポジトリ名
protected_only: 保護されたブランチのみを表示するかどうか
page: ページ番号
perPage: 1ページあたりの項目数
repo
get-contentファイルまたはディレクトリの内容を取得しますowner: リポジトリの所有者
repo: リポジトリ名
path: ファイル/ディレクトリのパス
ref: ブランチ/コミット(任意)
repo
list-pull-requestsリポジトリのプルリクエスト一覧を取得しますowner: リポジトリの所有者
repo: リポジトリ名
state: PR の状態フィルター
sort: 並べ替え基準
direction: 並べ替え順
page: ページ番号
per_page: 1ページあたりの項目数
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リポジトリの Issue 一覧を取得しますowner: リポジトリの所有者
repo: リポジトリ名
state: Issue の状態フィルター
sort: 並べ替え基準
direction: 並べ替え順
page: ページ番号
per_page: 1ページあたりの項目数
repo
get-issueIssue の詳細を取得しますowner: リポジトリの所有者
repo: リポジトリ名
issue_number: Issue 番号
repo
list-issue-commentsIssue またはプルリクエストのコメント一覧を取得しますowner: リポジトリの所有者
repo: リポジトリ名
issue_number: Issue/PR 番号
page: ページ番号
per_page: 1ページあたりの項目数
repo
create-issue新しい Issue を作成しますowner: リポジトリの所有者
repo: リポジトリ名
title: Issue のタイトル
body: Issue の本文
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: Issue を有効/無効にするかどうか
has_projects: Projects を有効/無効にするかどうか
has_wiki: Wiki を有効/無効にするかどうか
archived: アーカイブ/アーカイブ解除
repo
delete-repositoryリポジトリを削除しますowner: リポジトリの所有者
repo: リポジトリ名
confirm: 確認(true である必要があります)
delete_repo
list-workflowsGitHub Actions ワークフロー一覧を取得しますowner: リポジトリの所有者
repo: リポジトリ名
page: ページ番号
perPage: 1ページあたりの項目数
actions:read
list-workflow-runsワークフローの実行一覧を取得しますowner: リポジトリの所有者
repo: リポジトリ名
workflow_id: ワークフロー ID/ファイル名
branch: ブランチで絞り込み
status: ステータスで絞り込み
page: ページ番号
perPage: 1ページあたりの項目数
actions:read
trigger-workflowワークフローを起動しますowner: リポジトリの所有者
repo: リポジトリ名
workflow_id: ワークフロー ID/ファイル名
ref: Git リファレンス
inputs: ワークフローの入力値
actions:write
get-license-infoGitHub Enterprise のライセンス情報を取得します-site_admin(管理者)アカウントが必要です
get-enterprise-statsGitHub Enterprise のシステム統計情報を取得します-site_admin(管理者)アカウントが必要です

注:Enterprise 専用ツール(get-license-info および get-enterprise-stats)を使用するには、サイト管理者権限を持つユーザーが必要です。Fine-grained トークンでは Enterprise レベルの権限がサポートされない場合があるため、Classic Personal Access Token の使用をおすすめします。

Cursor でツールを使用する

MCP サーバーをセットアップし、接続するように Cursor を設定すると、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")
Issue の管理
# 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
)
ユーザー管理(Enterprise 専用)

これらの機能は 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="[email protected]",
  name="New User",
  company="ACME Inc."
)

# Update a user's information (Enterprise only)
mcp_github_enterprise_update_user(
  username="octocat",
  email="[email protected]",
  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 設定(さまざまな環境変数とコマンドライン引数をサポート)
  • エラー処理とタイムアウト管理の強化
  • ユーザーフレンドリーなレスポンス形式とメッセージ

コントリビューション

コントリビューションを歓迎します。お気軽に Pull Request を送信してください。

ライセンス

ISC

コメント

MCP は初めてですか?

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

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