Discover

· 7 min read

Malicious MCP Servers: Treat Every Server as Code You Run

An MCP server runs with the agent’s access. Version pinning, code review, controlled updates, and configuration limits govern what can change and what hostile code can reach.

Summarize withClaudeChatGPT

Approving a Model Context Protocol (MCP) server once does not freeze the tool descriptions, results, or software that an agent later receives. The available tool set can change under the MCP tools specification, version dated 28 July 2026, which diagrams a later request for the tool list. For a data platform lead, a hostile local server can use the process access that standard input/output (STDIO) leaves unrestricted across files, networks, and credentials. The common view is that an MCP server is a plugin, so installing it is a setting, not a code change. Installation and updates decide what code executes, while version-controlled limits decide what that code can reach.

What is a malicious MCP server?

A malicious MCP server is a server an agent connects to that acts against the user. It can be hostile at installation or become hostile after its tools, outputs, code, or dependencies change. This differs from a legitimate server with broad access, which can expose resources without acting against the user.

An MCP server supplies tool definitions through tools/list and returns structured or unstructured results. It can also announce a changed tool list. Transports carry these protocol messages. The MCP authorization specification, version dated 28 July 2026, governs client requests to restricted servers at the transport level. Authorization does not establish that an authorized server behaves as the user expects.

Keep hostile server behavior separate from vulnerable software, malicious instructions in returned content, and broad permissions. These cases can combine, but they enter through different paths. Tool poisoning starts with the definitions that reach the model before a tool runs.

How does MCP tool poisoning work?

Tool poisoning uses instructions hidden in server-supplied metadata to steer the model before execution. The server supplies tool names, descriptions, schemas, parameter descriptions, and annotations. The MCPTox benchmark paper explains that tool names and natural-language descriptions enter model context through the MCP host. The host contains the agent and connects it to servers. The model treats the poisoned description as part of the tool’s capabilities, and the agent can then call another tool.

The MCPTox benchmark tested this mechanism on authentic tools from live MCP servers. One poisoned description told the agent to call a separate file tool and read a private SSH key. Another changed the recipient passed to an email tool. Success meant the agent called a legitimate tool to perform the poisoned instruction. It did not establish that the key was disclosed or the email was delivered.

The table gives the experiment’s scale and measured results across large language model (LLM) agents.

MeasureResult
Live MCP servers45
Authentic tools353
Malicious test cases1,348
Attack templates3
LLM-agent settings20
Mean attack success rate36.5%
Highest result, o1-mini72.8%
Highest refusal rateLess than 3%

A server can also announce a changed tool list after approval. The specification diagrams a new request for the tool list after the notification. Malicious tool output follows a different path: it reaches the model after execution rather than through pre-execution metadata.

How else can an MCP server turn hostile?

Hostile behavior can enter through changed software, a typosquatted package, malicious instructions in tool results, or exposed credentials. The Open Worldwide Application Security Project (OWASP) MCP Top 10, currently a beta release as of 27 November 2026, treats these as distinct security problems.

This table shows where each path enters, what it can reach, and why initial approval does not stop it.

Attack pathEntry pointReachWhy approval misses it
Rug pullTool definition or software updateModel behavior or executable actionsThe approved state can change
Typosquatted packagePackage installationProcess files, networks, credentialsIt is hostile when installed
Prompt injection in tool resultsTool result after executionModel or agent behaviorApproved output remains untrusted
Credential or token theftServer process or environmentSystems allowed by the credentialApproval leaves secrets available

Why is an approved server still a code dependency?

An approved server remains a code dependency because its package and dependencies execute inside a trusted path. Approval records one decision at one time. Public-registry packages still require review, and package integrity requires separate evidence such as checksums or code signing.

A pinned component version avoids a floating latest reference that can resolve to an unexpected release. Signatures, hashes, attestations, and provenance answer other questions about integrity and distribution. No single signal establishes continuity across the package, dependencies, tool definitions, and later behavior.

Review covers server source code and tool definitions. The install path shows the exact local command, while dependency scans find known vulnerabilities. Review also covers tool descriptions, parameter names and types, and return schemas. A changed package, dependency, manifest, schema, or tool definition repeats the dependency decision. A change to executable code or tool text belongs in review before execution. These controls do not set what the code can access after execution.

What does each boundary stop?

Software controls govern what runs and changes. Access controls govern what executing code can read or change. Software controls identify selected code or expose a change before execution. Access controls remove systems and operations from the code’s runtime reach.

When user intent is “Read”, policy can block delete and write tool calls while permitting reads. A fine-grained scope such as repo:write:branch=feature/* rather than repo:write still permits changes on matching branches. The MCP security guide explains how credential resources and privileges set the maximum systems and actions available to an agent. Permitted tool output can still influence model behavior.

Neither set of controls makes hostile behavior impossible. Tool results returned to the client and model can contain untrusted instructions even when the server was approved. Permitted reads can still expose sensitive data. The same guide covers authorization, credentials, approvals, and evidence about the potential impact of a tool call.

How does dltHub bound a diagnostic agent?

dltHub bounds the job-inspector agent, currently in public preview, as of 30 October 2026, through an access profile, model, and maximum turns. It reports evidence and a proposed fix for a person to apply. It can inspect these evidence sources:

  • the selected run record, logs, and trace;
  • the job definition;
  • workspace files;
  • platform telemetry;
  • upstream job information; and
  • a redacted view of secrets and variables.

The diagnostic scope ends with evidence and a proposed fix. Job-inspector has no shell, destination-data access, or permission to edit code, deploy, cancel, or rerun a job. On the platform, its default access profile keeps production credentials out of its environment. The documented configuration fixes the trigger, required profile, model, and maximum turns:

inspector = run.agent( "dlthub-platform:job-inspector", trigger="job.fail:tag:ingest", require={"profile": "access"}, model="sonnet", limits={"max_turns": 20}, instructions="focus on the loader step", )

This example shows how configuration limits one diagnostic agent. It does not imply that the agent evaluates third-party MCP server packages.

Server changes remain code changes

Installation and every later update remain code changes owned by the team.

FAQ

Is tool poisoning the same as prompt injection?

Tool poisoning places malicious instructions in metadata loaded before execution. Malicious instructions in tool output arrive after execution. Both can influence the model or agent, but they use different delivery stages.

Can the user see a poisoned tool description?

The server sends descriptions and schemas to the client. The MCP specification does not require the client to display the complete description or use a specific interface. Visibility therefore depends on the client’s presentation.

Book a call to walk through dltHub on your data stack.

Was this page helpful?