mcpField
U
udacity-commit

udacity-commit

本地服务
github.com/qwertymuzaffar版本控制07 周前更新

关于 udacity-commit

udacity-commit 是用于按 Udacity Git Commit Message Style Guide 检查和格式化 Git 提交信息的 MCP 服务。它还提供配套分支命名规则的检查与说明资源。

主要功能

  1. 01检查提交信息是否符合规范
  2. 02生成格式规范的提交信息
  3. 03校验分支名称
  4. 04提供提交与分支规则资源

适用场景

  1. 01提交前检查提交信息格式
  2. 02根据类型和主题生成提交信息
  3. 03验证功能分支命名

MCP 相关

该 MCP 服务向客户端提供提交信息校验、格式化和分支名称校验工具,并公开提交与分支命名规则资源。

配置

本地服务的配置在各客户端中通用,复制后粘贴到客户端的 MCP 配置文件即可。

mcp.json · 通用配置
{
"mcpServers": {
"qwertymuzaffar-udacity-commit": {
"command": "npx",
"args": [
"-y",
"mcp-udacity-commit"
]
}
}
}
启动命令npx -y mcp-udacity-commit

本地服务需要在你的电脑上安装运行环境(如 Node.js 18+)。各客户端的配置文件位置不同,请参考客户端文档。

安装包
npmmcp-udacity-commit1.2.2

工具

3

收录的工具列表 · 更新于 2 周前

参数类型必填说明
messagestring是要检查的完整提交消息

详细介绍

mcp-udacity-commit

npm version npm downloads License: MIT MCP

一个 MCP 服务,可根据 Udacity Git 提交消息风格指南验证并格式化 Git 提交消息。

安装

只需一行——将其粘贴到终端中:

claude mcp add udacity-commit -- npx -y mcp-udacity-commit

对于 Claude Desktop,请添加到 claude_desktop_config.json:

{
  "mcpServers": {
    "udacity-commit": {
      "command": "npx",
      "args": ["-y", "mcp-udacity-commit"]
    }
  }
}
从源代码安装
git clone https://github.com/qwertymuzaffar/mcp-udacity-commit
cd mcp-udacity-commit
npm install
npm run build
claude mcp add udacity-commit -- node "$(pwd)/build/index.js"

提供的功能

原语名称用途
资源udacity://commit-styleguide以 Markdown 格式提供风格指南规则
资源udacity://branch-naming以 Markdown 格式提供配套的 type/kebab-case 分支命名规则
工具validate_commit_message检查消息是否符合所有规则(类型、主题不超过 50 个字符、首字母大写、不以句号结尾、空行、正文每行不超过 72 个字符)
工具format_commit_message根据 type、subject 以及可选的 body/footer 构建合规消息
工具validate_branch_name检查分支名称是否符合配套的 type/kebab-case 约定(例如 feat/add-dark-mode);release/* 是带有版本格式描述的类型化分支(release/1.2.0),而 main 等基础分支不受此规则约束

示例

format_commit_message 会将零散内容转换为合规的提交消息:

in:  type=fix  subject="prevent duplicate auth token refresh."
     body="The refresh timer could fire twice under load, minting two tokens…"
     footer="Resolves: #142"

out:
fix: Prevent duplicate auth token refresh

The refresh timer could fire twice under load, minting two tokens and
logging the user out. Serialize refreshes behind a single in-flight
promise so concurrent callers await the same request.

Resolves: #142

validate_commit_message 会标记所有违规项:

"Fixed the login bug."  →  ❌ Not compliant.
  • Subject must follow "type: Subject".
  • Subject must not end with a period.

validate_branch_name 会强制执行配套的 type/kebab-case 约定:

"feat/add-dark-mode"     →  ✅ Compliant branch name.
"release/1.2.0"          →  ✅ Compliant branch name.
"Feature/Add_Dark_Mode"  →  ❌ Not compliant.
  • Unknown type "Feature". Use one of: feat, fix, docs, style, refactor, test, chore, release.
  • Description must be lowercase kebab-case. Got: "Add_Dark_Mode".
"main"                   →  ✅ (base branch — feature-branch rules don't apply)

开发

npm install
npm run build          # → build/index.js
npm run test:client    # spawns the server and exercises the tools

许可证

MIT

评论

支持 Markdown

第一次接触 MCP?

从协议是什么,到在客户端里装上第一个服务,这几条回答覆盖了大多数入门问题。

一个开放协议,规定了 AI 应用如何以统一方式连接外部工具与数据源。客户端负责与模型对话,MCP 服务负责提供工具、资源和提示模板,两者通过标准消息通信,同一个服务可以被不同客户端复用。