MCP Security: What Developers Need to Secure Before Connecting AI to Tools

MCP solved a real integration problem — connecting AI applications to tools and data through a common interface — and in doing so created a new, concentrated attack surface at exactly that connection point.

Processor chip on a dark circuit board
Photo by Igor Omilaev on Unsplash

The Model Context Protocol (MCP) solved a real, practical problem: giving AI applications a common, standardized way to connect to external tools and data sources, rather than every integration being built as a one-off. That standardization is exactly why it also created a concentrated new attack surface — every MCP server a client connects to can shape what the model reads, act using whatever credentials it’s been handed, and feed the model text that gets treated as trustworthy context. Securing an MCP integration means addressing several distinct problems, not one.

Server trust: what you’re actually connecting to

An MCP server, especially one pulled from a public registry of community-built servers rather than built or audited in-house, is code you’re granting real access to — file systems, APIs, credentials, sometimes shell execution. Treating an MCP server with the same scrutiny you’d apply to any third-party dependency with that level of access (reviewing its source where feasible, understanding what it actually does versus what it claims to do, keeping it updated and monitoring for known issues) is a baseline that a surprising amount of early MCP adoption has skipped, largely because the ease of connecting a new server outpaces the instinct to audit it first.

Tool poisoning: malicious instructions hidden in tool definitions

This is a distinct and MCP-specific variant of prompt injection, covered in more depth separately, but worth naming here as a core MCP-specific risk category: the tool descriptions an MCP server advertises — the metadata telling the AI what a tool does and how to use it — are fed directly into the model’s context. A malicious or compromised server can embed hidden instructions in that metadata rather than in any actual tool output, meaning the act of simply connecting to and listing a malicious server’s tools can influence agent behavior, before any tool is even called.

Prompt injection through tool results

Separate from poisoned tool definitions, the actual data a tool returns — a file’s contents, an API response, a search result — is also untrusted content from the model’s perspective, and can carry the same kind of injected instructions as any other externally sourced content an LLM processes. An MCP server that queries an external, attacker-influenced data source (scraping arbitrary URLs, for example) can pass injected content straight into the model’s context as if it were a legitimate tool result.

Credential scope: what the server can actually do on your behalf

MCP servers frequently need real credentials to do their job — an API key, a database connection, a token with specific permissions. The scope of those credentials determines the actual ceiling of damage from a compromised or manipulated server: a server with a narrowly scoped, read-only credential for one specific resource has a bounded worst case; one holding a broad, admin-level credential “because it was easier to configure” does not. This is the same least-privilege principle applied everywhere else in security, applied specifically to the credentials backing each MCP server your application uses.

The confused deputy problem, MCP-specific

A well-documented failure pattern: an MCP server accepting a token issued for a different service and using it directly, or forwarding a client’s token on to an upstream API without validating it was actually intended for that purpose. This collapses two separate trust boundaries into one, and it’s specifically what the MCP authorization specification’s audience-binding requirements exist to prevent — a token minted for one resource server should be rejected by any other resource server it’s presented to, and an MCP server correctly implementing this check is what actually closes this particular gap, rather than authentication alone.

Where the MCP specification puts real weight on human oversight

The specification is explicit that, for trust and safety, there should always be a human in the loop with the ability to deny tool invocations — but this is phrased as a “SHOULD,” not a hard requirement, and plenty of real deployments configure agents to invoke tools with more autonomy than that guidance anticipates, precisely for the convenience and speed autonomous operation offers. Treating that human-in-the-loop guidance as a real design requirement for consequential tool calls, rather than an optional nicety, is a meaningful part of actually securing an MCP-connected agent rather than just wiring one up.

A practical starting checklist

  • Audit any MCP server before connecting it, with the same scrutiny you’d apply to a third-party dependency with real system access
  • Treat both tool definitions and tool call results as untrusted, potentially adversarial content
  • Scope credentials given to each MCP server as narrowly as its actual function requires
  • Validate token audience explicitly if your MCP server implementation handles its own authorization, rather than passing tokens through to upstream services unchecked
  • Build human confirmation into any tool invocation with real, consequential impact, rather than defaulting to full autonomy for convenience

MCP itself isn’t insecure by design — the protocol includes real authorization mechanisms, covered in more depth separately. The risk concentrates in how quickly and easily it lets a developer wire an AI application into real systems, often faster than the corresponding security review keeps pace.

AI Security