Skip to main content
Glama

Git Repo Browser MCP

MCP Git リポジトリ ブラウザ (Node.js)

モデル コンテキスト プロトコル (MCP) を使用した Git リポジトリ ブラウザーの Node.js 実装。

インストール

NPM(推奨)

npm install -g git-commands-mcp

手動インストール

git clone https://github.com/bsreeram08/git-commands-mcp.git cd git-commands-mcp npm install

構成

MCP 設定構成ファイルに以下を追加します。

{ "mcpServers": { "git-commands-mcp": { "command": "git-commands-mcp" } } }

手動でインストールする場合は、以下を使用します。

{ "mcpServers": { "git-commands-mcp": { "command": "node", "args": ["/path/to/git-commands-mcp/src/index.js"] } } }

特徴

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

基本的なリポジトリ操作

  1. git_directory_structure : リポジトリのディレクトリ構造のツリー状の表現を返します
    • 入力: リポジトリ URL
    • 出力: リポジトリ構造のASCIIツリー表現
  2. git_read_files : リポジトリ内の指定されたファイルの内容を読み取って返します
    • 入力: リポジトリのURLとファイルパスのリスト
    • 出力: ファイルパスとその内容をマッピングする辞書
  3. git_search_code : リポジトリコード内のパターンを検索します
    • 入力: リポジトリ URL、検索パターン、オプションのファイルパターン、大文字と小文字の区別、コンテキスト行
    • 出力: 一致する行とコンテキストを含む検索結果を含む JSON

支店運営

  1. git_branch_diff : 2つのブランチを比較し、それらの間で変更されたファイルを表示します
    • 入力: リポジトリ URL、ソース ブランチ、ターゲット ブランチ、およびオプションの show_patch フラグ
    • 出力: コミット数と差分サマリーを含むJSON

コミット操作

  1. git_commit_history : オプションのフィルタリングを使用してブランチのコミット履歴を取得する
    • 入力: リポジトリ URL、ブランチ名、最大数、作成者フィルター、開始日、終了日、メッセージ grep
    • 出力: コミットの詳細を含むJSON
  2. git_commits_details : 完全なメッセージと差分を含むコミットの詳細情報を取得します
    • 入力: リポジトリ URL、ブランチ名、最大数、include_diff フラグ、作成者フィルター、開始日、終了日、メッセージ grep
    • 出力: 詳細なコミット情報を含むJSON
  3. git_local_changes : 作業ディレクトリ内のコミットされていない変更を取得する
    • 入力: ローカルリポジトリのパス
    • 出力: ステータス情報と差分を含むJSON

プロジェクト構造

git-commands-mcp/ ├── src/ │ ├── index.js # Entry point │ ├── server.js # Main server implementation │ ├── handlers/ # Tool handlers │ │ └── index.js # Tool implementation functions │ └── utils/ # Utility functions │ └── git.js # Git-related helper functions ├── package.json └── readme.md

実装の詳細

  • コア機能には Node.js ネイティブ モジュール (crypto、path、os) を使用します
  • 強化されたファイル操作のために fs-extra を活用
  • Gitリポジトリ操作にはsimple-gitを使用する
  • クリーンなエラー処理とリソースのクリーンアップを実装します
  • リポジトリの URL ハッシュに基づいて決定論的な一時ディレクトリを作成します。
  • 効率性を高めるために、可能な場合はクローンリポジトリを再利用します。
  • 保守性を向上させるモジュール式コード構造

要件

  • Node.js 14.x 以上
  • システムにGitがインストールされている

使用法

npm 経由でグローバルにインストールした場合:

git-commands-mcp

手動でインストールする場合:

node src/index.js

サーバーは stdio 上で実行されるため、MCP クライアントと互換性があります。

CI/CD

このプロジェクトでは、継続的な統合とデプロイメントに GitHub Actions を使用します。

自動NPM公開

リポジトリは、変更がマスター ブランチにプッシュされたときにパッケージを npm に自動的に公開する GitHub Actions ワークフローで構成されています。

NPM_AUTOMATION_TOKENの設定

自動公開を有効にするには、npm Automation トークンを GitHub シークレットとして追加する必要があります (これは、2FA が有効になっているアカウントでも機能します)。

  1. npm Automation トークンを生成します。
    • npmjs.comでnpmアカウントにログインします。
    • プロフィール設定に移動
    • 「アクセストークン」を選択
    • 「新しいトークンを生成」をクリックします
    • 「自動化」トークンタイプを選択
    • 適切な権限を設定します(パッケージには「読み取りと書き込み」が必要です)
    • 生成されたトークンをコピーする
  2. トークンを GitHub リポジトリに追加します。
    • GitHubリポジトリへアクセスする
    • 「設定」>「シークレットと変数」>「アクション」に移動します
    • 「新しいリポジトリシークレット」をクリックします
    • 名前: NPM_AUTOMATION_TOKEN
    • 値: npm Automationトークンを貼り付けます
    • 「シークレットを追加」をクリック

設定が完了すると、マスター ブランチへのプッシュによって、パッケージを npm に公開するワークフローがトリガーされます。

ライセンス

MIT ライセンス - 詳細についてはLICENSEファイルを参照してください。

リンク

-
security - not tested
A
license - permissive license
-
quality - not tested

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.

モデル コンテキスト プロトコルを介して Git リポジトリを参照できるようにする Node.js 実装。ディレクトリ構造の表示、ファイルの読み取り、コードの検索、ブランチの比較、コミット履歴の表示などの機能を提供します。

  1. インストール
    1. NPM(推奨)
    2. 手動インストール
  2. 構成
    1. 特徴
      1. 基本的なリポジトリ操作
      2. 支店運営
      3. コミット操作
    2. プロジェクト構造
      1. 実装の詳細
        1. 要件
          1. 使用法
            1. CI/CD
              1. 自動NPM公開
            2. ライセンス
              1. リンク

                Related MCP Servers

                • -
                  security
                  A
                  license
                  -
                  quality
                  A Model Context Protocol server for Git repository interaction and automation. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.
                  Last updated -
                  12
                  50,522
                  Python
                  MIT License
                • -
                  security
                  F
                  license
                  -
                  quality
                  Enables interaction with GitHub through the GitHub API, supporting file operations, repository management, advanced search, and issue tracking with comprehensive error handling and automatic branch creation.
                  Last updated -
                  9
                  1
                  TypeScript
                • A
                  security
                  A
                  license
                  A
                  quality
                  A Node.js server that allows browsing Git repositories through MCP, providing tools to view directory structures and read important files from repositories.
                  Last updated -
                  2
                  JavaScript
                  MIT License
                  • Linux
                  • Apple
                • A
                  security
                  A
                  license
                  A
                  quality
                  A Model Context Protocol server that enables Large Language Models to interact with Git repositories through a robust API, supporting operations like repository initialization, cloning, file staging, committing, and branch management.
                  Last updated -
                  21
                  482
                  65
                  TypeScript
                  Apache 2.0

                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/bsreeram08/git-commands-mcp'

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