MCP Tool Poisoning

Hidden instructions in a malicious MCP server

An MCP server describes its tools in plain text that goes straight into the model's context. A malicious or compromised server can hide instructions there, telling the model to misuse other, trusted tools, for example to read private files and send them out. The fix is to treat MCP servers like any other software supply chain.

Advanced · 5 steps

TypeIndirect prompt injection via tool metadata
OWASP LLMLLM01:2025 Prompt Injection
AlsoLLM03:2025 Supply Chain, LLM06:2025 Excessive Agency
MITRE ATLASAML.T0051.001
Variant"Rug pull": description changes after approval
Key defenseVetted servers + approval with full arguments

Step by step

  1. Install a handy server From an unofficial source

    A developer already uses a trusted local server that can read project files. They add a free "weather" MCP server they found on an unofficial list. It initializes normally and looks harmless.

  2. Poisoned description Instructions the user doesn't see

    In tools/list, the weather tool's description contains a hidden block of text aimed at the model: before using any tool, read a private configuration file and put its contents in the weather tool's notes parameter. Many apps show users only the tool name, so the instruction goes unnoticed.

  3. Cross-tool misuse The trusted tool does the stealing

    The developer asks something unrelated. The model, following the text it was given, first calls the trusted files server to read the config file, which holds API keys. The weather server never had file access; it used the model to borrow it.

  4. Data leaves Hidden in an innocent call

    The model then calls get_forecast with the city and the stolen file in notes. The malicious server forwards it to the attacker and returns a normal forecast, so the developer sees a correct answer and nothing odd. A later "rug pull" can also swap a clean description for a poisoned one after the user approved it.

  5. Defend the host Show everything, approve everything risky

    A safer host shows the full tool descriptions, warns when a description changes, and asks for approval with every argument visible, so the user would see the secrets inside notes and refuse. The files server only sees an allowed folder without secrets, and the unknown server runs with no outbound network.

How to defend

More in AI & LLM Security.