Skip to content

feat(mcp): expose fallow impact as a read-only MCP tool#804

Merged
BartWaardenburg merged 2 commits into
mainfrom
feat/impact-mcp-tool
May 29, 2026
Merged

feat(mcp): expose fallow impact as a read-only MCP tool#804
BartWaardenburg merged 2 commits into
mainfrom
feat/impact-mcp-tool

Conversation

@BartWaardenburg
Copy link
Copy Markdown
Collaborator

Summary

  • Adds a read-only impact MCP tool (the 21st) wrapping fallow impact --format json, so AI agents can read the local value report (current surfacing, trend since the last recorded run, pre-commit gate containment, and v1.5 resolved/suppressed attribution) the same way they call check_health or audit. Impact was the only first-class CLI surface with no MCP tool.
  • root-only params: impact runs no analysis and reads only .fallow/impact.json, so the config/no_cache/threads knobs the analysis tools expose are deliberately omitted as inert.
  • Read-only posture: the mutating enable/disable lifecycle is not exposed. On a never-enabled project the report is a populated {"enabled": false, ...} object (never {}), so an agent branches on enabled then record_count and recommends the user run fallow impact enable rather than toggling it.
  • Annotated read_only_hint=true, idempotent_hint=true, open_world_hint=false (a single closed-world local file read, like fallow_explain).
  • The tool description front-loads the LOCAL-DEV-ONLY caveat (empty report in ephemeral CI runners; not a CI metric) and describes the v1.5 attribution fields as present on impact v1.5+ rather than gating on schema_version (they ship under unchanged schema_version "1").

Test plan

  • cargo test -p fallow-mcp: all pass, including 8 new impact tests (arg building, empty-root drop, param deserialization with stray-field tolerance, registration + count 21, annotations, schema-property inclusion/exclusion).
  • cargo build --workspace clean (post-rebase onto current main).
  • cargo clippy -p fallow-mcp --all-targets -- -D warnings clean.
  • cargo fmt --all -- --check clean.
  • cargo doc -p fallow-mcp --no-deps --document-private-items clean.
  • Real-binary smoke: fallow impact --format json on a never-enabled project returns the populated {"enabled": false, "record_count": 0, ...} report (exit 0, deterministic); after impact enable it returns enabled: true, record_count: 0.
  • .claude/rules/mcp-server.md (count 20 to 21 + tool entry) and CHANGELOG.md updated; companion repos (fallow-docs, fallow-skills) updated.

Add an "impact" tool wrapping "fallow impact --format json" so AI agents
can read the local value report (surfacing, trend, gate containment, and
v1.5 resolved/suppressed attribution) the same way they query check_health
and audit. Impact was the only first-class CLI surface with no MCP tool.

The tool is read-only and root-only: it runs no analysis and reads only
.fallow/impact.json, so the config / no_cache / threads knobs the analysis
tools expose are omitted as inert. The mutating enable / disable lifecycle
is intentionally not exposed; on an enabled:false report the agent should
recommend the user run "fallow impact enable", not toggle it. Annotated
read_only_hint=true, idempotent_hint=true, open_world_hint=false (a single
closed-world local file read, like fallow_explain).
Bump the fallow-mcp tool count to 21 and add an impact entry in
.claude/rules/mcp-server.md, add a CHANGELOG [Unreleased] note, and
re-bless scripts/agent-files.sha256 for the rules-file edit (CI drift gate).
@BartWaardenburg BartWaardenburg enabled auto-merge May 29, 2026 20:44
@BartWaardenburg BartWaardenburg added this pull request to the merge queue May 29, 2026
Merged via the queue into main with commit db4a8cc May 29, 2026
34 checks passed
@BartWaardenburg BartWaardenburg deleted the feat/impact-mcp-tool branch May 29, 2026 21:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant