jd-git-mcp
v0.1.0Git MCP tool for managing multiple repositories
These tools were reported by the server itself during our smoke test (tools/list), not copied from the README.
git_status Git Status
获取Git仓库状态,显示已暂存、未暂存和未跟踪的文件
| Parameter | Type | Description |
|---|---|---|
repo_path | Git仓库路径。如果不传则使用默认仓库 |
git_diff_unstaged Git Diff Unstaged
获取未暂存的更改(工作目录中尚未add的变更)
| Parameter | Type | Description |
|---|---|---|
file_path | 可选,指定文件路径只查看该文件的diff | |
repo_path | Git仓库路径 |
git_diff_staged Git Diff Staged
获取已暂存的更改(已add但未commit的变更)
| Parameter | Type | Description |
|---|---|---|
file_path | 可选,指定文件路径 | |
repo_path | Git仓库路径 |
git_diff Git Diff
获取与指定分支或提交的差异
| Parameter | Type | Description |
|---|---|---|
file_path | 可选,指定文件路径 | |
repo_path | Git仓库路径 | |
target | string | 目标分支或提交hash,默认HEAD |
git_add Git Add
添加文件到暂存区
| Parameter | Type | Description |
|---|---|---|
files * | array | 要添加的文件列表,使用["."]添加所有文件 |
repo_path | Git仓库路径 |
git_reset Git Reset
取消暂存文件
| Parameter | Type | Description |
|---|---|---|
files | 可选,要取消暂存的文件列表。不传则取消所有暂存 | |
repo_path | Git仓库路径 |
git_commit Git Commit
提交已暂存的更改
| Parameter | Type | Description |
|---|---|---|
message * | string | 提交信息 |
repo_path | Git仓库路径 |
git_log Git Log
获取提交历史
| Parameter | Type | Description |
|---|---|---|
file_path | 可选,查看指定文件的提交历史 | |
max_count | integer | 最大返回数量,默认10 |
repo_path | Git仓库路径 |
git_branch Git Branch
列出所有分支
| Parameter | Type | Description |
|---|---|---|
repo_path | Git仓库路径 | |
show_remote | boolean | 是否显示远程分支,默认False |
git_create_branch Git Create Branch
创建新分支
| Parameter | Type | Description |
|---|---|---|
branch_name * | string | 新分支名称 |
base | 可选,基于哪个分支或提交创建 | |
repo_path | Git仓库路径 |
git_checkout Git Checkout
切换分支
| Parameter | Type | Description |
|---|---|---|
target * | string | 目标分支名或提交hash |
create | boolean | 是否同时创建新分支,默认False |
repo_path | Git仓库路径 |
git_show Git Show
显示指定提交的详细信息
| Parameter | Type | Description |
|---|---|---|
commit | string | 提交hash或引用,默认HEAD |
repo_path | Git仓库路径 |
list_repositories List Repositories
列出当前配置的默认仓库列表