MCP Git Repo 浏览器 (Node.js)
使用模型上下文协议 (MCP) 的 Git 存储库浏览器的 Node.js 实现。
配置
将其添加到您的 MCP 设置配置文件中:
特征
该服务器提供两个主要工具:
git_directory_structure
:返回存储库目录结构的树状表示输入:存储库 URL
输出:存储库结构的 ASCII 树表示
git_read_important_files
:读取并返回存储库中指定文件的内容输入:存储库 URL 和文件路径列表
输出:将文件路径映射到其内容的字典
实现细节
使用 Node.js 原生模块(crypto、path、os)实现核心功能
利用 fs-extra 增强文件操作
使用 simple-git 进行 Git 存储库操作
实现干净的错误处理和资源清理
根据存储库 URL 哈希创建确定性临时目录
尽可能重复使用克隆的存储库以提高效率
要求
Node.js 14.x 或更高版本
系统上安装的 Git
安装
用法
启动服务器:
服务器在 stdio 上运行,使其与 MCP 客户端兼容。
执照
MIT 许可证 - 有关详细信息,请参阅LICENSE文件。
hybrid server
The server is able to function both locally and remotely, depending on the configuration or use case.
一个 Node.js 服务器,允许通过 MCP 浏览 Git 存储库,提供查看目录结构和从存储库读取重要文件的工具。
Related Resources
Related MCP Servers
- AsecurityAlicenseAqualityA specialized MCP server for in-depth analysis of git repositories, offering tools for branch overview, time period analysis, file changes, and merge recommendations.Last updated -42Apache 2.0
- AsecurityAlicenseAqualityAn MCP server for gitingest. It allows MCP clients like Claude Desktop, Cursor, Cline etc to quickly extract information about Github repositories including repository summaries, project directory structure, file contents, etcLast updated -3123MIT License
- -securityAlicense-qualityAn MCP server that enables communication with GitLab repositories, allowing interaction with GitLab's API to manage projects, issues, and repositories through natural language.Last updated -9,0611MIT License