MCP Server to Auto Commit Changes logo

MCP Server to Auto Commit Changes

by jatinsandilya

This implementation provides a Git changes analyzer that generates commit messages using OpenAI's GPT models. It helps automate the commit message creation process, saving time and ensuring consistency.

View on GitHub

Last updated: N/A

What is MCP Server to Auto Commit Changes?

This is an MCP server that analyzes Git changes in a repository and generates conventional commit messages using OpenAI's GPT-4o-mini model. It automates the process of creating commit messages by summarizing modified, added, and deleted files, along with detailed changes.

How to use MCP Server to Auto Commit Changes?

To use this server, clone the repository, install dependencies using pnpm, set up your OpenAI API key, and build the project. Then, configure your MCP client (Cursor or Claude Desktop) to use the compiled server script, providing the necessary command and arguments, including the OpenAI API key.

Key features of MCP Server to Auto Commit Changes

  • Analyzes git changes (staged and unstaged)

  • Generates conventional commit messages using GPT-4o-mini

  • Provides detailed summaries of modified, added, and deleted files

  • Includes detailed changes (up to 10 lines per file)

  • Adds an auto-commit signature to each commit

  • Built with @modelcontextprotocol/sdk

Use cases of MCP Server to Auto Commit Changes

  • Automating commit message generation for faster development workflows

  • Ensuring consistent commit message formatting across projects

  • Simplifying the commit process for developers

  • Improving the clarity and detail of commit messages

  • Integrating with MCP-compatible IDEs and platforms

FAQ from MCP Server to Auto Commit Changes

What is the default model used for generating commit messages?

The server uses OpenAI's GPT-4o-mini model by default.

How do I provide my OpenAI API key?

You can set it as an environment variable (OPENAI_API_KEY), pass it as a command line argument (--key your-api-key), or add it to a .env file in the project root.

What is the maximum number of lines of changes included per file?

The server includes a maximum of 10 lines of changes per file for readability.

What is the purpose of the auto-commit signature?

The auto-commit signature helps identify commits generated by the server.

Can I analyze changes in a specific directory or file?

Yes, you can use the autoCommitPath parameter to specify the directory or file to analyze.