Skip to content

feat: echo serverFingerprint on MCP fetch/replace to guard against tool drift @W-23608280 - #325

Open
Christian-Vallejos wants to merge 1 commit into
forcedotcom:mainfrom
Christian-Vallejos:t/api-catalog/mcp-server-fingerprint
Open

feat: echo serverFingerprint on MCP fetch/replace to guard against tool drift @W-23608280#325
Christian-Vallejos wants to merge 1 commit into
forcedotcom:mainfrom
Christian-Vallejos:t/api-catalog/mcp-server-fingerprint

Conversation

@Christian-Vallejos

Copy link
Copy Markdown
Contributor

Summary

Adds the optional serverFingerprint field to the ApiCatalog MCP types so the
fetch → review → replace round-trip can carry the tool-drift token. This is the
library layer consumed by the --server-fingerprint flag added to sf agent mcp asset replace in the companion salesforcecli/plugin-agent PR.

Background — the rug pull. An EXTERNAL MCP server can silently change the
description of an already-active tool after an admin approved it. The
description is exactly what the LLM reads, so this is a prompt-injection /
exfiltration vector. The Connect API already supported an optimistic-concurrency
serverFingerprint on PUT /assets, but POST /fetch never echoed it back — so
the client had no value to round-trip and the check was always skipped. This PR
closes the client-side contract gap.

What's included

  • McpServerFetchOutput.serverFingerprint — echoed by POST /fetch; an opaque
    hash of the server's current tool definitions.
  • McpServerAssetReplaceInput.serverFingerprint — round-tripped into PUT /assets so the server verifies the reviewed definitions haven't drifted
    (status OUT_OF_SYNC). Keeping an already-active drifted tool active without it
    is rejected with a 409.

replaceMcpServerAssets already forwards the whole input object, so no client
logic change is needed — only the contract types.

Test plan

  • yarn build (compile + lint) — clean.
  • tsc --noEmit — clean.
  • Existing test/apiCatalog.test.ts suite unaffected (the client passes the input
    through verbatim; the new field is additive and optional).

🤖 Generated with Claude Code

…nst tool drift

Add the optional `serverFingerprint` field to the ApiCatalog MCP types so the
fetch → review → replace round-trip can carry the drift token:

- McpServerFetchOutput.serverFingerprint — echoed by POST /fetch; an opaque hash
  of the server's current tool definitions.
- McpServerAssetReplaceInput.serverFingerprint — round-tripped into PUT /assets so
  the server can verify the reviewed definitions haven't drifted (OUT_OF_SYNC).
  Keeping an already-active drifted tool active without it is rejected with a 409.

replaceMcpServerAssets already forwards the whole input, so no client logic change
is needed — only the contract types.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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