Files
Shanghua Gao 406add8bf0 Record reviewed MCP contracts in a lockfile and check drift in CI (#583)
Pinned third-party MCP tools were stored only as a contract_sha256. A hash
can show that an upstream server changed a tool but never what it changed,
so a maintainer asked to re-pin had nothing to review and could only accept
blind -- which is what re-pinning the nine drifted Folklore and Genomic
Intelligence contracts actually amounted to.

Adds src/tooluniverse/data/mcp_contracts.lock.json recording the reviewed
inputSchema/outputSchema of all 27 pinned tools across the four loaders, so
upstream drift shows up as a readable diff instead of two hex strings.

scripts/sync_mcp_contracts.py has three modes: --check-config (offline;
the lockfile and the configs must agree), --check-live (diff the servers
against the lockfile) and --update (re-record, producing the diff to review).

The new workflow moves detection off the user's critical path. Contract
verification currently fires inside the user's process, where nobody can
review a third-party schema or re-pin it; Folklore and Genomic Intelligence
were each serving zero tools for an unknown period, found only by accident,
because the weekly health check cannot see them -- MCP loader URLs are
opt-in env vars CI never sets. check-config gates every PR; check-live runs
daily and fails on real drift while skipping servers it cannot reach, so a
vendor outage or rate limit does not read as drift.

The drift report calls out new input fields specifically: the agent fills in
any parameter a server advertises, so an added field is a new path for data
to leave the session.
2026-09-14 17:03:12 +08:00
..
2026-02-04 11:51:31 -05:00