
geropl/git-mcp-go
Developer toolsこのページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る
geropl/git-mcp-go は [https://github.com/geropl/git-mcp-go.] からインポートされた MCP サーバー候補です
概要
geropl/git-mcp-go は [https://github.com/geropl/git-mcp-go.] からインポートされた MCP サーバー候補です
概要(AI 翻訳)
Gitリポジトリの相互作用と自動化のためのモデルコンテキストプロトコル(MCP)サーバー、Goで書かれています。 このサーバーは、大規模なランゲージモデルを使用して、Gitリポジトリを読み込み、検索、操作するためのツールを提供します。
##特徴
この MCP サーバーでは、以下の Git 操作をツールとして提供しています。
- git status: 作業ツリーの状態を表示
- git diff unstaged: まだステージされていない作業ディレクトリの変更を表示
- git diff staged: コミットのためにステージされた変更を表示
- git diff: ブランチやコミットの違いを示す
- git commit: レコードがリポジトリに変化する
- git add: ステージングエリアにファイルコンテンツを追加
- git reset: すべての段階的な変更をステージ無しにして下さい
- git log: コミットログを表示
- git create branch: オプションのベースブランチから新しいブランチを作成します。
- git checkout: 枝を切る
- git show: コミットの内容を表示
- git init:新しいGitリポジトリを初期化
- git push: ローカルコミットをリモートリポジトリ([
--write-access]フラグ)にプッシュする - git list repositories: 利用可能なすべてのGitリポジトリを一覧表示
インストール
前提条件
- 1.18以上
- システムにインストールされたGit
このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。
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-accessflag) - 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:
- Using the
-r/--repositoryflag:- With comma-separated paths:
-r=/path/to/repo1,/path/to/repo2 - With multiple flag instances:
-r=/path/to/repo1 -r=/path/to/repo2
- With comma-separated paths:
- As positional arguments:
serve /path/to/repo1 /path/to/repo2 - 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
インストール
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"]
}
}