Git Worklog Mcp
About
一个 MCP (Model Context Protocol) 服务器,让 AI 从 Git 提交历史自动生成专业的工作日志。
Details
- Author
- CherishMvp
- Downloads
- 257
- Categories
- Developer Tools
Jump to
- AI understands code change semantics to generate valuable descriptions.
- Supports preset templates (daily, weekly, monthly) and custom template files.
- All tools use the unified worklog_ prefix for easy invocation.
- Supports Chinese (zh) and English (en) output.
- Zero-config startup via npx, no installation required.
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Git Worklog McpCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Add a configuration entry to your MCP client (such as Claude Desktop, Cursor, or VS Code) using either npx git-worklog-mcp or a globally installed command. Optionally pass parameters like --template, --lang, --author, or a custom template file. After configuration, ask the AI to call the worklog_get_data tool with a repository path and date range to generate a log.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"git worklog mcp": {
"git-worklog": {
"command": "npx",
"args": [
"git-worklog-mcp",
"--template",
"daily",
"--lang",
"zh"
]
}
}
}
}
McpServers
{
"git-worklog": {
"command": "npx",
"args": [
"git-worklog-mcp",
"--template",
"daily",
"--lang",
"zh"
]
}
}
git-worklog-mcp
一个 MCP (Model Context Protocol) 服务器,让 AI 从 Git 提交历史自动生成专业的工作日志。特性
- AI 智能分析 - AI 理解代码变更语义,生成有价值的工作描述 - 可配置模板 - 支持日报、周报、月报等预设模板,支持自定义模板文件 - 统一工具前缀 - 所有工具使用worklog_ 前缀,方便唤起
- 多语言支持 - 支持中文 (zh) 和英文 (en) 输出
- 零配置启动 - 通过 npx 直接运行,无需安装
---
快速开始
方式一:npx 直接使用(推荐)
无需安装,在 MCP 配置中直接使用 npx: ``json
{
"mcpServers": {
"git-worklog": {
"command": "npx",
"args": ["git-worklog-mcp"]
}
}
}
`
方式二:全局安装
`bash
npm install -g git-worklog-mcp
`
安装后配置:
`json
{
"mcpServers": {
"git-worklog": {
"command": "git-worklog-mcp"
}
}
}
`
---
MCP 配置文件位置
| 工具 | 配置文件路径 |
|------|-------------|
| Claude Desktop (macOS) | ~/Library/Application Support/Claude/claude_desktop_config.json |
| Claude Desktop (Windows) | %APPDATA%\Claude\claude_desktop_config.json |
| Cursor | ~/.cursor/mcp.json |
| VS Code | .vscode/mcp.json 或用户级 MCP 配置 |
---
配置选项详解
完整配置示例
`json
{
"mcpServers": {
"git-worklog": {
"command": "npx",
"args": [
"git-worklog-mcp",
"--template", "daily",
"--lang", "zh"
]
}
}
}
`
所有参数说明
| 参数 | 简写 | 环境变量 | 说明 | 可选值 | 默认值 |
|------|------|----------|------|--------|--------|
| --template | -t | WORKLOG_TEMPLATE | 预设模板名称 | daily, weekly, monthly, simple | daily |
| --template-file | -f | WORKLOG_TEMPLATE_FILE | 自定义模板文件的绝对或相对路径 | 任意 .md 文件路径 | - |
| --author | -a | WORKLOG_AUTHOR | 默认筛选的 Git 作者(可用名字或邮箱) | 字符串 | - |
| --lang | -l | WORKLOG_LANG | 输出语言,影响分类名称显示 | zh(中文), en(英文) | zh |
> 优先级: --template-file > --template(当指定模板文件时,预设模板参数被忽略)
---
配置示例
示例 1:最简配置(中文日报)
`json
{
"mcpServers": {
"git-worklog": {
"command": "npx",
"args": ["git-worklog-mcp"]
}
}
}
`
示例 2:周报模式
`json
{
"mcpServers": {
"git-worklog": {
"command": "npx",
"args": [
"git-worklog-mcp",
"--template", "weekly",
"--lang", "zh"
]
}
}
}
`
示例 3:指定作者 + 英文输出
`json
{
"mcpServers": {
"git-worklog": {
"command": "npx",
"args": [
"git-worklog-mcp",
"-t", "daily",
"-a", "your-name@example.com",
"-l", "en"
]
}
}
}
`
示例 4:使用自定义模板文件
`json
{
"mcpServers": {
"git-worklog": {
"command": "npx",
"args": [
"git-worklog-mcp",
"--template-file", "D:\\projects\\.worklog-template.md"
]
}
}
}
`
macOS/Linux 路径示例:
`json
{
"args": [
"git-worklog-mcp",
"-f", "/Users/yourname/projects/.worklog-template.md"
]
}
`
示例 5:使用环境变量配置
`json
{
"mcpServers": {
"git-worklog": {
"command": "npx",
"args": ["git-worklog-mcp"],
"env": {
"WORKLOG_TEMPLATE": "monthly",
"WORKLOG_AUTHOR": "cherish",
"WORKLOG_LANG": "zh"
}
}
}
}
`
---
可用工具
配置完成后,AI 可以调用以下工具(均以 worklog_ 为前缀):
| 工具名 | 说明 |
|--------|------|
| worklog_get_data | 核心工具 - 获取 Git 提交数据,返回结构化 JSON + 模板内容供 AI 生成日志 |
| worklog_get_diff | 获取指定提交的代码差异(diff),用于深入分析变更内容 |
| worklog_list_authors | 列出仓库的所有贡献者及其提交统计 |
| worklog_get_template | 获取当前配置的模板信息,查看可用模板列表 |
worklog_get_data 参数
| 参数 | 必填 | 类型 | 说明 | 示例 |
|------|------|------|------|------|
| repo_path | ✅ | string | Git 仓库路径 | "D:\\my-project" 或 "." |
| author | ❌ | string | 按作者筛选 | "your-name" |
| since | ❌ | string | 开始日期 | "yesterday", "1 week ago", "2024-01-01" |
| until | ❌ | string | 结束日期 | "today", "2024-01-31" |
| max_commits | ❌ | number | 最大提交数量 | 50(默认 100) |
---
使用方法
配置好 MCP 后,直接对 AI 说:
生成今日工作日志
`
请用 worklog_get_data 获取 D:\my-project 仓库今天的提交,按模板生成工作日志
`
生成本周周报
`
请获取 D:\my-project 仓库最近一周的 Git 提交,生成周报
`
生成指定作者的月报
`
请获取仓库 2024 年 1 月 cherish 的所有提交,生成月度工作报告
`
查看当前模板配置
`
请调用 worklog_get_template 查看当前使用的模板
`
---
预设模板
daily - 日报模板
按分类展示今日工作内容,适合每日汇报:
``markdownSign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.





