Navigation
MCP Server: Auto-Commit & Conventional Messages - MCP Implementation

MCP Server: Auto-Commit & Conventional Messages

MCP Server automates commits with conventional messages, keeping your codebase clean & compliant—no manual hassle. 🛠️

Developer Tools
4.5(64 reviews)
96 saves
44 comments

Users create an average of 42 projects per month with this tool

About MCP Server

What is MCP Server: Auto-Commit & Conventional Messages?

Meet the MCP Server Auto-Commit tool – your new productivity powerhouse for Git workflows! This AI-driven server leverages OpenAI’s GPT-4o-mini to automatically analyze your repository changes and craft clean, conventional commit messages. Whether you’re staging files or working in the wild west of unstaged edits, this tool generates professional commit messages faster than you can type “git add”.

How to use MCP Server: Auto-Commit & Conventional Messages?

  1. Clone the repo: git clone https://github.com/jatinsandilya/mcp-server-auto-commit
  2. Install dependencies with pnpm install
  3. Set your OpenAI API key (env var/command line/.env file)
  4. Build with pnpm run build
  5. Configure in Cursor/Claude Desktop with your built path

Watch the demo here to see it in action!

MCP Server Features

Key Features of MCP Server: Auto-Commit & Conventional Messages

  • Smart analysis: Detects modified (📝), added (✨), and deleted (🗑️) files across all states
  • AI-generated messages: GPT-powered conventional commit formatting ensures compliance
  • Change snapshots: Summarizes top 10 lines of changes per file for instant context
  • Seamless integration: Built with the Model Context Protocol SDK for smooth agent workflows
  • Auto-signature: Adds standardized commit metadata for traceability

Use Cases of MCP Server: Auto-Commit & Conventional Messages

Perfect for:

  • Developers wanting to maintain commit standards without manual effort
  • Teams enforcing conventional commits across large repositories
  • Automating CI/CD pipelines with smart commit generation
  • Rapid prototyping where you want to capture intent without breaking flow
  • Legacy code maintenance needing clear commit histories

MCP Server FAQ

FAQ from MCP Server: Auto-Commit & Conventional Messages

Does it work with unstaged changes?

Absolutely! Analyzes both staged and unstaged files for comprehensive tracking

What if my files are too big?

Automatically truncates to 10 lines per file to keep summaries readable

Can I customize the commit format?

While the conventional format is fixed, you can fork the repo to adjust GPT prompts

Do I need a specific Git setup?

Works with standard repositories but requires OpenAI API access and pnpm

Content

MCP Server to Auto commit changes 🛠️

This implementation provides a Git changes analyzer that generates commit messages using OpenAI's GPT models.

Git Auto Commit Server MCP server

Demo

Features

  • Analyzes git changes in your repository (both staged and unstaged)
  • Generates conventional commit messages using GPT-4o-mini
  • Provides detailed summaries of:
    • 📝 Modified files
    • ✨ Newly added files
    • 🗑️ Deleted files
    • 📄 Detailed changes (up to 10 lines per file)
  • Built with @modelcontextprotocol/sdk
  • Adds an auto-commit signature to each commit

Project Structure

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

Prerequisites

  • Node.js installed
  • OpenAI API key
  • Git repository to analyze
  • pnpm package manager

Getting Started

  1. Clone this repository:
git clone https://github.com/jatinsandilya/mcp-server-auto-commit.git
cd mcp-server-auto-commit
  1. Install dependencies:
pnpm install
  1. Set up your OpenAI API key using one of these methods:
* Set as an environment variable: `OPENAI_API_KEY=your-api-key`
* Pass as a command line argument: `--key your-api-key`
* Add to a `.env` file in the project root
  1. Build the project:
pnpm run build

This will generate the /build/index.js file - your compiled MCP server script.

Using with Cursor

  1. Go to Cursor Settings -> MCP -> Add new MCP server
  2. Configure your MCP:
    * Name: git-auto-commit
    * Type: command
    * Command: node ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js --key your-api-key (Replace your-api-key with your actual OpenAI API key if not set in environment)

Using with Claude Desktop

Add the following MCP config to your Claude Desktop configuration:

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

Available Tools

git-changes-commit-message

This tool analyzes the current git changes in your repository and generates a commit message using OpenAI's GPT-4o-mini model. It provides:

  • List of modified files with status indicators
  • List of newly added files
  • List of deleted files
  • Detailed changes for each file (limited to 10 lines per file for readability)
  • A generated commit message following conventional commits format
  • An auto-commit signature

Usage parameters:

  • autoCommitPath: Optional path to analyze specific directory/file. If not provided, uses current working directory.

Development

The implementation in index.ts showcases:

  1. Setting up the MCP server with proper configuration
  2. Handling command line arguments and environment variables
  3. Integrating with OpenAI's API using GPT-4o-mini model
  4. Git operations using child processes
  5. Error handling and fallback mechanisms
  6. Detailed change analysis and formatting

To modify or extend the implementation:

  1. Update the server configuration in index.ts:
const server = new McpServer({
  name: "git-auto-commit",
  version: "0.0.1",
});
  1. The tool is defined using server.tool() with proper parameter validation using Zod schema.

  2. Build and test your changes:

pnpm run build

Contributing

Feel free to submit issues and enhancement requests!

License

MIT

Related MCP Servers & Clients