Cover image
Try Now
2025-03-18

自动提交更改并以传统提交形式创建提交消息的MCP服务器(https://www.conventionalcommits.org/en/v1.0/)

3 years

Works with Finder

1

Github Watches

3

Github Forks

13

Github Stars

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
  2. 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

相关推荐

  • NiKole Maxwell
  • I craft unique cereal names, stories, and ridiculously cute Cereal Baby images.

  • Bora Yalcin
  • Evaluator for marketplace product descriptions, checks for relevancy and keyword stuffing.

  • Joshua Armstrong
  • Confidential guide on numerology and astrology, based of GG33 Public information

  • https://suefel.com
  • Latest advice and best practices for custom GPT development.

  • Callycode Limited
  • A geek-themed horoscope generator blending Bitcoin prices, tech jargon, and astrological whimsy.

  • Alexandru Strujac
  • Efficient thumbnail creator for YouTube videos

  • Emmet Halm
  • Converts Figma frames into front-end code for various mobile frameworks.

  • Khalid kalib
  • Write professional emails

  • Beniyam Berhanu
  • Therapist adept at identifying core issues and offering practical advice with images.

  • Elijah Ng Shi Yi
  • Advanced software engineer GPT that excels through nailing the basics.

  • apappascs
  • 发现市场上最全面,最新的MCP服务器集合。该存储库充当集中式枢纽,提供了广泛的开源和专有MCP服务器目录,并提供功能,文档链接和贡献者。

  • ShrimpingIt
  • MCP系列GPIO Expander的基于Micropython I2C的操作,源自ADAFRUIT_MCP230XX

  • OffchainLabs
  • 进行以太坊的实施

  • huahuayu
  • 统一的API网关,用于将多个Etherscan样区块链Explorer API与对AI助手的模型上下文协议(MCP)支持。

  • deemkeen
  • 用电源组合控制您的MBOT2:MQTT+MCP+LLM

    Reviews

    4 (1)
    Avatar
    user_8U4Bvxis
    2025-04-15

    The Shell Command MCP Server by kaznak is a fantastic tool for managing server commands efficaciously. It offers seamless integration and an intuitive interface, making complex command executions simple and efficient. Highly recommended for anyone looking to streamline their server management! Check out more here: https://mcp.so/server/shell-command-mcp/kaznak