Detect when AI code changes exceed declared task scope (MCP server).
Detect and report when AI coding agents change files outside their declared task scope. Designed to plug into Cursor, Claude Code, and other MCP-compatible AI coding agents via the standard stdio transport.
Compares two things:
If the actual diff exceeds the declared scope, the tool returns status=over_reach and lists the offending files and categories.
over-reach-detector is an audit/disclosure tool, not a sandbox and not a blocker.
It compares a declared task scope with the actual files/categories changed by an AI coding agent. If the actual changes exceed the declared scope, it reports that mismatch.
It does not prevent file writes by itself. It does not decide whether to revert, approve, or block a change. The caller remains responsible for enforcement, rollback, or human review.
From PyPI:
pip install over-reach-detector
From source:
git clone https://github.com/choreoatlas/over_reach_detector
cd over_reach_detector
pip install -e .
Run all tests: python -m pytest -v
Try the CLI directly: python -m over_reach_detector.detector --input fixtures/example_pr_1.json --format markdown
Start the server (stdio transport): over-reach-detector (or python -m over_reach_detector.server from source)
Register with your AI agent:
~/.cursor/mcp.json, add (after pip install over-reach-detector):{
"mcpServers": {
"over-reach-detector": {
"command": "over-reach-detector"
}
}
}
Dev / from source: use "command": "python", "args": ["-m", "over_reach_detector.server"] (run from repo root).
pip install over-reach-detector, run claude mcp add over-reach-detector over-reach-detector (writes to ~/.claude.json). Dev / from source: claude mcp add over-reach-detector /absolute/path/to/python -m over_reach_detector.server.check_scope_tool takes:
declared_files: list of fnmatch globs (e.g. ["docs/*.md", "tests/*.py"])declared_categories: subset of ["tests", "docs", "infra", "config", "code"]actual_files: list of file paths the AI modifiedoutput_format: "json" (default) or "markdown"Returns a report with:
status: in_scope (within declared scope) | over_reach (reported mismatch) | emptyfile_overreach: files not matching any declared globcategory_overreach: inferred categories outside the declared setCurrent scope: CLI + MCP stdio server + 1 tool. Python only. fnmatch-based globs.
Out of scope (forbidden): code quality review, security audit, completeness governance, languages other than Python, multi-tool MCP servers, HTTP/SSE transport, GitHub Actions integration. These are deliberately deferred to later versions or never.
Call check_scope_tool directly from Python (same logic the MCP server exposes):
import json
from over_reach_detector import server
result = server.check_scope_tool(
declared_files=["docs/*.md"],
declared_categories=["docs"],
actual_files=["docs/a.md", "scripts/extra.py"],
output_format="json",
)
report = json.loads(result)
print(report["status"]) # "over_reach"
print(report["file_overreach"]) # ["scripts/extra.py"]
MIT — see LICENSE.
Source-derived launch command. Check the maintainer’s required arguments and credentials before running:
uvx over-reach-detectorMerge this template into ~/Library/Application Support/Claude/claude_desktop_config.json. Keep existing servers. Add any arguments, credentials, and permissions required by the maintainer; this template has not been install-tested.
{
"mcpServers": {
"io-github-choreoatlas-over-reach-detector": {
"command": "uvx",
"args": [
"over-reach-detector"
]
}
}
}Restart Claude Desktop completely for changes to take effect. Confirm the server appears connected in the client’s tool list, then try a read-only example from its documentation.
Claude Desktop setup referenceOver-Reach Detector works with any MCP-compatible client. Copy the config snippet from the Configuration section above and add it to the file shown for your client, then restart the application.
~/Library/Application Support/Claude/claude_desktop_config.jsonRestart Claude Desktop completely for changes to take effect.~/.cursor/mcp.jsonRestart Cursor for changes to take effect..vscode/mcp.jsonReload VS Code window for changes to take effect.~/.codeium/windsurf/mcp_config.jsonRestart Windsurf for changes to take effect..mcp.jsonSave at the project root, then start Claude Code in that project and review the MCP server approval prompt. Keep real credentials out of shared files.