MCP Git Repo Browser

by razorback16
Verified

local-only server

The server can only run on the client’s local machine because it depends on local resources.

Integrations

  • Provides tools to browse Git repositories, including retrieving directory structures as ASCII trees and reading specified file contents from repositories accessed via URL.

  • Implements Git repository browsing functionality in Node.js, allowing for efficient cloning and exploration of repositories through a standardized interface.

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

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

構成

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

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

特徴

サーバーは主に 2 つのツールを提供します。

  1. git_directory_structure : リポジトリのディレクトリ構造のツリー状の表現を返します
    • 入力: リポジトリ URL
    • 出力: リポジトリ構造のASCIIツリー表現
  2. git_read_important_files : リポジトリ内の指定されたファイルの内容を読み取り、返します。
    • 入力: リポジトリのURLとファイルパスのリスト
    • 出力: ファイルパスとその内容をマッピングする辞書

実装の詳細

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

要件

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

インストール

git clone <repository-url> cd mcp-git-repo-browser npm install

使用法

サーバーを起動します。

node src/index.js

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

ライセンス

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

You must be authenticated.

A
security – no known vulnerabilities
A
license - permissive license
A
quality - confirmed to work

MCP を介して Git リポジトリを参照できる Node.js サーバー。ディレクトリ構造を表示したり、リポジトリから重要なファイルを読み取ったりするツールを提供します。

  1. Configuration
    1. Features
      1. Implementation Details
        1. Requirements
          1. Installation
            1. Usage
              1. License
                ID: zmmq29sb91