VOOZH about

URL: https://glama.ai/mcp/servers/modelcontextprotocol/git?locale=ja-JP

⇱ git MCP サーバー by modelcontextprotocol | Glama


mcp-server-git: Git MCP サーバー

概要

Git リポジトリの操作と自動化のための Model Context Protocol サーバーです。このサーバーは、大規模言語モデル(LLM)を介して Git リポジトリを読み取り、検索し、操作するためのツールを提供します。

mcp-server-git は現在初期開発段階にあることにご注意ください。サーバーの開発と改善を継続する中で、機能や利用可能なツールは変更・拡張される可能性があります。

ツール

  1. git_status

    • ワーキングツリーの状態を表示します

    • 入力:

      • repo_path (string): Git リポジトリへのパス

    • 戻り値: ワーキングディレクトリの現在の状態をテキスト出力として返します

  2. git_diff_unstaged

    • ステージングされていないワーキングディレクトリの変更を表示します

    • 入力:

      • repo_path (string): Git リポジトリへのパス

      • context_lines (number, optional): 表示するコンテキスト行数 (デフォルト: 3)

    • 戻り値: ステージングされていない変更の diff 出力

  3. git_diff_staged

    • コミット用にステージングされた変更を表示します

    • 入力:

      • repo_path (string): Git リポジトリへのパス

      • context_lines (number, optional): 表示するコンテキスト行数 (デフォルト: 3)

    • 戻り値: ステージングされた変更の diff 出力

  4. git_diff

    • ブランチ間またはコミット間の差分を表示します

    • 入力:

      • repo_path (string): Git リポジトリへのパス

      • target (string): 比較対象のブランチまたはコミット

      • context_lines (number, optional): 表示するコンテキスト行数 (デフォルト: 3)

    • 戻り値: 現在の状態とターゲットを比較した diff 出力

  5. git_commit

    • リポジトリに変更を記録します

    • 入力:

      • repo_path (string): Git リポジトリへのパス

      • message (string): コミットメッセージ

    • 戻り値: 新しいコミットハッシュを含む確認メッセージ

  6. git_add

    • ファイルの内容をステージングエリアに追加します

    • 入力:

      • repo_path (string): Git リポジトリへのパス

      • files (string[]): ステージングするファイルパスの配列

    • 戻り値: ステージングされたファイルの確認

  7. git_reset

    • すべてのステージングされた変更をアンステージします

    • 入力:

      • repo_path (string): Git リポジトリへのパス

    • 戻り値: リセット操作の確認

  8. git_log

    • オプションの日付フィルタリングを使用してコミットログを表示します

    • 入力:

      • repo_path (string): Git リポジトリへのパス

      • max_count (number, optional): 表示するコミットの最大数 (デフォルト: 10)

      • start_timestamp (string, optional): コミットをフィルタリングするための開始タイムスタンプ。ISO 8601 形式 (例: '2024-01-15T14:30:25')、相対日付 (例: '2 weeks ago', 'yesterday')、または絶対日付 (例: '2024-01-15', 'Jan 15 2024') を受け付けます

      • end_timestamp (string, optional): コミットをフィルタリングするための終了タイムスタンプ。ISO 8601 形式 (例: '2024-01-15T14:30:25')、相対日付 (例: '2 weeks ago', 'yesterday')、または絶対日付 (例: '2024-01-15', 'Jan 15 2024') を受け付けます

    • 戻り値: ハッシュ、作成者、日付、メッセージを含むコミットエントリの配列

  9. git_create_branch

    • 新しいブランチを作成します

    • 入力:

      • repo_path (string): Git リポジトリへのパス

      • branch_name (string): 新しいブランチの名前

      • base_branch (string, optional): 作成元のベースブランチ (デフォルトは現在のブランチ)

    • 戻り値: ブランチ作成の確認

  10. git_checkout

  • ブランチを切り替えます

  • 入力:

    • repo_path (string): Git リポジトリへのパス

    • branch_name (string): チェックアウトするブランチの名前

  • 戻り値: ブランチ切り替えの確認

  1. git_show

  • コミットの内容を表示します

  • 入力:

    • repo_path (string): Git リポジトリへのパス

    • revision (string): 表示するリビジョン (コミットハッシュ、ブランチ名、タグ)

  • 戻り値: 指定されたコミットの内容

  1. git_branch

  • Git ブランチを一覧表示します

  • 入力:

    • repo_path (string): Git リポジトリへのパス

    • branch_type (string): ローカルブランチ ('local')、リモートブランチ ('remote')、またはすべてのブランチ ('all') のいずれを一覧表示するか

    • contains (string, optional): ブランチが含むべきコミット SHA。コミット SHA が指定されていない場合は、このパラメータに何も渡さないでください

    • not_contains (string, optional): ブランチが含むべきではないコミット SHA。コミット SHA が指定されていない場合は、このパラメータに何も渡さないでください

  • 戻り値: ブランチのリスト

Related MCP server: GitLab MCP Server

インストール

uv を使用する場合 (推奨)

uv を使用する場合、特別なインストールは不要です。uvx を使用して mcp-server-git を直接実行します。

PIP を使用する場合

