Skip to main content
Glama

Git MCP 服务器

模型上下文协议 (MCP) 服务器,通过标准化接口提供增强的 Git 操作。该服务器与 MCP 生态系统集成,为 AI 助手提供 Git 功能。

特征

  • 核心 Git 操作:初始化、克隆、状态、添加、提交、推送、拉取

  • 分支管理:列出、创建、删除、结帐

  • 标签操作:列出、创建、删除

  • 远程管理:列出、添加、删除

  • 存储操作:列出、保存、弹出

  • 批量操作:按顺序执行多个 Git 操作

  • GitHub 集成:通过个人访问令牌内置 GitHub 支持

  • 路径解析:具有可选默认路径配置的智能路径处理

  • 错误处理:使用自定义错误类型进行全面的错误处理

  • 存储库缓存:高效的存储库状态管理

  • 性能监控:内置性能跟踪

Related MCP server: GitHub MCP Server Plus

安装

  1. 克隆存储库:

git clone https://github.com/yourusername/git-mcp-v2.git
cd git-mcp-v2
  1. 安装依赖项:

npm install
  1. 构建项目:

npm run build

配置

添加到您的 MCP 设置文件:

{
  "mcpServers": {
    "git-v2": {
      "command": "node",
      "args": ["path/to/git-mcp-v2/build/index.js"],
      "env": {
        "GIT_DEFAULT_PATH": "/path/to/default/git/directory",
        "GITHUB_PERSONAL_ACCESS_TOKEN": "your-github-pat"
      }
    }
  }
}

环境变量

  • GIT_DEFAULT_PATH :(可选)Git 操作的默认路径

  • GITHUB_PERSONAL_ACCESS_TOKEN :(可选)用于 GitHub 操作的 GitHub 个人访问令牌

可用工具

基本操作

  • init :初始化一个新的 Git 存储库

  • clone :克隆存储库

  • status :获取存储库状态

  • add :阶段文件

  • commit :创建提交

  • push :将提交推送到远程

  • pull :从远程拉取更改

分支机构运营

  • branch_list :列出所有分支

  • branch_create :创建一个新分支

  • branch_delete :删除分支

  • checkout :切换分支或恢复工作树文件

标签操作

  • tag_list :列出标签

  • tag_create :创建标签

  • tag_delete :删除标签

远程操作

  • remote_list :列出遥控器

  • remote_add :添加远程

  • remote_remove :删除远程

存储操作

  • stash_list :列出存储

  • stash_save :将更改保存到存储区

  • stash_pop :应用和删除存储

批量操作

  • bulk_action :按顺序执行多个 Git 操作

发展

# Run tests
npm test

# Run tests with coverage
npm run test:coverage

# Run linter
npm run lint

# Format code
npm run format

执照

麻省理工学院

贡献

  1. 分叉存储库

  2. 创建你的功能分支( git checkout -b feature/amazing-feature

  3. 提交您的更改( git commit -m 'Add some amazing feature'

  4. 推送到分支( git push origin feature/amazing-feature

  5. 打开拉取请求

Install Server
A
security – no known vulnerabilities
F
license - not found
-
quality - not tested

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Sheshiyer/git-mcp-v2'

If you have feedback or need assistance with the MCP directory API, please join our Discord server