Get the FREE Ultimate OpenClaw Setup Guide →

mcp -auto-commit

An mcp server that auto commits changes and creates commit message in the form of conventional commits (https://www.conventionalcommits.org/en/v1.0.0/)

Installation
Run this command in your terminal to add the MCP server to Claude Code.
Run in terminal:
Command
claude mcp add --transport stdio hypermodel-labs-mcp-server-auto-commit node ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js --key your-api-key \
  --env OPENAI_API_KEY="your-openai-api-key"

How to use

This MCP server analyzes changes in a Git repository and generates conventional commit messages using OpenAI's GPT models. It scans both staged and unstaged changes, categorizes modified, added, and deleted files, and provides a concise summary of changes along with a generated commit message that includes an auto-commit signature. The server exposes a single tool named git-changes-commit-message which you can invoke via MCP clients such as Cursor or Claude Desktop. The tool outputs a structured report including modified files, new files, deletions, and a formatted commit message that adheres to conventional commits standards. To use it, configure the MCP server in your MCP client, point it to the built server script, and provide your OpenAI API key either through an environment variable or via a --key argument when launching.

For Cursor: add a new MCP server with name git-auto-commit, type command, and command pointing to the built script using --key to pass the API key. For Claude Desktop: supply the same configuration so Claude can invoke the built script with the API key as needed. When invoked, the tool will analyze the repository (or a specified path) and return: a list of modified files with statuses, lists of added and deleted files, detailed changes (up to 10 lines per file), a generated conventional commit message, and an auto-commit signature appended to the message.

How to install

Prerequisites:

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

Install and run the MCP server locally:

  1. Clone the repository: git clone https://github.com/jatinsandilya/mcp-server-auto-commit.git cd mcp-server-auto-commit

  2. Install dependencies: pnpm install

  3. Set up your OpenAI API key (one of these methods):

    • Export as an environment variable: export OPENAI_API_KEY=your-api-key
    • Pass as a CLI argument when running the server: your-command --key your-api-key
    • Create a .env file in the project root with: OPENAI_API_KEY=your-api-key
  4. Build the project (generates /build/index.js): pnpm run build

  5. Run the server (example): node ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js --key your-api-key

  6. Integrate with your MCP client (Cursor or Claude Desktop) using the provided mcp_config example.

Additional notes

Tips and notes:

  • Ensure your OpenAI API key has access to the GPT-4o-mini model if required by the server configuration.
  • The tool analyzes both staged and unstaged changes by inspecting the repository state; provide a specific path via autoCommitPath if you want to limit scope.
  • The generated commit message follows conventional commits formatting and includes an auto-commit signature.
  • If you encounter path or permission issues, confirm ABSOLUTE_PATH_TO_MCP_SERVER/build/index.js is accessible and executable.
  • When using Claude Desktop, you can paste the MCP config JSON to register the server; ensure the command points to the built script and includes the key parameter if you’re not using env-based keys.
  • If you update the code, remember to rebuild to refresh /build/index.js before rerunning.

Related MCP Servers

Sponsor this space

Reach thousands of developers