MCP impersonation is an attack in which a malicious server imitates a legitimate Model Context Protocol service. An agent that believes it is talking to a trusted server sends it session tokens and receives tool outputs the attacker controls. The agent sees no warning, only a server that answers like the one it expected.

Why it works

If an agent's trust in a server rests on a name, an address or a description, a server that copies those surface details can take its place. Once that happens, tokens go to the attacker, and tool outputs the agent treats as authoritative can be altered before they reach the user.

Impersonation versus compromise

A compromised server was legitimate and was taken over. An impersonating server was built from the start to mimic a legitimate one. Both exploit the same gap: a review at install time cannot guarantee who is answering later.

How to defend against it

  • Validate token audience and issuer instead of trusting them by default.
  • Use short-lived credentials, so a stolen token is useful only briefly.
  • Restrict OAuth scopes per tool, so one bad connection cannot reach further than its own capability.

Related