Skip to main content
Glama

Git MCP

by kjozsa

Git MCP

ローカル リポジトリでの Git 操作を管理するための MCP サーバー。

インストール

Smithery経由でインストール

Smithery経由で Claude Desktop 用の Git MCP を自動的にインストールするには:

npx -y @smithery/cli install @kjozsa/git-mcp --client claude

手動でインストールする

uvx install git-mcp

構成

次の JSON 構成スニペットを使用して MCP サーバーを追加します。

{ "mcpServers": { "git-mcp": { "command": "uvx", "args": ["git-mcp"], "env": { "GIT_REPOS_PATH": "/path/to/your/git/repositories" } } } }

機能と使用方法

環境変数

  • GIT_REPOS_PATH : Gitリポジトリを含むディレクトリへのパス(必須)

これを環境で設定するか、サーバーを実行するディレクトリに.envファイルを作成することができます。

利用可能な方法

リポジトリ一覧

設定されたパス内のすべての Git リポジトリを一覧表示します。

  • パラメータ: なし
  • 戻り値: リポジトリ名のリスト
最後のgitタグを取得する

指定されたリポジトリ内の最後の Git タグを検索します。

  • パラメータ: repo_name (Gitリポジトリの名前)
  • 戻り値: version (タグ名) とdate (タグ作成日) を含む辞書
最後のタグ以降のコミット一覧

最後の Git タグと HEAD 間のコミット メッセージを一覧表示します。

  • パラメータ:
    • repo_name : Gitリポジトリの名前
    • max_count (オプション): 返されるコミットの最大数
  • 戻り値: hashauthordatemessageを含む辞書のリスト
gitタグを作成する

指定されたリポジトリに新しい git タグを作成します。

  • パラメータ:
    • repo_name : Gitリポジトリの名前
    • tag_name : 作成するタグの名前
    • message (オプション):注釈付きタグのメッセージ(指定されていない場合は軽量タグを作成します)
  • 戻り値: statusversion (タグ名)、 date (タグ作成日)、 type (注釈付きまたは軽量) を含む辞書
プッシュ_git_tag

既存の git タグをデフォルトのリモート リポジトリにプッシュします。

  • パラメータ:
    • repo_name : Gitリポジトリの名前
    • tag_name : プッシュするタグの名前
  • 戻り値: statusremote (リモートの名前)、 tag (タグの名前)、 message (成功メッセージ) を含む辞書
リポジトリの更新

メイン ブランチ (またはフォールバックとしてのマスター) をチェックアウトし、すべてのリモートからプルしてリポジトリを更新します。

  • パラメータ:
    • repo_name : Gitリポジトリの名前
  • 戻り値: statusrepositorybranchpull_results (各リモートの結果)を含む辞書

トラブルシューティング

  • リポジトリが見つかりません: GIT_REPOS_PATHが正しく設定されており、リポジトリが存在することを確認してください
  • タグが見つかりません: リポジトリにはまだタグがありません

発達

# Install dependencies uv pip install -r requirements.txt # Run in dev mode with Inspector mcp dev git_mcp/server.py

テスト

このプロジェクトには 2 つのテスト スクリプトが含まれています。

  1. test_git_mcp.py - MCP サーバーを使用せずに、基礎となる Git コマンド機能を直接テストします。
  2. test_mcp_server.py - サーバー インスタンスを起動して呼び出しを行うことで、MCP サーバーの機能をテストします。

テストを実行するには:

# Test the Git command functionality python test_git_mcp.py # Test the MCP server (requires the git-mcp package to be installed) python test_mcp_server.py
Install Server
A
security – no known vulnerabilities
F
license - not found
A
quality - confirmed to work

local-only server

The server can only run on the client's local machine because it depends on local resources.

ローカル リポジトリでの Git 操作を管理するための MCP サーバー。ユーザーは、標準化されたインターフェースを通じてリポジトリの一覧表示、タグの取得と作成、コミットの一覧表示、タグのプッシュ、リポジトリの更新を行うことができます。

  1. インストール
    1. Smithery経由でインストール
    2. 手動でインストールする
  2. 構成
    1. 機能と使用方法
      1. 環境変数
      2. 利用可能な方法
      3. トラブルシューティング
    2. 発達
      1. テスト

        Related MCP Servers

        • A
          security
          F
          license
          A
          quality
          MCP Server for the GitHub API, providing features for file operations, repository management, and advanced search, with automatic branch creation and comprehensive error handling.
          Last updated -
          18
          1
          4
          TypeScript
          • Linux
          • Apple
        • A
          security
          F
          license
          A
          quality
          The Git MCP Server allows AI assistants to perform enhanced Git operations via the Model Context Protocol, supporting core Git functions, branch and tag management, GitHub integration, and more.
          Last updated -
          21
          42
          6
          TypeScript
        • -
          security
          A
          license
          -
          quality
          An MCP server that enables communication with GitLab repositories, allowing interaction with GitLab's API to manage projects, issues, and repositories through natural language.
          Last updated -
          3,716
          1
          JavaScript
          MIT License
        • A
          security
          F
          license
          A
          quality
          MCP server providing Git-related functionalities, primarily a tool to generate diffs for Git merge commits against their first parent.
          Last updated -
          2
          TypeScript

        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/kjozsa/git-mcp'

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