jd-git-mcp

v0.1.0
jd-git-mcp Checked 2 days ago Published 10 months ago

Git 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仓库状态,显示已暂存、未暂存和未跟踪的文件

ParameterTypeDescription
repo_pathGit仓库路径。如果不传则使用默认仓库

git_diff_unstaged Git Diff Unstaged

获取未暂存的更改(工作目录中尚未add的变更)

ParameterTypeDescription
file_path可选,指定文件路径只查看该文件的diff
repo_pathGit仓库路径

git_diff_staged Git Diff Staged

获取已暂存的更改(已add但未commit的变更)

ParameterTypeDescription
file_path可选,指定文件路径
repo_pathGit仓库路径

git_diff Git Diff

获取与指定分支或提交的差异

ParameterTypeDescription
file_path可选,指定文件路径
repo_pathGit仓库路径
targetstring目标分支或提交hash,默认HEAD

git_add Git Add

添加文件到暂存区

ParameterTypeDescription
files *array要添加的文件列表,使用["."]添加所有文件
repo_pathGit仓库路径

git_reset Git Reset

取消暂存文件

ParameterTypeDescription
files可选,要取消暂存的文件列表。不传则取消所有暂存
repo_pathGit仓库路径

git_commit Git Commit

提交已暂存的更改

ParameterTypeDescription
message *string提交信息
repo_pathGit仓库路径

git_log Git Log

获取提交历史

ParameterTypeDescription
file_path可选,查看指定文件的提交历史
max_countinteger最大返回数量,默认10
repo_pathGit仓库路径

git_branch Git Branch

列出所有分支

ParameterTypeDescription
repo_pathGit仓库路径
show_remoteboolean是否显示远程分支,默认False

git_create_branch Git Create Branch

创建新分支

ParameterTypeDescription
branch_name *string新分支名称
base可选,基于哪个分支或提交创建
repo_pathGit仓库路径

git_checkout Git Checkout

切换分支

ParameterTypeDescription
target *string目标分支名或提交hash
createboolean是否同时创建新分支,默认False
repo_pathGit仓库路径

git_show Git Show

显示指定提交的详细信息

ParameterTypeDescription
commitstring提交hash或引用,默认HEAD
repo_pathGit仓库路径

list_repositories List Repositories

列出当前配置的默认仓库列表