Skip to content

Sheriff

An MCP server that turns static analysis reports into a managed work queue for AI agents — batching issues by file, tracking fixes, and persisting progress across sessions.

AI agents can handle a handful of static analysis issues directly. But when reports grow to dozens or hundreds of issues, things break down:

Context Overload

Large issue lists overwhelm context windows, causing agents to lose track of what’s been fixed

Lost Progress

Work is lost on context compaction or session restart — there’s no external record of progress

Inefficient Navigation

Without batching, agents jump between files repeatedly, wasting tokens and missing issues

Sheriff provides a work queue manager for AI agents fixing static analysis issues:

Intelligent Batching

Issues grouped by file for efficient fixing - fix all issues in one file before moving to the next

Persistent Progress

State survives compaction, restarts, and agent switches via embedded H2 database

Scope Filtering

Focus on specific rules, severities, or file patterns

Compact Responses

Minimal context usage with abbreviated field names

Sheriff works with any tool that produces SARIF output:

ToolLanguageSARIF Command
QodanaJava/Kotlin/JS/Pythonqodana scan (SARIF output is default)
SemgrepMulti-languagesemgrep --sarif -o results.sarif
ESLintJavaScript/TypeScripteslint --format @microsoft/sarif
CodeQLMulti-languageBuilt-in SARIF output
SonarQubeMulti-languageBuilt-in SARIF export
SpotBugsJavaspotbugs -sarif
BanditPythonbandit -f sarif
CheckovIaCcheckov -o sarif
TrivyContainer/IaCtrivy --format sarif
  1. Run static analysis - Generate SARIF output from your tool of choice
  2. Load into Sheriff - sheriff load target="results.sarif"
  3. Get next file’s issues - sheriff next returns a batch of issues from one file (default limit: 25)
  4. Fix all issues in file - Edit the code to resolve each issue
  5. Mark as done - sheriff done fps=[...] status="fixed"
  6. Repeat - Until remaining = 0
User: "Fix all ConstantValue issues in my codebase"
Agent: sheriff load target="build/qodana/qodana.sarif.json"
→ 136 total issues, 22 ConstantValue, 15 unused...
Agent: sheriff next scope={rule: "ConstantValue"}
→ 3 issues in Service.java with code snippets
Agent: [reads Service.java, fixes all 3 issues]
Agent: sheriff done fps=["88d32cab35478753", "ab1c2d3e12345678", "f9e8d7c6a1b2c3d4"] status="fixed"
→ 3 marked fixed, 19 remaining
Agent: sheriff next scope={rule: "ConstantValue"}
→ 2 issues in Repository.java...
... continues until remaining = 0

Sheriff works with any client that supports the Model Context Protocol:

ClientTypeNotes
Claude CodeCLIAnthropic’s official CLI
Claude DesktopDesktop AppAnthropic’s desktop application
ChatGPT DesktopDesktop AppOpenAI adopted MCP in March 2025
CursorIDEAI-native code editor
WindsurfIDECodeium’s AI IDE
ZedEditorHigh-performance editor with MCP
ContinueVS Code ExtensionOpen-source AI assistant
ClineVS Code ExtensionAutonomous coding agent
CodyMulti-platformSourcegraph’s AI assistant