build-quality-mcp
Enables Claude-powered pre-push code review, blocking bad commits by analyzing diffs with Anthropic's models.
README
build-quality-agent
English | 中文
Claude-powered git pre-push reviewer for indie OSS projects. Stops the bad commit before it costs you a Vercel build minute.
Built by Alex Ji — solo founder shipping VibeXForge and Orallexa. Born from this thought:
I just spent $131.92 in Vercel build minutes this month because I keep pushing commits with type errors and missing imports.
What it does
Before every git push, it runs Claude over the diff and decides:
- PASS — push proceeds
- BLOCK — push is aborted, you fix the issue locally
That's the whole pitch. No CI loop. No remote build that fails 6 minutes in. Catches the obvious stuff (type errors, removed imports, hardcoded secrets, reverted auth checks) before your laptop fan even spins up.
--build flag (v0.3+) — also run the actual build
--build runs the project's local build before review (auto-detects: npm/pnpm/bun/yarn run build for JS, python -m build, cargo check, go build). If the build fails, the build log is appended to the Claude prompt for a unified explanation, and the push is always BLOCKed.
build-quality-agent --build # one-off
BUILD_AGENT_BUILD=1 git push # default for this push
The 4-minute build cap is generous; most local builds for indie projects are 30-90s. Combined cost of --build + diff review: ~$0.0006 + ~30-60s of laptop time, vs ~$0.12/min × 6min = $0.72 saved per build that would have failed remotely.
Install
# 1. Clone
git clone https://github.com/alex-jb/build-quality-agent.git
cd build-quality-agent
pip install -e .
# 2. Set your Anthropic key (graceful no-op without it)
export ANTHROPIC_API_KEY=sk-ant-...
# 3. Wire into a target repo
cd ~/path/to/your/repo
bash ~/Desktop/build-quality-agent/scripts/install-hook.sh
That's it. Next git push will trigger a review.
Bypass
If the agent is wrong (it sometimes is — Claude reviews a diff, not a full repo, so context-free changes occasionally trip it):
BUILD_AGENT_SKIP=1 git push
This is the explicit, loud bypass. --no-verify also works but is silent. We prefer loud.
Usage examples
# Manual run on the most recent commit
python3 -m build_quality_agent --diff-range HEAD~1..HEAD
# Review without blocking (advisory mode)
python3 -m build_quality_agent --no-block
# Quiet unless something's wrong
python3 -m build_quality_agent --quiet
# Force a specific model
BUILD_AGENT_MODEL=claude-sonnet-4-6 python3 -m build_quality_agent
# Token + cost report (aggregates ~/.build-quality-agent/usage.jsonl)
python3 -m build_quality_agent --usage
Design choices
- Default Haiku 4.5, not Sonnet. Diff review is a fast cheap task — Haiku gets ~10s response and pennies per push. Sonnet only kicks in if you set
BUILD_AGENT_MODEL. - PASS by default on any internal failure. Network down, key missing, Claude flake — the agent prints a warning and lets the push through. Better unverified push than blocking real work.
- 50kB diff cap, junk paths excluded. Lockfiles (
package-lock.json,bun.lock, etc.), generated types (next-env.d.ts), build output (.next/,dist/), and binary assets (images, fonts, MP4s) are stripped before review so the budget gets spent on real source. - Vercel-aware prompt. The agent specifically looks for the patterns that crash Next.js / Vercel builds: missing
default exportonpage.tsx/layout.tsx, client hooks without"use client", server-only imports leaking into client components, undefined symbols, hardcoded secrets. - Reads git's pre-push stdin. When invoked as a hook, the agent parses the
<local_ref> <local_oid> <remote_ref> <remote_oid>lines git passes in. That makes the review range exactly match what's being pushed — including new branches without upstream tracking. - No build runner inside the hook. Running
npm run buildin pre-push would add 5-6 min to every push. Out of scope here. This agent reviews intent + obvious bugs; a separate CI build still catches everything.
Cost tracking
Every review writes a row to ~/.build-quality-agent/usage.jsonl. Run python3 -m build_quality_agent --usage to see total runs, pass/block split, token counts, and an estimated dollar cost (Haiku 4.5: $1/MTok in, $5/MTok out).
Roadmap
- [x] v0.1 — Pre-push hook · Claude diff review · graceful degradation
- [x] v0.2 —
pip install -e .portability · git stdin parsing · junk-path filter · Vercel-aware prompt · pytest suite ·--usagecost report - [ ] v0.3 — Project-specific rule files (
.build-quality-agent.toml) - [ ] v0.4 —
--buildflag for projects that want the slow runtime build - [ ] v0.5 — Auto-suggested fix (Claude proposes the smallest patch that would PASS)
MCP server (Claude Desktop / Cursor / Zed)
Review a diff inline from your AI assistant.
pip install 'build-quality-agent[mcp]'
Then in ~/Library/Application Support/Claude/claude_desktop_config.json:
{
"mcpServers": {
"build-quality": {
"command": "build-quality-mcp",
"env": { "ANTHROPIC_API_KEY": "..." }
}
}
}
Tools: review_diff(diff) · review_range(diff_range) · usage_summary()
License
MIT.
🧩 Part of the Solo Founder OS stack
A growing collection of MIT-licensed agents that share solo-founder-os as their base — cron, eval, reflexion, AnthropicClient, HITL queue, notifiers. Each agent is independently useful; together they cover the full one-person company workflow.
🌐 The whole stack is live in production at vibexforge.com.
| Agent | What it does |
|---|---|
| solo-founder-os | The shared base lib (cron · eval · reflexion · skill library · DGM-lite). Every other agent depends on it. |
| customer-discovery-agent | Reddit pain-point scraper + Claude clustering for product validation. |
| funnel-analytics-agent | Daily founder brief + real-time PH-day alerts across 9 sources. |
| orallexa-marketing-agent | AI marketing agent — submit project once, get platform-native posts for X / Reddit / HN / Dev.to / 小红书 + 7 more. Powers vibexforge.com. |
| vc-outreach-agent | Cold email drafter — investors (vc mode) or paying customers (customer mode, merged from customer-outreach in v0.9.0). HITL queue + SMTP sender. |
| cost-audit-agent | Monthly bill audit across 6 providers (Vercel / Anthropic / OpenPanel / HyperDX / Supabase / GitHub Actions) with dollar-tagged waste findings. |
| bilingual-content-sync-agent | EN ⇄ 中文 i18n diff + Claude translate + HITL apply. Batch API path @ 50% off. |
| customer-support-agent | Triage user messages → auto-draft replies → HITL queue. Closes the L5 customer-support layer. |
| payments-agent | Overdue-invoice reminder drafter. Stripe-shaped types + MockProvider fallback + hard money-safety prompt rules. |
Each agent's own row is omitted from its README. Install whichever solve real problems for you — pip install <agent-name>.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。