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 Repo 浏览器 (Node.js)

使用模型上下文协议 (MCP) 的 Git 存储库浏览器的 Node.js 实现。

配置

将其添加到您的 MCP 设置配置文件中:

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

特征

该服务器提供两个主要工具:

  1. git_directory_structure :返回存储库目录结构的树状表示
    • 输入:存储库 URL
    • 输出:存储库结构的 ASCII 树表示
  2. git_read_important_files :读取并返回存储库中指定文件的内容
    • 输入:存储库 URL 和文件路径列表
    • 输出:将文件路径映射到其内容的字典

实现细节

  • 使用 Node.js 原生模块(crypto、path、os)实现核心功能
  • 利用 fs-extra 增强文件操作
  • 使用 simple-git 进行 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

一个 Node.js 服务器,允许通过 MCP 浏览 Git 存储库,提供查看目录结构和从存储库读取重要文件的工具。

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