GitHub MCP Tools

Integrations

  • Supports environment variable management through .env files to securely store GitHub credentials and configuration settings.

  • Allows interaction with GitHub's API to search repositories and issues, create and manage issues and pull requests, handle repository settings and workflows, and manage collaborators and teams.

  • Enables management of GitHub Actions workflows, including enabling, disabling, and triggering workflow actions within repositories.

GitHub MCPツール

Claude Desktop を介して GitHub API と対話するための Multi-Claude プログラム (MCP)。

特徴

  • GitHub リポジトリと問題を検索する
  • GitHub の問題とプルリクエストを作成、更新、管理する
  • リポジトリの設定と構成を管理する
  • リポジトリのワークフローとアクションを処理する
  • ユーザーと組織を検索する
  • リポジトリの共同作業者とチームを管理する

インストール

  1. このリポジトリをクローンします:
    git clone https://github.com/yourusername/github-mcp.git cd github-mcp
  2. 仮想環境を作成してアクティブ化します。
    # On macOS/Linux python -m venv venv source venv/bin/activate # On Windows python -m venv venv .\venv\Scripts\activate
  3. 依存関係をインストールします:
    pip install -r requirements.txt
  4. プロジェクト ルートに.envファイルを作成します。
    touch .env
  5. GitHub の認証情報を.envファイルに追加します。
    GITHUB_TOKEN=your_personal_access_token_here GITHUB_USERNAME=your_github_username
  6. インストールをテストします。
    # Run all tests python -m pytest # Run a specific test file python -m pytest tests/test_search_repos.py
  7. MCP サーバーを起動します。
    python run.py

環境設定

GitHub 個人アクセストークン

GitHub で認証するには、きめ細かな個人アクセス トークンが必要です。

  1. GitHubアカウントにログインする
  2. 設定 > 開発者向け設定 > 個人アクセストークン > きめ細かなトークンに移動します
  3. 「新しいトークンを生成」をクリックします
  4. トークンを設定します。
    • トークン名:「Claude Desktop Integration」
    • 説明: 「Claude Desktop GitHub 統合用のトークン」
    • 有効期限: 適切な有効期限を選択してください
    • リポジトリアクセス:「すべてのリポジトリ」または特定のリポジトリを選択
    • 権限:
      • リポジトリの権限:
        • アクション: 読み取りと書き込み
        • 内容: 読み書き
        • 問題: 読み書き
        • プルリクエスト: 読み取りと書き込み
        • リポジトリフック: 読み取りと書き込み
        • リポジトリ設定: 読み取りと書き込み
      • 組織の権限 (組織リポジトリで作業する場合):
        • メンバー: 読み取り専用
        • チーム: 読み取り専用
  5. 「トークンを生成」をクリックし、生成されたトークンを安全に保存します。

ツール

リポジトリを検索

さまざまな基準を使用して GitHub リポジトリを検索します。

パラメータ:

  • クエリ: 検索クエリ文字列
  • sort: 並べ替えフィールド (スター、フォーク、更新など)
  • order: 並べ替え順(昇順または降順)
  • max_results: 返される結果の最大数(デフォルト: 10)

問題を作成

指定されたリポジトリに新しい GitHub の問題を作成します。

パラメータ:

  • 所有者: リポジトリの所有者
  • repo: リポジトリ名
  • タイトル: 問題のタイトル
  • 本文: 問題の説明
  • ラベル: 適用するラベルのリスト
  • 担当者: 担当者のユーザー名のリスト

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

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

パラメータ:

  • 所有者: リポジトリの所有者
  • repo: リポジトリ名
  • タイトル: PRタイトル
  • 本文: PRの説明
  • head: ソースブランチ
  • ベース: ターゲットブランチ
  • draft: ドラフトPRとして作成するかどうか

リポジトリ設定の管理

リポジトリの設定と構成を更新します。

パラメータ:

  • 所有者: リポジトリの所有者
  • repo: リポジトリ名
  • 設定: 更新する設定の辞書

検索の問題

リポジトリ全体の問題を検索します。

パラメータ:

  • クエリ: 検索クエリ文字列
  • 状態: 問題の状態 (オープン、クローズ、すべて)
  • 並べ替え: 並べ替えフィールド
  • 順序: 並べ替え順
  • max_results: 結果の最大数

ワークフローを管理する

GitHub Actions ワークフローを管理します。

パラメータ:

  • 所有者: リポジトリの所有者
  • repo: リポジトリ名
  • workflow_file: ワークフローファイルパス
  • action: 実行するアクション(有効化、無効化、トリガー)

共同作業者の管理

リポジトリの共同作業者を管理します。

パラメータ:

  • 所有者: リポジトリの所有者
  • repo: リポジトリ名
  • ユーザー名: 共同作業者のユーザー名
  • 権限: 権限レベル (プル、プッシュ、管理、維持、トリアージ)

使用例

# Search for repositories search_repos(query="python web framework", sort="stars", max_results=5) # Create a new issue create_issue( owner="username", repo="repository", title="Bug: Login not working", body="Users cannot log in using the login button", labels=["bug", "high-priority"] ) # Create a pull request create_pull_request( owner="username", repo="repository", title="Feature: Add user authentication", body="Implements JWT-based authentication", head="feature/auth", base="main" ) # Search for issues search_issues(query="is:open is:issue author:username", max_results=10) # Manage repository settings manage_repo_settings( owner="username", repo="repository", settings={ "has_issues": True, "has_projects": True, "has_wiki": True } )

発達

テストの実行

# Run all tests python -m pytest # Run with coverage python -m pytest --cov=src tests/ # Run specific test file python -m pytest tests/test_search_repos.py

新しいツールの追加

  1. src/tools/に新しいファイルを作成する
  2. ツール機能を実装する
  3. src/main.pyにツールを登録する
  4. テストをtests/に追加する
  5. README.md のドキュメントを更新します

貢献

  1. リポジトリをフォークする
  2. 機能ブランチを作成する
  3. 変更を加える
  4. テストを実行する
  5. プルリクエストを送信する

ライセンス

MITライセンス

-
security - not tested
F
license - not found
-
quality - not tested

Claude Desktop を介して GitHub API と対話するためのマルチ Claude プログラム。これにより、ユーザーはリポジトリの検索、問題の管理、プル リクエスト、リポジトリ設定、ワークフロー、共同作業者を管理できます。

  1. Features
    1. Installation
      1. Environment Setup
        1. GitHub Personal Access Token
      2. Tools
        1. Search Repositories
        2. Create Issue
        3. Create Pull Request
        4. Manage Repository Settings
        5. Search Issues
        6. Manage Workflows
        7. Manage Collaborators
      3. Example Usage
        1. Development
          1. Running Tests
          2. Adding New Tools
          3. Contributing
        2. License
          ID: lwqgnude1m