Skip to main content
Glama

Git MCP Server

by Sheshiyer

Git MCP 服务器

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

特征

  • 核心 Git 操作:初始化、克隆、状态、添加、提交、推送、拉取
  • 分支管理:列出、创建、删除、结帐
  • 标签操作:列出、创建、删除
  • 远程管理:列出、添加、删除
  • 存储操作:列出、保存、弹出
  • 批量操作:按顺序执行多个 Git 操作
  • GitHub 集成:通过个人访问令牌内置 GitHub 支持
  • 路径解析:具有可选默认路径配置的智能路径处理
  • 错误处理:使用自定义错误类型进行全面的错误处理
  • 存储库缓存:高效的存储库状态管理
  • 性能监控:内置性能跟踪

安装

  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. 打开拉取请求

You must be authenticated.

A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

hybrid server

The server is able to function both locally and remotely, depending on the configuration or use case.

Git MCP 服务器允许 AI 助手通过模型上下文协议执行增强的 Git 操作,支持核心 Git 功能、分支和标签管理、GitHub 集成等。

  1. 特征
    1. 安装
      1. 配置
        1. 环境变量
          1. 可用工具
            1. 基本操作
            2. 分支机构运营
            3. 标签操作
            4. 远程操作
            5. 存储操作
            6. 批量操作
          2. 发展
            1. 执照
              1. 贡献

                Related MCP Servers

                • A
                  security
                  F
                  license
                  A
                  quality
                  MCP server for managing Git operations on local repositories, allowing users to list repositories, get and create tags, list commits, push tags, and refresh repositories through a standardized interface.
                  Last updated -
                  6
                  Python
                • A
                  security
                  F
                  license
                  A
                  quality
                  An MCP server that enables AI assistants to manage GitHub Actions workflows by providing tools for listing, viewing, triggering, canceling, and rerunning workflows through the GitHub API.
                  Last updated -
                  9
                  32
                  TypeScript
                  • Linux
                  • Apple
                • -
                  security
                  A
                  license
                  -
                  quality
                  An MCP server that enables AI assistants like Claude to help users manage their GitHub notifications through natural language commands.
                  Last updated -
                  55
                  11
                  TypeScript
                  MIT License
                • -
                  security
                  A
                  license
                  -
                  quality
                  An MCP server that analyzes codebases and generates contextual prompts, making it easier for AI assistants to understand and work with code repositories.
                  Last updated -
                  10
                  Python
                  MIT License

                View all related MCP servers

                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