Skip to content

mcp_schema: key the baseline on (server, client, protocolVersion, auth) not server alone #111

Description

@blitzcrieg1

Why

r/mcp feedback (2026-08). tools/list is a function of the negotiated session, not only the server build. The initialize exchange carries protocolVersion and the client's declared capabilities, and a server may legitimately list a different catalog for a different client or protocol version.

Two agents on one machine, same config file, different client versions, can get different tool sets for entirely benign reasons. Today that flips the digest back and forth and the noise originates here, not at the server.

What exists now

parse_initialize_result (added in #108) captures serverInfo.version and capabilities.tools.listChanged. It does not capture protocolVersion, and nothing looks at the initialize request, so clientInfo is never seen.

SchemaStore.servers is keyed by server name alone:

servers: dict[str, SchemaRecord] = field(default_factory=dict)

Proposal

  1. Extend parse_initialize_result to capture protocolVersion. Add a parse of the initialize request for clientInfo.name and clientInfo.version.
  2. Widen the store key to (server, client, protocolVersion, auth principal). Auth principal is #105 and should land as one key rather than two passes over the same file.
  3. Publish client identity as a hashed id, the way server_id() already does for server names. Client name and version are low-sensitivity but the module's rule is that names stay on the machine.

Constraints

  • Additive format bump. The store file, SchemaRecord, the heartbeat mcp_schema_digest and the Splunk prev_schema compare all read the current shape.
  • Splitting the baseline multiplies the number of baselines per server, which makes the first-observation problem worse rather than better. A new client version starts with no baseline and must not read as a removal.

Acceptance

Two agents with different client versions against one unchanged server produce no rug-pull-shaped finding.

Source

Peer review on https://www.reddit.com/r/mcp/comments/1vvinyo/

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions