Skip to main content
Glama

🔍 Git Daily Review

针对任意 Git 仓库的自动化每日 AI 代码审查——可用作 CLI、定时任务,或作为 AI 代理的 MCP 服务器。

Git Daily Review 会分析你在多个仓库中的每日提交,对照项目的约定与质量门禁进行检查,并生成结构化的 Markdown 报告。它内置了一个 MCP(Model Context Protocol)服务器,因此 Claude Code 和 Claude Desktop 等代理可以通过对话方式运行审查、读取报告,并维护项目知识库。

许可证:AGPL-3.0-only · Python 3.10+ 核心 · TypeScript MCP 服务器


亮点

  • 任意仓库、任意语言 —— AI 会适配你的技术栈(TypeScript、Python、Java、Go、Rust、C# 等)

  • 多仓库 —— 单次运行即可监控任意数量的仓库

  • MCP 服务器 —— 将审查、报告与知识库维护能力以代理工具的形式暴露出来

  • 多提供商 AI —— Anthropic Claude、OpenAI、Google Gemini,或通过 Ollama 使用任意本地模型(完全离线)

  • 自进化知识库 —— 7 层项目上下文,每次审查后都会学习,并配有代码强制执行的自动合并策略,以及针对高影响变更的人工审批

  • Markdown + HTML 输出 —— 每次运行都会生成 daily-summary.md 和自包含的 dashboard.html(质量趋势、门禁与按作者统计的图表、可筛选的提交列表,每个图表背后都有表格视图)。无 CDN、无网络请求:你的代码审查数据永远不会离开本机

  • RAG 就绪 —— 可选集成外部 RAG 服务以获取语义上下文

  • 跨平台调度 —— macOS(launchd)、Linux(cron)、Windows(任务计划程序);密钥保存在 .env 中,绝不会写入调度文件

  • 设置向导 —— 基于 Web 的配置,无需手动编辑 YAML


Related MCP server: MatterAI MCP Server

快速开始(CLI)

git clone https://github.com/YOUR_USER/git-daily-review.git
cd git-daily-review

# 0. Dependencies in a virtualenv (setup.py does this for you if you skip it)
python3 -m venv .venv
.venv/bin/pip install -r requirements.txt

# 1. Configure (opens the wizard in your browser)
python3 setup.py

# 2. Secrets (cloud providers only — Ollama needs none)
cp .env.example .env      # then add e.g. ANTHROPIC_API_KEY=...
chmod 600 .env

# 3. First review
python3 scripts/daily_review.py

# 4. Schedule daily runs
python3 scripts/scheduler.py --install

CLI 参考:

python3 scripts/daily_review.py                    # review today
python3 scripts/daily_review.py --date 2026-05-12  # specific date
python3 scripts/daily_review.py --days 5           # last N days
python3 scripts/daily_review.py --collect-only     # git data only, no AI
python3 scripts/daily_review.py --history          # report history index

python3 scripts/kb_manager.py --review             # interactive KB curation
python3 scripts/kb_manager.py --approve <ID>       # non-interactive approve
python3 scripts/kb_manager.py --reject  <ID>       # non-interactive reject
python3 scripts/kb_manager.py --stats

上面的 python3 可以是任意解释器:如果它缺少依赖,入口点会在项目 .venv(或 $GDR_PYTHON)下重新执行自身,并在没有该环境时提示你如何创建。这对 cron 和 launchd 很重要,因为那里的 python3 往往是裸的系统 Python。


MCP 服务器(作为代理使用)

mcp/ 目录包含一个包装了审查引擎的 TypeScript MCP 服务器。

cd mcp
npm install
npm run build

将其注册到 Claude Code

claude mcp add git-daily-review -- node /absolute/path/to/git-daily-review/mcp/dist/index.js

或者将其添加到 Claude Desktopclaude_desktop_config.json):

{
  "mcpServers": {
    "git-daily-review": {
      "command": "node",
      "args": ["/absolute/path/to/git-daily-review/mcp/dist/index.js"]
    }
  }
}

暴露的工具:

工具

功能

run_daily_review

运行今日、指定日期或最近 N 天的审查

get_report

读取某日期的完整 Markdown 报告

list_reports

列出可用报告 + 历史索引

list_kb_suggestions

列出知识库建议(按状态筛选)

decide_kb_suggestion

按 ID 批准/拒绝待处理的建议

kb_stats

知识库统计信息

然后你只需向代理提问,例如*“运行今日审查并总结关键问题”“显示待处理的知识库建议,并批准关于命名约定的那些”*

环境变量覆盖:GDR_ROOT(项目根目录,默认:仓库根目录)、GDR_PYTHON(Python 可执行文件;默认:项目 .venv(若存在),否则为 python3)。


AI 提供商

提供商

模型

API 密钥环境变量

备注

Anthropic

Claude Haiku、Sonnet、Opus

ANTHROPIC_API_KEY

OpenAI

GPT-4o-mini、GPT-4o、o1-mini

OPENAI_API_KEY

Google Gemini

Gemini 2.0 Flash、1.5 Flash/Pro

GEMINI_API_KEY

Ollama(本地)

任意已拉取的模型

(无)

完全离线;在配置中设置 num_ctx(默认 32768)以避免提示被截断

密钥存放在项目根目录的 .env 文件中(参见 .env.example),启动时自动加载。它们绝不会被写入 launchd plist、crontab 或批处理文件。


知识库(7 层)

config/knowledge-base.yaml 为审查器提供结构化的项目上下文:

L0 Identity · L1 Architecture · L2 Conventions · L3 Quality Gates
L4 Domain · L5 Integrations · L6 Release

每次运行后,系统会提取审查中浮现的新知识,并以建议的形式存储在 config/kb_suggestions/ 中。自动合并策略由代码强制执行(而非模型):只有置信度 ≥ 0.85 的新约定以及 info/warning 级别的门禁才能自动合并,每次运行最多 2 条。关键门禁、领域规则和集成始终需要人工审批——可通过交互方式(kb_manager.py --review)、CLI 标志或 MCP 的 decide_kb_suggestion 工具完成。

如需完全禁用学习功能,可在 config.yamlai: 部分设置 kb_learning: false


项目结构

git-daily-review/
├── setup.py                    ← setup wizard entry point
├── requirements.txt
├── .env.example                ← secrets template (never commit .env)
├── config/
│   ├── config.example.yaml
│   └── knowledge-base.example.yaml
├── scripts/                    ← Python core
│   ├── daily_review.py         ← orchestrator (loads .env at startup)
│   ├── git_collector.py        ← fetch, commits, diffs
│   ├── ai_reviewer.py          ← review pipeline
│   ├── ai_provider.py          ← Anthropic/OpenAI/Ollama/Gemini abstraction
│   ├── kb_updater.py           ← KB learning + code-enforced auto-merge policy
│   ├── kb_manager.py           ← KB curation CLI (interactive + --approve/--reject)
│   ├── rag_client.py           ← optional RAG client
│   ├── report_generator.py     ← Markdown reports + history index
│   ├── html_report.py          ← self-contained HTML dashboard (charts, filters)
│   ├── scheduler.py            ← launchd / cron / schtasks (no secrets on disk)
│   └── wizard_app.py           ← wizard HTTP backend
├── mcp/                        ← MCP server (TypeScript)
│   └── src/index.ts
├── templates/wizard.html
└── reports/                    ← generated daily reports (git-ignored)

路线图

  • 每日报告的 Slack/邮件通知

  • --ci 模式:发现关键问题时以非零退出码退出(PR 门禁)

  • 核心的完整 TypeScript 移植

  • 远程仓库支持(无需本地克隆即可审查)

欢迎贡献——请提交 issue 或 PR。


许可证

本项目采用 GNU Affero General Public License v3.0(AGPL-3.0-only)许可。如果你以网络服务的形式运行修改版本,必须向该服务的用户提供其源代码。参见 LICENSE

Maintenance

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/mrosano1987/git-daily-review'

If you have feedback or need assistance with the MCP directory API, please join our Discord server