GG

geropl/git-mcp-go

Developer tools

Эта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал

37 stars 11 forks Качество 48 Тренд 0

geropl/git-mcp-go - кандидат на сервер MCP, импортированный из https://github.com/geropl/git-mcp-go.

Обзор

geropl/git-mcp-go - кандидат на сервер MCP, импортированный из https://github.com/geropl/git-mcp-go.

Обзор (машинный перевод)

Сервер Model Context Protocol (MCP) для взаимодействия и автоматизации репозитория Git, написанный на Go. Этот сервер предоставляет инструменты для чтения, поиска и управления репозиториями Git с помощью моделей большого языка.

Особенности

Этот MCP-сервер предоставляет следующие операции Git в качестве инструментов:

git status: Показывает статус рабочего дерева git diff unstaged: Показывает изменения в рабочем каталоге, которые еще не инсценированы git diff staged: Показывает изменения, которые инсценированы для совершения git diff: Показывает различия между ветвями или фиксирует git commit: Изменения записей в репозитории git add: добавляет содержимое файла в область постановки git reset: Удаление всех поэтапных изменений git log: Показать все записи git create ranch: Создает новую ветвь из дополнительной базовой ветви git checkout: Ветви коммутаторов git show: Показывает содержание обязательства git init: инициировать создание нового репозитория Git

  • git push: Pushes local передает данные в удаленный репозиторий (требуется флаг) git list repositories: Список всех доступных репозиториев Git

##Установка

Предпосылки

1,18 или выше

  • Git установлен в вашей системе

Эта страница переведена автоматически. Технические детали смотрите в оригинале.

README

Показан фрагмент оригинального README. Открыть оригинал.

Git MCP Server (Go)

A Model Context Protocol (MCP) server for Git repository interaction and automation, written in Go. This server provides tools to read, search, and manipulate Git repositories via Large Language Models.

Features

This MCP server provides the following Git operations as tools:

  • git_status: Shows the working tree status
  • git_diff_unstaged: Shows changes in the working directory that are not yet staged
  • git_diff_staged: Shows changes that are staged for commit
  • git_diff: Shows differences between branches or commits
  • git_commit: Records changes to the repository
  • git_add: Adds file contents to the staging area
  • git_reset: Unstages all staged changes
  • git_log: Shows the commit logs
  • git_create_branch: Creates a new branch from an optional base branch
  • git_checkout: Switches branches
  • git_show: Shows the contents of a commit
  • git_init: Initialize a new Git repository
  • git_push: Pushes local commits to a remote repository (requires --write-access flag)
  • git_list_repositories: Lists all available Git repositories

Installation

Prerequisites

  • Go 1.18 or higher
  • Git installed on your system

Download Prebuilt Binaries

You can download prebuilt binaries for your platform from the GitHub Releases page.

Building from Source

# Clone the repository
git clone https://github.com/geropl/git-mcp-go.git
cd git-mcp-go

# Build the server
go build -o git-mcp-go .

Install with go install

go install github.com/geropl/git-mcp-go@latest

Usage

Command Line Structure

The Git MCP Server uses a command-line structure with subcommands:

git-mcp-go
├── serve [flags] [repository-paths...]
│   ├── --repository, -r                   # Repository paths (multiple ways to specify)
│   ├── --mode 
│   ├── --write-access
│   └── --verbose, -v
└── setup [flags] [repository-paths...]
    ├── --repository, -r                   # Repository paths (multiple ways to specify)
    ├── --mode 
    ├── --write-access
    ├── --auto-approve 
    └── --tool 

Multi-Repository Support

The Git MCP Server can now monitor and operate on multiple repositories simultaneously. You can specify repositories in several ways:

  1. Using the -r/--repository flag:
    • With comma-separated paths: -r=/path/to/repo1,/path/to/repo2
    • With multiple flag instances: -r=/path/to/repo1 -r=/path/to/repo2
  2. As positional arguments: serve /path/to/repo1 /path/to/repo2
  3. A combination of both approaches

When using multiple repositories, the server will default to the first repository for operations where a specific repository is not specified.

serve Command

The serve command starts the Git MCP server:

# Run with verbose logging
Открыть полный README на GitHub

Установка

This server does not publish a one-line install command.

Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →

Конфигурация

"mcpServers": { "git": { "command": "/path/to/git-mcp-go", "args": ["serve", "-r=/path/to/repo1,/path/to/repo2", "--mode", "shell"] } }