あるいは、pip を介して mcp-server-git をインストールすることもできます:

pip install mcp-server-git

インストール後、スクリプトとして以下のように実行できます:

python -m mcp_server_git

設定

Claude Desktop での使用

claude_desktop_config.json に以下を追加してください:

"mcpServers": {
 "git": {
 "command": "uvx",
 "args": ["mcp-server-git", "--repository", "path/to/git/repo"]
 }
}
  • 注意: '/Users/username' をこのツールからアクセス可能にしたいパスに置き換えてください

"mcpServers": {
 "git": {
 "command": "docker",
 "args": ["run", "--rm", "-i", "--mount", "type=bind,src=/Users/username,dst=/Users/username", "mcp/git"]
 }
}
"mcpServers": {
 "git": {
 "command": "python",
 "args": ["-m", "mcp_server_git", "--repository", "path/to/git/repo"]
 }
}

VS Code での使用

クイックインストールには、以下のワンクリックインストールボタンのいずれかを使用してください...

👁 Install with UV in VS Code
👁 Install with UV in VS Code Insiders

👁 Install with Docker in VS Code
👁 Install with Docker in VS Code Insiders

手動インストールの場合、以下のいずれかの方法で MCP サーバーを設定できます:

方法 1: ユーザー設定 (推奨) ユーザーレベルの MCP 設定ファイルに設定を追加します。コマンドパレット (Ctrl + Shift + P) を開き、MCP: Open User Configuration を実行します。これによりユーザーの mcp.json ファイルが開かれ、そこにサーバー設定を追加できます。

方法 2: ワークスペース設定 あるいは、ワークスペース内の .vscode/mcp.json というファイルに設定を追加することもできます。これにより、他のユーザーと設定を共有できます。

VS Code での MCP 設定の詳細については、公式 VS Code MCP ドキュメントを参照してください。

{
 "servers": {
 "git": {
 "command": "uvx",
 "args": ["mcp-server-git"]
 }
 }
}

Docker インストールの場合:

{
 "mcp": {
 "servers": {
 "git": {
 "command": "docker",
 "args": [
 "run",
 "--rm",
 "-i",
 "--mount", "type=bind,src=${workspaceFolder},dst=/workspace",
 "mcp/git"
 ]
 }
 }
 }
}

Zed での使用

Zed の settings.json に追加してください:

"context_servers": [
 "mcp-server-git": {
 "command": {
 "path": "uvx",
 "args": ["mcp-server-git"]
 }
 }
],
"context_servers": {
 "mcp-server-git": {
 "command": {
 "path": "python",
 "args": ["-m", "mcp_server_git"]
 }
 }
},

Zencoder での使用

  1. Zencoder メニュー (...) に移動します

  2. ドロップダウンメニューから Agent Tools を選択します

  3. Add Custom MCP をクリックします

  4. 名前 (例: git) と以下のサーバー設定を追加し、必ず Install ボタンを押してください

{
 "command": "uvx",
 "args": ["mcp-server-git", "--repository", "path/to/git/repo"]
}

デバッグ

MCP インスペクターを使用してサーバーをデバッグできます。uvx インストールの場合は以下を使用します:

npx @modelcontextprotocol/inspector uvx mcp-server-git

または、パッケージを特定のディレクトリにインストールしている場合や、開発中の場合は以下を使用します:

cd path/to/servers/src/git
npx @modelcontextprotocol/inspector uv run mcp-server-git

tail -n 20 -f ~/Library/Logs/Claude/mcp*.log を実行するとサーバーからのログが表示され、問題のデバッグに役立つ場合があります。

開発

ローカル開発を行う場合、変更をテストする方法は2つあります:

  1. MCP インスペクターを実行して変更をテストします。実行手順については デバッグ を参照してください。

  2. Claude デスクトップアプリを使用してテストします。claude_desktop_config.json に以下を追加してください:

Docker

{
 "mcpServers": {
 "git": {
 "command": "docker",
 "args": [
 "run",
 "--rm",
 "-i",
 "--mount", "type=bind,src=/Users/username/Desktop,dst=/projects/Desktop",
 "--mount", "type=bind,src=/path/to/other/allowed/dir,dst=/projects/other/allowed/dir,ro",
 "--mount", "type=bind,src=/path/to/file.txt,dst=/projects/path/to/file.txt",
 "mcp/git"
 ]
 }
 }
}

UVX

{
"mcpServers": {
 "git": {
 "command": "uv",
 "args": [
 "--directory",
 "/<path to mcp-servers>/mcp-servers/src/git",
 "run",
 "mcp-server-git"
 ]
 }
 }
}

ビルド

Docker ビルド:

cd src/git
docker build -t mcp/git .

ライセンス

この MCP サーバーは MIT ライセンスの下でライセンスされています。これは、MIT ライセンスの条件に従う限り、ソフトウェアの使用、変更、配布が自由であることを意味します。詳細については、プロジェクトリポジトリ内の LICENSE ファイルを参照してください。

A
license - permissive license
B
quality
B
maintenance

Maintenance

Maintainers
18dResponse time
5wRelease cycle
7Releases (12mo)
Commit activity
Issues opened vs closed

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/modelcontextprotocol/git'

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