MR/PR risk audit MCP server: semantic diff + rule engine, strict read-only. Run as image or pip.
Model Context Protocol (MCP) Server: io.github.GoldenSupremeSaltedFish/diffsense
This MCP server performs MR/PR risk auditing using semantic diff and a rule engine. It supports strict read-only operation and can be run either as an image or via pip.
π οΈ Key Features
MR/PR risk audit focus
Semantic diff analysis
Rule engine for risk evaluation
Strict read-only behavior
Execution via image or pip
π Use Cases
Auditing merge requests (MR) for potential risk
Auditing pull requests (PR) for potential risk using semantic differences
Applying rule-based checks to diff outputs
β‘ Developer Benefits
Read-only guarantees for safer integration
Semantic diff plus rule engine workflow for consistent risk auditing
Flexible deployment through image or pip
β οΈ Limitations
Limited to audit/risk evaluation as described (semantic diff + rule engine)
DiffSense is a Change Risk Gate for the PR stage: it evaluates whether the current diff introduces regression risks without performing full codebase scans or style checks. Designed for minimal alerts, high precision, low latency, and interpretable results.
Copy the workflow from diffsense/docs/quickstart.md (Method 1) to .github/workflows/diffsense.yml in your target repository. Uses the default GITHUB_TOKEN with no additional configuration required. After committing and creating/updating a PR, the workflow will automatically execute the audit and post results under the PR.
Local Audit
Run pip install -e diffsense in the repository root, or pip install "git+https://github.com/GoldenSupremeSaltedFish/DiffSense.git@main#subdirectory=diffsense", then execute diffsense replay <path-to-diff>.
Agent / LLM Integration
Install the MCP server with pip install "diffsense[mcp]" and run diffsense-mcp, or consume the JSON contract / SARIF directly. See Agent Integration Guide.
Optional: Add .diffsense.yaml to your repository root to use the officially recommended configuration, suitable for most teams.
Features
CI / Local: Performs semantic risk auditing on MR/PR diffs, outputting review_level and recommended actions. Analyzes only changed content without slowing down pipelines. Low-quality rules are automatically downgraded. Does not automatically modify CI status; decisions to block are made manually or by downstream processes.
Agent / LLM Integration: Deterministic, machine-readable surfaces for agents and CI gates β versioned JSON contract (schema_version), SARIF 2.1.0 output, and a read-only MCP server (audit_diff / audit_replay / list_rules / explain_rule). See the Agent Integration Guide and CLI Contract.
VSCode Extension: Maintained in the vscode-extension directory of this repository (dual-artifact layout). Install from the Marketplace or download the VSIX from Releases.
Quick Start (Detailed)
GitHub Actions
Copy the complete YAML from diffsense/docs/quickstart.md (Method 1) to your repository's .github/workflows/diffsense.yml to enable PR auditing.
GitLab CI
In your project, go to Settings β CI/CD β Variables and add the variable DIFFSENSE_TOKEN (Personal Access Token with api permissions; recommended to check Mask variable).