npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

git-commit-mcp

v0.1.16

Published

MCP server for standardizing Git commit messages

Downloads

63

Readme

Git Commit MCP

一个基于 Model Context Protocol (MCP) 的智能 Git 提交工具,能够自动分析代码变更并生成符合项目风格的提交信息。

功能特性

  • 🔍 智能代码变更分析 - 自动分析 Git 仓库的变更状态和差异内容
  • 📝 智能提交信息生成 - 基于历史提交风格生成符合项目规范的提交信息
  • 🎯 个性化风格适配 - 优先分析当前用户的提交历史,自动适配个人提交风格
  • 📏 长度智能控制 - 根据历史提交长度提供参考建议,不强制截断
  • 🏷️ 多种提交格式支持 - 支持前缀格式 [FEAT] 和标准格式 feat: 的自动识别
  • 一键暂存提交 - 支持文件暂存和自动提交的完整工作流

安装使用

作为 MCP 服务器运行

npx git-commit-mcp

在 Claude Desktop 中配置

在 Claude Desktop 的配置文件中添加:

{
  "mcpServers": {
    "git-commit-mcp": {
      "command": "npx",
      "args": ["git-commit-mcp"]
    }
  }
}

工具说明

1. analyze_git_changes

分析当前 Git 仓库的变更状态,包括:

  • 文件变更状态(已暂存、已修改、新增、删除等)
  • 代码差异内容
  • 历史提交风格分析

参数:

  • projectPath (可选): 项目路径,默认为当前目录

返回信息:

  • 仓库状态和变更文件列表
  • 代码差异详情
  • 提交风格分析结果(平均长度、格式偏好等)

2. generate_commit_message

基于代码变更和历史风格生成智能提交信息。

参数:

  • projectPath (可选): 项目路径,默认为当前目录
  • commitDescription (必需): 基于代码变更的提交描述
  • commitType (可选): 提交类型,支持 feat、fix、docs、style、refactor、perf、test、build、ci、chore、revert、update

智能特性:

  • 自动识别用户偏好的提交格式(前缀格式 vs 标准格式)
  • 根据历史平均长度提供长度参考
  • 自动添加日期标识(如果历史中有此习惯)
  • 提供长度对比分析但不强制截断

3. stage_and_commit

执行文件暂存和提交操作的完整工作流。

参数:

  • projectPath (可选): 项目路径,默认为当前目录
  • files (可选): 要暂存的特定文件列表,不指定则暂存所有修改文件
  • commitMessage (可选): 完整的提交信息
  • commitType (可选): 提交类型
  • customMessage (可选): 自定义提交信息
  • autoCommit (可选): 是否在暂存后自动提交,默认为 false

智能特性:

  • 根据历史风格自动选择提交格式
  • 为所有提交信息提供长度分析
  • 支持灵活的文件暂存策略

提交类型支持

| 类型 | 前缀格式 | 说明 | |------|----------|------| | feat | FEAT | 新功能:添加新特性或功能 | | fix | FIX | 修复:解决bug或问题 | | docs | DOCS | 文档:更新文档或注释 | | style | STYLE | 样式:代码格式调整,不影响功能 | | refactor | REFACTOR | 重构:代码重构,不新增功能也不修复bug | | perf | PERF | 性能:性能优化相关更改 | | test | TEST | 测试:添加或修改测试用例 | | build | BUILD | 构建:影响构建系统或外部依赖的更改 | | ci | CI | 持续集成:CI配置文件和脚本的更改 | | chore | CHORE | 杂务:不修改源代码或测试的其他更改 | | revert | REVERT | 回滚:撤销之前的提交 | | update | UPDATE | 更新:更新现有功能或依赖 |

智能风格分析

工具会自动分析您的提交历史,包括:

  1. 用户偏好优先 - 优先分析当前用户的提交记录
  2. 长度分析 - 计算历史提交的平均长度作为参考
  3. 格式识别 - 自动识别是否使用前缀格式(如 [FEAT]
  4. 类型偏好 - 分析最常用的提交类型
  5. 描述风格 - 识别简洁型还是详细型描述风格

使用示例

基本工作流

  1. 分析变更
# 通过 MCP 调用
analyze_git_changes()
  1. 生成提交信息
# 基于分析结果生成提交信息
generate_commit_message({
  "commitDescription": "添加用户登录功能",
  "commitType": "feat"
})
  1. 暂存并提交
# 暂存所有文件并提交
stage_and_commit({
  "customMessage": "添加用户登录功能",
  "commitType": "feat",
  "autoCommit": true
})

技术特性

  • 🚀 零配置 - 开箱即用,自动适配项目风格
  • 🧠 智能分析 - 基于机器学习的提交风格识别
  • 🔄 增量优化 - 随着使用不断优化提交建议
  • 📊 详细反馈 - 提供完整的分析和建议信息
  • 🛡️ 安全可靠 - 不会强制修改或截断用户内容

版本信息

当前版本:0.1.16

许可证

MIT License

贡献

欢迎提交 Issue 和 Pull Request 来改进这个工具!