@diffpulse/mcp
v0.2.0
Published
DiffPulse MCP server — expose PR risk checks to AI dev tools
Maintainers
Readme
@diffpulse/mcp
MCP server for deterministic git diff checks in Cursor and other AI tools.
DiffPulse runs policy checks against your local git diff and returns structured findings. Your editor's AI explains and fixes them. DiffPulse does not call OpenAI, Anthropic, or other hosted AI providers.
What this is
- An MCP wrapper around the same engine as
diffpulse check - Structured JSON findings for AI-assisted review
- Local git only — no GitHub or Azure DevOps API for diff collection
What this is not
- Not an AI reviewer (your editor's model interprets the output)
- Not a GitHub App requirement
- Not a hosted service
How it works with Cursor
- You check out a branch and open the repo in Cursor
- You ask: "Review my staged changes with DiffPulse before I commit."
- Cursor calls
diffpulse_review_diff - DiffPulse returns structured findings with
target,baseRef,branch,filesChanged, andfindings - Cursor explains the issues and helps you fix them
Example prompts:
- "Review my staged changes with DiffPulse before I commit."
- "Review my local changes with DiffPulse."
- "Review this branch with DiffPulse against main."
DiffPulse reviews local git diffs only. Hosted PR targets (github-pr, azure-pr) may be added later but are not required for local workflows.
Secrets redaction
The secrets_in_diff check redacts credential values in all MCP responses. Raw secrets never appear in findings, report, or narrativeSummary JSON.
Install
npx -y @diffpulse/mcpOr add as a dev dependency:
npm install -D @diffpulse/mcpFull setup guide: diffpulse.dev/docs/mcp
Cursor configuration
Add to .cursor/mcp.json:
{
"mcpServers": {
"diffpulse": {
"command": "npx",
"args": ["-y", "@diffpulse/mcp"]
}
}
}Set cwd to your repository root if the server should evaluate a specific project.
Tools
| Tool | Purpose |
|------|---------|
| diffpulse_review_diff | Review local git diff — primary tool |
| diffpulse_check | Alias for diffpulse_review_diff |
| diffpulse_policy_summary | Summarize .diffpulse/policy.yaml |
| diffpulse_explain_report | Deterministic narrative from a report (no external AI) |
diffpulse_review_diff
Reviews local git diffs. Auto-detects target when omitted (staged → unstaged → branch).
Returns top-level target, baseRef, branch, filesChanged, findings, plus summary, checks, and full report (schema v2).
| Input | Description |
|-------|-------------|
| target | staged, unstaged, all-local, or branch (optional — auto-detect when omitted) |
| baseRef | Base git ref for branch target (implies target=branch when target omitted) |
| includeSummary | Include narrativeSummary string (default: false) |
Legacy mode and scope parameters remain supported as aliases.
Recommended workflow
npx @diffpulse/cli init— scaffold policy (once per repo)- Add MCP config above to Cursor
- Check out feature branch, commit changes
- Ask Cursor: "Review this branch with DiffPulse against main."
- Fix findings, rerun
diffpulse check, merge when clean
CLI equivalent
diffpulse check --format json # ≈ diffpulse_review_diff (auto-detect)
diffpulse check --target branch --base main
diffpulse check --staged # ≈ target: stagedLinks
License
MIT
