Works with local git repositories: list repos, list commits, create and push tags, and refresh.
接入配置
选择客户端,复制配置,再按项目文档补齐环境变量。
claude mcp add git --env GIT_REPOS_PATH='<GIT_REPOS_PATH>' -- uvx git-mcp~/.codex/config.toml
[mcp_servers.git]
command = "uvx"
args = ["git-mcp"]
env = { GIT_REPOS_PATH = "<GIT_REPOS_PATH>" }
# codex mcp add git --env GIT_REPOS_PATH='<GIT_REPOS_PATH>' -- uvx git-mcp~/.cursor/mcp.json
{
"mcpServers": {
"git": {
"command": "uvx",
"args": [
"git-mcp"
],
"env": {
"GIT_REPOS_PATH": "<GIT_REPOS_PATH>"
}
}
}
}.vscode/mcp.json
{
"servers": {
"git": {
"type": "stdio",
"command": "uvx",
"args": [
"git-mcp"
],
"env": {
"GIT_REPOS_PATH": "<GIT_REPOS_PATH>"
}
}
}
}~/.gemini/settings.json
{
"mcpServers": {
"git": {
"command": "uvx",
"args": [
"git-mcp"
],
"env": {
"GIT_REPOS_PATH": "<GIT_REPOS_PATH>"
}
}
}
}claude_desktop_config.json
{
"mcpServers": {
"git": {
"command": "uvx",
"args": [
"git-mcp"
],
"env": {
"GIT_REPOS_PATH": "<GIT_REPOS_PATH>"
}
}
}
}.trae/mcp.json
{
"mcpServers": {
"git": {
"command": "uvx",
"args": [
"git-mcp"
],
"env": {
"GIT_REPOS_PATH": "<GIT_REPOS_PATH>"
}
}
}
}需要的环境变量
GIT_REPOS_PATH
把占位值换成你自己的密钥;不要把密钥提交到代码仓库。