Skip to main content
Glama

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"] } } }

Related MCP server: Git MCP

特征

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

  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文件。

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

Latest Blog Posts

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/razorback16/mcp-git-repo-browser'

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