TensorPass

MCP tool poisoning attack: what it means for a site that exposes tools

An MCP tool poisoning attack hides instructions in the text a model reads about a tool. On a site that hosts the only server its chat calls, the poison arrives through visitor text in tool results and through dependency updates.

Published on

An MCP tool poisoning attack hides instructions in the text a model reads about a tool, and on a benchmark of 45 live servers it succeeded in 72.8% of cases against o1-mini. The public disclosures describe a client, such as Cursor or Claude Desktop, joining a server it does not control. A site that exposes search and booking tools to a public chat sits in another position. You write the only server the chat calls, including every tool description it publishes. The poison reaches you through two other doors: tool results that carry text your visitors wrote, and the packages your server installs. This page covers both, then the guards on tool output and the read only defaults that limit the damage.

Key takeaways:

  • On 1 April 2025, Invariant Labs showed a poisoned add tool in Cursor reading ~/.cursor/mcp.json and ~/.ssh/id_rsa and passing both files out through a hidden parameter.
  • MCPTox (August 2025) ran 1,348 poisoned cases over 353 real tools on 20 LLM agent settings. o1-mini followed the poison in 72.8% of cases, and the highest refusal rate stayed under 3%.
  • On a first party server, the open paths are tool results carrying visitor text and dependency updates. The postmark-mcp package turned malicious at version 1.0.16 on 17 September 2025.
  • The MCP specification (version 2025-06-18) requires servers to sanitize tool outputs. It sets readOnlyHint to false and destructiveHint to true by default.

What is an MCP tool poisoning attack?

Tool poisoning is an indirect prompt injection placed in tool metadata: the model reads instructions the user does not see and acts on them. Invariant Labs disclosed the attack on 1 April 2025. Its proof of concept was an add tool whose description asked the model to read two local files and send their content in a parameter called sidenote. Cursor's confirmation dialog did not show the full tool input. The SSH key left the machine unseen.

Three poisoning paths are documented, with one example each:

  1. Descriptions. The add tool above. A variant called tool shadowing uses one server's description to change how the model calls another server's tool: a fake add tool told the agent to send every email from a trusted send_email tool to an attacker address.
  2. Schemas. In 2025 CyberArk extended the attack to the whole tool definition and named it Full-Schema Poisoning (FSP): the instruction sits in parameter names, types, defaults or extra fields. "Every part of the tool schema is a potential injection point, not just the description," said Simcha Kosman of CyberArk.
  3. Results. An Advanced Tool Poisoning Attack (ATPA) keeps the description clean. The tool returns a fake error message that asks the model to read sensitive data, such as SSH keys, to fix the problem.

Scanners read descriptions and schemas before the first call. Results arrive at runtime, after every review has passed.

MCPTox measured the success rate on 20 agents

MCPTox is a tool poisoning benchmark built on 45 live MCP servers and 353 real tools, published on arXiv on 19 August 2025. Its authors generated 1,348 malicious test cases from 3 attack templates across 10 risk categories, then ran them on 20 LLM agent settings. The attack success rate (the share of cases where the agent carried out the poisoned instruction) reached 72.8% on o1-mini. Claude 3.7 Sonnet had the highest refusal rate, under 3%. The authors found that more capable models were more vulnerable, because the attack uses their instruction following. Every MCPTox case places the poison in metadata from a server the agent did not write. For a site, the figure sets a baseline: model alignment refused fewer than 3 poisoned cases in 100, so the controls belong in your server code.

Third party clients and the first party site

The disclosures describe a developer tool host joining servers found in a registry or suggested by a colleague. Your public chat calls one server, the one you deploy. If you are still building it, start with an MCP server for your site. The root cause of tool poisoning is a trust gap between connect time and runtime: descriptions get one review at connection, and results enter the model context with no equivalent check.

Poisoning pathClient joining third party serversSite hosting its only MCP server
Tool descriptions and schemasWritten by an unknown authorWritten by your team, reviewed in your repository
Tool shadowingOne server rewrites another server's toolOne server in the session
Description change after approvalThe server edits text the user approvedA deploy or a dependency update changes it
Tool resultsOutput of a server you do not runYour data, including text visitors wrote

Two rows stay open on a first party server: the results and the changes after approval.

