Skip to main content
Glama

Git Auto Commit MCP Server

MCP サーバーによる変更の自動コミット 🛠️

この実装は、OpenAI の GPT モデルを使用してコミット メッセージを生成する Git 変更アナライザーを提供します。

デモ

特徴

  • リポジトリ内の Git の変更を分析します (ステージング済みと未ステージングの両方)
  • GPT-4o-miniを使用して従来のコミットメッセージを生成する
  • 以下の詳細な概要を提供します。
    • 📝 変更されたファイル
    • ✨ 新しく追加されたファイル
    • 🗑️ 削除されたファイル
    • 📄 詳細な変更内容(ファイルごとに最大10行)
  • @modelcontextprotocol/sdkで構築
  • 各コミットに自動コミット署名を追加します

プロジェクト構造

mcp-server-auto-commit/ ├── index.ts # Main server implementation with git analysis tool ├── package.json # Project dependencies ├── tsconfig.json # TypeScript configuration └── build/ # Compiled JavaScript output

前提条件

  • Node.jsがインストールされている
  • OpenAI APIキー
  • 分析するGitリポジトリ
  • pnpm パッケージマネージャー

はじめる

  1. このリポジトリをクローンします:
git clone https://github.com/jatinsandilya/mcp-server-auto-commit.git cd mcp-server-auto-commit
  1. 依存関係をインストールします:
pnpm install
  1. 次のいずれかの方法で OpenAI API キーを設定します。
    • 環境変数として設定: OPENAI_API_KEY=your-api-key
    • コマンドライン引数として渡す: --key your-api-key
    • プロジェクトルートの.envファイルに追加する
  2. プロジェクトをビルドします。
pnpm run build

これにより、コンパイルされた MCP サーバー スクリプトである/build/index.jsファイルが生成されます。

カーソルを使用する

  1. カーソル設定 -> MCP -> 新しいMCPサーバーの追加に移動します
  2. MCP を構成します。
    • 名前: git-auto-commit
    • タイプ: コマンド
    • コマンド: node ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js --key your-api-key (環境で設定されていない場合はyour-api-key実際の OpenAI API キーに置き換えてください)

Claude Desktopでの使用

次の MCP 構成を Claude Desktop 構成に追加します。

{ "mcpServers": { "git-auto-commit": { "command": "node", "args": ["ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js", "--key", "your-api-key"] } } }

利用可能なツール

git-changes-commit-message

このツールは、リポジトリ内の現在のGitの変更を分析し、OpenAIのGPT-4o-miniモデルを使用してコミットメッセージを生成します。以下の機能を提供します。

  • ステータスインジケーター付きの変更されたファイルのリスト
  • 新しく追加されたファイルのリスト
  • 削除されたファイルのリスト
  • 各ファイルの詳細な変更点(読みやすさを考慮して、ファイルごとに 10 行に制限されています)
  • 従来のコミット形式に従って生成されたコミットメッセージ
  • 自動コミット署名

使用パラメータ:

  • autoCommitPath : 特定のディレクトリ/ファイルを分析するためのオプションのパス。指定されていない場合は、現在の作業ディレクトリが使用されます。

発達

index.tsの実装は次のようになります。

  1. 適切な構成でMCPサーバーをセットアップする
  2. コマンドライン引数と環境変数の処理
  3. GPT-4o-mini モデルを使用して OpenAI の API と統合する
  4. 子プロセスを使用したGit操作
  5. エラー処理とフォールバックメカニズム
  6. 詳細な変更分析とフォーマット

実装を変更または拡張するには:

  1. index.ts内のサーバー構成を更新します。
const server = new McpServer({ name: "git-auto-commit", version: "0.0.1", });
  1. ツールは、Zod スキーマを使用した適切なパラメータ検証を伴うserver.tool()を使用して定義されます。
  2. 変更をビルドしてテストします。
pnpm run build

貢献

問題や機能強化のリクエストをお気軽にお寄せください。

ライセンス

マサチューセッツ工科大学

Install Server
A
security – no known vulnerabilities
A
license - permissive license
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 の変更を分析し、OpenAI の GPT モデルを使用して従来のコミット メッセージを生成し、ステージングされた変更とステージングされていない変更の両方を詳細な概要とともにサポートします。

  1. デモ
    1. 特徴
      1. プロジェクト構造
        1. 前提条件
          1. はじめる
            1. カーソルを使用する
              1. Claude Desktopでの使用
                1. 利用可能なツール
                  1. git-changes-commit-message
                2. 発達
                  1. 貢献
                    1. ライセンス

                      Related MCP Servers

                      • A
                        security
                        A
                        license
                        A
                        quality
                        A Model Context Protocol server for creating commit messages from git staged files.
                        Last updated -
                        2
                        1
                        TypeScript
                        MIT License
                      • A
                        security
                        F
                        license
                        A
                        quality
                        Generates comprehensive and formatted release notes from GitHub repositories, efficiently organizing commits by type and including detailed statistics using smart API usage.
                        Last updated -
                        3
                        2
                        TypeScript
                      • -
                        security
                        A
                        license
                        -
                        quality
                        A specialized MCP server for in-depth analysis of git repositories, offering tools for branch overview, time period analysis, file changes, and merge recommendations.
                        Last updated -
                        4
                        1
                        JavaScript
                        Apache 2.0
                      • A
                        security
                        F
                        license
                        A
                        quality
                        A Model Context Protocol server that automatically generates structured release notes from Git repository tags, analyzing differences between tags and saving formatted Markdown output to the .iris directory.
                        Last updated -
                        1
                        0
                        JavaScript

                      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/jatinsandilya/mcp-server-auto-commit'

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