mcptest docs GitHub

Drift watch

A third-party MCP server you depend on can change under you: a parameter is renamed, a tool is removed, or a call that used to return rows starts returning nothing. The schema still type-checks and the agent papers over the gap, so the regression ships silently. mcptest drift is a scheduled canary that catches both schema drift and behavioral drift against a committed baseline.

It builds on mcptest diff (semantic catalog drift with breaking-change classification) and adds the second half a watch needs: golden behavioral canaries. The comparison is deterministic and offline; only the live capture touches the network. The hosted scheduler and alerting dashboard stay in the enterprise tier; the OSS engine ships the diff, the canary capture, and the file/exit-code gate.

Drift state

A drift capture is one file bundling the watched contract:

Both a baseline (recorded once against a healthy server) and a current capture (each scheduled run) are drift-state files; drift check diffs the two.

Spec

drift capture and drift check --spec read a spec naming the server and the canary calls:

server:
  url: https://server.example/mcp        # or: command: [node, server.js]
  headers:
    Authorization: Bearer ${SEARCH_TOKEN}
canaries:
  - tool: search
    args: { query: widget }
  - tool: get_item
    args: { id: "1" }

CLI

mcptest drift capture <spec> -o <state.json>
mcptest drift check --baseline <state.json> (--current <state.json> | --spec <spec>) [--json]

A typical CI job:

mcptest drift check --baseline drift-baseline.json --spec drift-spec.yml

What counts as drift

See the runnable, offline drift-watch example.