MCP Git 仓库浏览器是一个基于 Node.js 的工具,借助模型上下文协议 (MCP),可实现对 Git 仓库的便捷浏览与操作。
安装完成后,在终端中运行:
git-commands-mcp --help
即可查看所有可用命令和选项。
该服务器提供以下工具:
git_directory_structure
:返回仓库目录结构的树状表示
git_read_files
:读取并返回指定文件的内容
git_search_code
:在仓库代码中搜索
- src/
- index.js:入口点
- utils/
- gitOperations.js:Git 操作工具
- config/
- settings.json:默认配置
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"]
}
}
}
MIT License - 请参阅 LICENSE 文件了解详细信息。