The Model Context Protocol (MCP) has become a common way to connect AI agents to tools and data. It makes integration easy — and that's exactly why MCP security deserves attention. Every MCP server you connect adds tools your agent can call and text your agent will read. This guide covers the main risks and practical controls, as part of our wider AI agent security series.

How MCP changes your attack surface

An MCP client (your agent) connects to MCP servers, which describe the tools they offer. The agent reads those descriptions, decides which tools to call, and reads the results. That means MCP servers influence your agent in two ways: through the tools they expose and through the text — descriptions and outputs — that lands in the model's context.

The main MCP security risks

Tool poisoning

Malicious instructions hidden in tool descriptions, parameter schemas or tool outputs that manipulate the agent. Because the model sees descriptions from all connected servers, one bad server can influence how the agent uses the others. It's a form of prompt injection.

Rug pulls

A server changes its tool definitions after you've reviewed and approved it. The tool you vetted isn't the tool you're running.

Confused deputy

A server performs actions with its own broad privileges rather than the requesting user's. The MCP specification's security guidance addresses this for proxy servers, which must obtain per-client consent.

Token passthrough

Servers that forward client tokens to downstream APIs without validating them. The MCP specification says servers must not accept tokens that weren't explicitly issued for them.

Over-broad tools

A server exposes an entire API when the agent needs one read-only endpoint — a classic least privilege failure.

MCP security best practices

  1. Inventory and vet servers. Treat each MCP server like a third-party dependency: who maintains it, what it can access, how it authenticates.
  2. Pin and monitor tool definitions. Alert when descriptions or schemas change after approval.
  3. Authenticate remote servers. Use the specification's authorization approach for anything exposing non-public tools, and never pass user tokens through to unrelated APIs.
  4. Validate tool outputs. Treat results as untrusted input before they reach the model.
  5. Check every tool call against policy. Whatever a server's description says, the call itself — tool, arguments, user, environment — should pass your rules before it runs.
  6. Require approval for high-impact MCP tools. Writes, deletes, payments and outbound messages go to a person.
  7. Log calls across all servers. One audit trail for every tool call, regardless of which server provided it.

The official MCP specification includes a security best practices page, and OWASP publishes an MCP Security Cheat Sheet — both worth reading in full; requirements differ by specification version.

Policy at the tool-call layer

Most MCP risks end the same way: the agent calls a tool it shouldn't, or with arguments it shouldn't. A policy checkpoint on tool calls catches those outcomes regardless of how the agent was misled — a poisoned description can change what the agent asks for, not what your rules allow. See how LLM function calling security applies the same idea.

Where Gaten fits

Gaten sits in the path of agent tool calls and checks each one against your policy before it runs — allow, deny, or require approval — with a record of every decision. Talk to us about the MCP setups you run. See how it works.

Frequently asked questions

What is MCP security?

The practices that protect AI agents using Model Context Protocol servers: vetting servers, controlling authentication, treating tool descriptions and outputs as untrusted, and checking tool calls before they run.

What is MCP tool poisoning?

Hidden instructions in an MCP tool's description, schema or output that manipulate an agent into misusing tools or leaking data.

Are MCP servers safe to use?

Many are well built, but each one extends what your agent can do and read. Vet them like dependencies and control the calls your agent makes through them.