Visitor review cards flowing from a database toward a model, with one poisoned card caught by a filter

Visitor written text inside your tool results

A search or booking tool returns rows from your database, and some of those rows hold text that visitors typed. Product reviews, listing descriptions, support threads, display names and booking notes all reach the model as tool results. A visitor who writes an instruction into a review plants it in every later answer that retrieves that review. On 26 May 2025, Invariant Labs demonstrated the pattern on the official GitHub MCP server. An attacker opened an issue on a public repository. The user asked Claude 4 Opus to look at the open issues. The agent read the injected issue, pulled data from the user's private repositories into context and published it in a pull request on the public repository. The flaw sat outside the GitHub MCP server code. The tool worked as written, and the text it returned carried the attack. Your search tool returns visitor text in the same way.

The author of the poisoned text needs only the right to post a review or a message on your site. The visitor who triggers it is another person, chatting with their own AI account. The model that obeys runs inside that second visitor's session, so every tool the session reaches is within the attacker's range. Our guide on indirect prompt injection traces the same path through your pages and reviews.

Rug pulls in the packages behind your server

A rug pull is a change to a tool or its code after the user approved it. In April 2025 Invariant Labs described it as a server editing a tool description after the client approved the tool. On a first party server the same change arrives through a dependency. The npm package postmark-mcp copied a legitimate Postmark project. Version 1.0.16, released on 17 September 2025, added code that quietly copied every outgoing email to the developer's own server. Koi Security disclosed the backdoor at the end of September 2025, when the package had reached 1,643 downloads in total. Each tool your server wraps from an npm or PyPI package carries that risk at every update. Pin exact versions and review the diff of each update. Hash the tool list your server publishes, so a changed description fails your build.

Guards on tool output against an MCP tool poisoning attack

The MCP specification (version 2025-06-18) states that servers MUST sanitize tool outputs and rate limit tool invocations. Clients SHOULD validate tool results before passing them to the model. Six guards apply those rules to a site's server:

  1. Typed results. Declare an outputSchema and return structuredContent with fixed fields. Cap the length of every free text field.
  2. Separated visitor text. Return reviews and notes in a field labelled as quoted user content, apart from the fields the model acts on.
  3. Stripped markup. Remove tags such as <IMPORTANT>, invisible Unicode characters and markdown links from visitor text before it leaves the server.
  4. Server side authorisation. Check each call against the caller's session in the tool handler. A system prompt instruction does not stop a model that a result has redirected.
  5. Confirmation outside the model. Return a booking or any other write as a proposal that the visitor confirms with a click in your interface.
  6. Logs and rate limits. Log each tool call with its arguments, and rate limit calls per visitor.

Read only tools limit an MCP tool poisoning attack

The specification sets the tool annotation defaults on the risky side: readOnlyHint is false, destructiveHint is true and openWorldHint is true unless the server declares otherwise. Declare readOnlyHint: true and openWorldHint: false on search and lookup tools. Annotations are hints, and clients MUST treat them as untrusted unless they come from trusted servers. Enforce read only access in the database role behind each tool as well. A poisoned result that reaches a read only search tool still shapes the answer the visitor reads. It cannot cancel a booking. Run the full list against our chatbot security testing checklist before launch.

How TensorPass helps you expose tools to a public chat

Our MCP tools guide shows how to serve your site's tools to a chat that runs on the visitor's own AI.

Free components. The AI Connect SDK, the MCP servers, AI Wallet and the site key are free.

Signed packages. The four AI Connect packages are on npm under the @tensorpass scope since 16 November 2026. Their npm provenance ties each package to the commit and the workflow that built it.

Done for you. We make a site AI native in under 24 hours, with a price on quote.

Send vulnerability reports on our code to [email protected].

Before you expose your next tool to a public chat

List every field your tools return and mark the ones a visitor wrote. Pin the dependency versions behind each tool and hash the published tool list. Set read only access on every search and lookup tool, in the annotations and in the database role. Our hub on AI chatbot security for a public website covers the other risks of a chat open to anonymous visitors.

On a server you own, an MCP tool poisoning attack enters through visitor text in results and through dependency updates. Each check above covers one of those two entries.

Also worth reading:

Sources:

Read the quickstartRead the changelog