Skip to content

Preventing tool poisoning: save signatures of possible tool calls #82

Open

Description

@tadasant

One potential benefit of a centralized registry is that we could have server.json submitters list out all the possible tools their server may ever invoke, fingerprint them, and store those fingerpoints for MCP client consumption.

A third party vendor could scan and approve these fingerprints as devoid of security risks, like tool poisoning attacks.

MCP clients could then use the fingerprints to avoid tool poisoning attacks that get surfaced due to hidden dynamic tool calls or supply chain attacks.

Activity

  1. added
    not go-live blocker
    on May 27, 2025
  2. connor4312 commented on May 27, 2025

    @connor4312
    Contributor

    I had a request on this for VS Code. I didn't dive deep into it but there are a couple scenarios that complicate this.

    1. Servers that provide a dynamic tools
    2. Tools that localized (Adds i18n support modelcontextprotocol#115)
    3. Tools that may change depending on the model (Feature Request: Model-Aware Content Adaptation for MCP modelcontextprotocol#469)

    Just letting clients do this may make more sense because the client will know at least (2) and (3) or know when they change. But the ecosystem tooling here is still quite immature.

  3. tadasant commented on May 27, 2025

    @tadasant
    MemberAuthor

    If we focus on the notion of possible tools (i.e. any tool that could ever surface, beyond just at-initialization), those three problems go away, right?

  4. connor4312 commented on May 27, 2025

    @connor4312
    Contributor

    Yes. It's a bit of a pain because, given both (2) and (3) happen it's a NxM multiplier to the number of tools, but it's possible.

  5. connor4312 commented on May 27, 2025

    @connor4312
    Contributor

    (though practically only a relatively small number of servers will get localized into a large number of languages)

  6. connor4312 commented on May 30, 2025

    @connor4312
    Contributor

    I think tool representation overall, either in the registry spec or MCP metadata, would be useful. Currently clients need to start servers in order to know what tools, prompts, etc. are available. Because MCP servers can now do nice authentication, this can lead to a bunch of login prompts for the user when they first start interacting with their language model. If servers optionally (there might always be servers with nondeterministic tools) published their starting set of tools/prompts, then we could avoid this.

  7. jonathanhefner commented on May 30, 2025

    @jonathanhefner
    Member

    I think tool representation overall, either in the registry spec or MCP metadata, would be useful. Currently clients need to start servers in order to know what tools, prompts, etc. are available.

    Agreed, in particular for tool representation in MCP metadata. Unrelated to tool poisoning, but it might allow clients to statically index tools for client-side tool search.

  8. goncalossilva commented on Jul 25, 2025

    @goncalossilva

    Hi everyone, I'm glad that @tadasant raised this.

    We are facing a challenge that would also be solved by having easy access to the tools provided by each MCP server. In our case, we want to avoid forcing a user to authenticate to a service before we can even confirm it has the tools to solve their problem (via tools/list).

    Could the server schema within the registry API be augmented to include tools? This would allow a server operator to choose to list their tool schemas publicly as part of the discovery process.

    There are several benefits to this, from improved user experience for cases like ours, to more accurate MCP server selection in case there is more than one for a particular service, not to mention improved transparency within the ecosystem.

    A nuanced “possible tools” angle makes sense considering dynamic cases as @connor4312 pointed out. However, while we want to support all cases, we do want to optimize for the common case. And the majority of MCP servers does have a static list of tools.

    Happy to contribute further details on our use case or to take part in the discussion on the details.

  9. tadasant commented on Jul 26, 2025

    @tadasant
    MemberAuthor

    Thanks @goncalossilva ! I think it'd be reasonable for someone to take on adding a field for statically defined tools.

    From a guidance perspective, we could say SHOULD enumerate all possible tools.

    Steps to contribute:

    1. Update https://github.com/modelcontextprotocol/registry/blob/4f5e85b51073bc878949850a44bd66d42e2d59fa/docs/server-json/schema.json
    2. Update https://github.com/modelcontextprotocol/registry/blob/main/docs/server-json/registry-schema.json
    3. Update https://github.com/modelcontextprotocol/registry/blob/main/docs/server-registry-api/openapi.yaml
    4. Include examples in the adjacent files, update any code this impacts

    For the first update, would expect to see a thoughtful canvassing of any other precedent out there for this feature. For example, Anthropic's DXT format is probably good precedent for this / maybe we should align with their shape for tools. And the team there would probably have an opinion on this as well cc @felixrieseberg

  10. rdimitrov commented on Jul 29, 2025

    @rdimitrov
    Member

    Would we rely on the author of the MCP server to populate the list of tools? If so should there be a way to prove/validate these upon publishing? What I mean is this raises a concern that bad actors can populate this list intentionally in a wrongful way which may cause malicious results further down. I'm supportive of having the tool's list in advance, just raising that it would be nice if there's a way to guarantee its correctness upon publishing and/or consuming.

  11. tadasant commented on Jul 29, 2025

    @tadasant
    MemberAuthor

    I don't think we can pursue running servers and introspecting them - there is too much of a rabbit hole there. What do you do for remote servers? What do you do for auth gates? What do you do for dynamic lists that won't be present on initial startup? Not to mention the quagmire that is trying to get them to run at all in a unified way across all the possible package registries.

    We should think through what exposure there might be and give guidance on "how consumers should use this data" accordingly. At the end of the day, I only expect consumers to use this data as a kind of search/filtering/documentation mechanism; it shouldn't be "run" in any way, so not even prompt injection should be a concern here (perhaps we should give guidance to not pull this data into inference for any reason).

    @goncalossilva can you share more about the nature of your intended use case to help guide this level of trust factor?

  12. goncalossilva commented on Jul 30, 2025

    @goncalossilva

    Steps to contribute

    Thanks for these! I'm happy to push these forward soon.

    can you share more about the nature of your intended use case to help guide this level of trust factor?

    We're exploring using LLMs to convert prompts into workflows with minimal manual work from the user. The upcoming MCP registry is a great start to help us discover available MCP servers we might want to use, but that's generally not enough. We also need to know which capabilities are available in each MCP server.

    We could do this back and forth of first identifying relevant MCP servers, then handling authentication, and only then listing tools and preparing the workflow. And for now, we plan to do exactly that. But we're concerned about the use case where it's only after all of that, including effort from the user themself, that we realize we don't have the right tools to carry out the job. Determining that before the user puts in any effort would be much better UX.

    Does this help?


    For what it's worth, I agree that having to prove the list of tools is complex and I wouldn't consider it for a first version. Trust is paramount, but this documentation would be authored by the MCP server authors themselves. Potentially even automated via the SDK, reducing the risk of even unintentional errors.

  13. tadasant commented on Jul 30, 2025

    @tadasant
    MemberAuthor

    Does this help?

    That makes sense! And aligned with what I was expecting / I stand by my earlier thoughts.

    Potentially even automated via the SDK, reducing the risk of even unintentional errors.

    Curious what exactly you mean by this?


    Thank you for jumping in on this!

  14. goncalossilva commented on Jul 31, 2025

    @goncalossilva

    Potentially even automated via the SDK, reducing the risk of even unintentional errors.

    Curious what exactly you mean by this?

    This is something I still have to explore, but seeing how users of MCP's SDKs annotate their tools (e.g., @mcp.prompt(title="Do something") in Python) it may be possible to automate creating the “manifest” of tools for the registry, so there is less manual work involved, and consequently, it becomes less error-prone.

    Thank you for jumping in on this!

    My pleasure! Let's see where this goes. I'm off next week but planning to take some of the steps above after I'm back.

  15. 15 remaining items

  16. alexar76 commented on Nov 14, 2026

    @alexar76
  17. lanbass869-cell commented on Nov 14, 2026

    @lanbass869-cell

    A third piece worth covering here: each per-version record could be signed and bound to the artifact digest, so a client can verify it offline instead of trusting the recorder.

  18. lanbass869-cell commented on Nov 14, 2026

    @lanbass869-cell

    To add to that: the per-version digests smallprint keeps are genuinely useful, but a client still has to trust smallprint's service and database. The same is true of any registry-side fingerprint.

    What composes with both is making the record verifiable without trusting the recorder: sign it (DSSE/Ed25519, in-toto Statement v1 payload) and bind it to the artifact digest, so anyone can check it offline with the public key. And on re-scan, supersede rather than overwrite, so a verdict flip stays auditable instead of disappearing.

    I built and ran that end to end: 20 PyPI MCP servers, each record bound to the exact sdist sha256 it was scanned from, signed, and published with the public key beside it. The records are under docs/scan/ in the lanbass869-cell/canari repository.

    Two caveats I want to be explicit about:

    • the scans in that sample were run by bandit, not by me; each record names the upstream tool and my code only records and signs it
    • this is artifact-level (bytes), not tool-surface-level, so it is complementary to SEP-1649 rather than a substitute
  19. lanbass869-cell commented on Nov 17, 2026

    @lanbass869-cell

    An update on the "verifiable recorder" layer I mentioned earlier, because two things are now concretely testable rather than described.

    1. It composes with mcp-tool-set-digest/1 instead of competing with it. The attestation schema has evidence_refs as free strings, so a record can carry another tool's digest and still be signed. Tested on a real record: appending toolset:sha256:<64 hex>:n=12 (mcp-tool-set-digest/1) keeps schema PASS and signature PASS; flipping one hex character makes verification fail (rc 1, Failed to verify signature). So a CrawlCheck/HISTOR digest can be carried inside a signed, artifact-bound record.

    2. It is installable in one line and gates a real client. pip install canari-mcp==0.1.4 gives canari-mcp-gate, a stdio wrapper: point an MCP entry's command at it and it looks the component up in the signed ledger before starting the real server, then proxies stdio byte-for-byte with no parsing. Measured in a fresh venv: install 10.9s; unidentified component passes through (rc 0); --on-unknown=block exits 5 with the child never started.

    Why I think the recorder has to be verifiable. Whatever shape the registry field takes, the record will be produced by a third party. If checking it requires calling that party's service, the client has swapped one trust anchor (the registry) for another (the recorder). The alternative is a record the client can check offline against a published key: signature + artifact digest, and supersede rather than overwrite so a verdict flip stays visible.

    What I would find most useful from this thread: whether the fingerprint the registry stores should be (a) producer-declared and registry-verified, or (b) recorded by any observer and independently verifiable. Those two lead to different server.json shapes, and (b) is the one a third party can fill without the registry having to trust them.

    Records for the 20-package sample are under docs/scan/ in lanbass869-cell/canari, each bound to the sdist sha256 it was scanned from. The scans themselves were run by bandit; the code only records and signs them.

  20. alexar76 commented on Nov 17, 2026

    @alexar76
  21. bcrypto0 commented on Nov 19, 2026

    @bcrypto0

    Publisher declaration side: a {url, hash} pointer under publisher-provided to a signed declaration, with a live listing

    This covers the publisher declaration half of this issue (the "promise" in the 17 Nov exchange), kept distinct from observations as the 23 Oct consolidation asks, and needs no change to the registry.

    What exists. com.rtlpdf/arabic-pdf 1.0.0 (my own server, published 19 Nov 2026) carries a {url, hash} pointer at _meta["io.modelcontextprotocol.registry/publisher-provided"].addonDeclaration; the key is flat because a published version cannot be edited, though a reverse DNS subkey would fit better. It points to a small signed JSON statement on the namespace domain that binds the listing name, version, remotes and tools list (format 0.1, with a single hash of my own construction). A second statement for the same version (format 0.2, latest.json beside it) signs the two mcp-tool-set-digest/1 digests instead and names the first as previous; a client that follows only the pointer reaches the 0.1 one. Both use the key the domain publishes for registry login (the v=MCPv1 record at /.well-known/mcp-registry-auth, http method), which the registry checks at login and the checker reads live. The signing input starts with the format id and a line feed (addon-declaration/0.2), keeping these signatures apart from login signatures and the two formats apart from each other.

    Check it yourself (Node 20 or later, no dependencies; run from a clone of https://github.com/bcrypto0/addon-declaration, which holds the spec and vectors):

    # bash or zsh
    curl -o d1.json https://rtlpdf.com/.well-known/addon-declaration/com.rtlpdf/arabic-pdf/by-hash/9170020c77a92f039806c11f714d1aa6eb50780bdb90c27e52016958045baca6.json
    curl -o d2.json https://rtlpdf.com/.well-known/addon-declaration/com.rtlpdf/arabic-pdf/latest.json
    curl -o t.json -X POST https://rtlpdf.com/mcp -H "Content-Type: application/json" -H "Accept: application/json, text/event-stream" -H "MCP-Protocol-Version: 2025-11-25" -d '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'
    node bin/addon-declare.js verify d2.json --http --format 0.2 --tools t.json --previous d1.json
    node bin/addon-declare.js hash-declaration d1.json
    

    (Windows PowerShell form: examples/live-rtlpdf/README.md in the repository.)

    The first node line printed valid on 19 Nov 2026 at 03:59 UTC, with "contract match, extras match" and the link to the first statement checked. The second prints the pointer hash (the SHA 256 of the signing input, not of the file bytes).

    The four points the 23 Oct note says the design still needs, in its order

    1. Canonical form: RFC 8785. The declaration file is parsed strictly (duplicate member names and lone surrogates are refused); the tool list is read by the input rules of mcp-tool-set-digest/1.
    2. Annotations: format 0.2 signs the two labelled digests of mcp-tool-set-digest/1 and no construction of its own, so an annotation change lands in the extras digest and the check says which digest differs. The checker passes that draft's 73 vectors. Signed values for the live list: contract sha256-VPxDXBxVgGzH/0OtZBO1iGClgcDKQSgXmvDHsxe3YTU=, extras sha256-+q4/BoqWmGGjGJw7VgeYkxe99dw6scmRsiGkGhwP8n8=. Observers here may not have this new listing yet; different values from one of them would be worth a reply.
    3. Dynamic and auth dependent tools: the declaration signs the list an unauthenticated client receives and nothing else. For this server both digests are the same with no protocol header, 2025-06-18 and 2025-11-25. Format 0.2 does not yet sign which protocol version and authorization the list was read under; that draft asks a producer to record both with a digest (its section 11) and a signed record to include its observation context (section 11.1). That is the main open point of 0.2.
    4. What a client check means: valid shows that the holder of a key published now at the namespace domain signed this content, within its time window, and that the tools list given to the checker has both declared digests. The client compares the signed name, version and remotes with the listing it is looking at, and checks that the declaration's hash equals the pointer hash or, for a later declaration of the same version such as latest.json here, that its previous link reaches the pointer hash.

    What it does not do. It does not show that the server is safe, that the signer operates the remote, that every client receives the same list, or that a declaration is the newest. The domain holder can sign a new one at any time: this is attribution and a dated, signed statement per version, not protection against the publisher. There is no transparency log. A declaration stays valid until it expires (180 days here) unless the domain stops publishing its key, so an older one can still be shown to a client. In this listing the pointer itself names the older 0.1 statement, because a listing version cannot be edited, and nothing in the listing tells a client that a newer one exists. The observer logs in this thread could record declarations. Whoever signs with the login key can also publish; the dns method allows a separate declaration only key. GitHub account namespaces have no published key and are out of scope. One signer so far; a draft.

    Related: #1720, #1706, #1860, and SEP-3140 in the specification repository (closed).

    One question for maintainers. The 13 Nov comment that introduced mcp-tool-set-digest/1 leaves open "under which field a publisher or the Registry would state the digest it expects" and calls that this tracker's question. Which shape would you rather publishers use under publisher-provided today, so that a later registry field could take it over unchanged: the two labelled digests stated directly, or a {url, hash} pointer to a signed statement like this one? I am not asking for a schema field, a check at publish time, a badge or a verified flag now. Corrections are welcome.

    AI disclosure: the spec, the checker and this comment were drafted primarily by AI (Claude Code). I read them, ran the check above myself and take responsibility for the content.

  22. alexar76 commented on Nov 19, 2026

    @alexar76
  23. emmanuelorta commented on Nov 22, 2026

    @emmanuelorta

    CrawlCheck's results against mcp-tool-set-digest/1 at aca5812: both published SDKs give every value of all 73 vectors (digests, canonical texts and error codes, for contract and extras): Python crawlcheck 1.16.3 (tool_set_digest) and JS @crawlcheck/sdk 1.15.2 (toolSetDigest).

    The signed lockfile now carries the same pair: GET /api/v1/mcp/lock on crawlcheck.io returns a tool_set_digest block next to jcs_v1. Checked today against the live tools/list of io.github.emmanuelorta/crawlcheck (28 tools): contract sha256-9Z/eIkZH55y+8m9M7PHYr4pURSkVrVOJlxlb0pHia3w=, extras sha256-G44DGgW7+rp9YjMAaEG80Tm5RFoke8eYkrE6nGk69y8=, equal to the values recomputed from the list.

  24. alexar76 commented on Nov 22, 2026

    @alexar76
  25. emmanuelorta commented on Nov 22, 2026

    @emmanuelorta

    @alexar76 thanks for the independent read. Your section 11 suggestion is live: the lockfile's tool_set_digest block now carries read, inside the signed body, so the same Ed25519 signature covers it. For https://crawlcheck.io/mcp it reads:

    "read": { "source": "read", "protocol_version_header": "2025-06-18", "pages": 1, "complete": true, "authorized": false, "tools": 28 }

    authorized is always false on a read, because CrawlCheck sends no credentials to the server. A lockfile built from a POSTed list says "source": "supplied" with the reading fields null, since nothing was read. The two digests are unchanged (contract sha256-9Z/eIkZH55y+8m9M7PHYr4pURSkVrVOJlxlb0pHia3w=, extras sha256-G44DGgW7+rp9YjMAaEG80Tm5RFoke8eYkrE6nGk69y8=).

    AI use: drafted with Claude Code; the values are from the live lockfile read just now.

  26. alexar76 commented on Nov 26, 2026

    @alexar76
  27. rufat325 commented on Nov 26, 2026

    @rufat325

    sure

  28. emmanuelorta commented on Nov 30, 2026

    @emmanuelorta

    @alexar76 Thank you for running HISTOR's independent 22-day comparison against CrawlCheck and for publishing the mismatches rather than hiding them. The 4,268/4,297 matched digest observations are useful external validation, and your corrections for bounded historical lookups and registry endpoint moves help prevent false disagreements.

    I'm following up on the remaining reported 25-tool vs 31-tool case. We opened https://github.com/emmanuelorta/crawlcheck/issues/99 and staged a no-network forensic regression harness in https://github.com/emmanuelorta/crawlcheck/pull/100. This is not a claim that CrawlCheck or HISTOR is at fault; the cause is still unknown.

    Could you point us to the exact row (registry ID and/or JSON path) in results-2026-11-28.json, with the two HISTOR read timestamps, CrawlCheck's read_at, original endpoint, and both digests? The public JSON dataset endpoint wasn't retrievable from our current reader. We'll compare the historical records under the same endpoint, protocol mode/version and full pagination before assigning a cause, then report back with a reproducible finding or an explicit unresolved result.

    Thanks again for making the corrections and documenting them so thoroughly. — Emmanuel, CrawlCheck

  29. emmanuelorta commented on Dec 1, 2026

    @emmanuelorta

    Hey @alexar76, thanks for independently checking CrawlCheck’s MCP tool inventory. We owe you one for taking the time to do that.

    Would you be up for one more check? Run our Node quickstart, verify a signed preflight receipt from your side, and let me know whether it verifies and where the docs could be clearer. The example uses CrawlCheck’s public MCP server.

    https://github.com/emmanuelorta/crawlcheck/blob/main/docs/marketing/mcp-developer-quickstart.md

  30. emmanuelorta commented on Dec 1, 2026

    @emmanuelorta

    @alexar76 Quick update on the remaining 25-vs-31 case. We found the article's results JSON and matched the open row to ca.bakhour/profitcollector, with CrawlCheck's read at 2026-11-12T18:49Z. mcpcost’s independent history also records 25 tools earlier on Nov 12 and 31 on Nov 13. That corroborates both counts and leaves the cause of the specific mismatch open.

    Could you point us to the two HISTOR snapshots bracketing that read, or share their timestamps, endpoint, digests and protocol mode/version? Page counts or cursor-completion metadata would also help if retained. We’ll compare against the original CrawlCheck record and record the conclusion in CrawlCheck #99. Thanks again for publishing the data.

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

Metadata

Metadata

Assignees

Labels

not go-live blocker

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions