
MCP security comes down to one shift: once an assistant can call tools, a bad instruction is no longer just a bad answer — it can become an action. The Model Context Protocol itself ships sane building blocks (scoped credentials, OAuth-based authorization for remote servers, explicit tool approval in clients), but the defaults that keep a deployment safe are yours to set. This guide is the practitioner checklist: what actually goes wrong, and the ten practices that prevent most of it.
It assumes you know what an MCP server is; if you are still choosing servers, start with the trust criteria in our server shortlist.
Three ingredients make an AI deployment dangerous, and security researchers such as Simon Willison have popularized the pattern as the "lethal trifecta": access to private data, exposure to untrusted content, and a channel that can send data out. An assistant with MCP servers frequently has all three — it reads your documents, it browses or ingests content other people wrote, and it can call tools with side effects. None of the practices below remove one ingredient completely; together they keep the three from combining quietly.
Credential design is the highest-leverage security decision in an MCP deployment, and it is entirely in your hands before any threat shows up.
.mcp.json files are checked into version control — teammates supply their own tokens), and treat any token that touched a chat window or a screenshot as burned.Remote MCP servers speak Streamable HTTP, and the 2025 revisions of the specification classified them as OAuth resource servers — meaning proper authorization flows with PKCE rather than ad-hoc header schemes, and tokens issued for one server that must not be forwarded to another. The spec's own security best practices document reads like an incident postmortem written in advance — confused deputy, token passthrough, session hijacking, each with required mitigations. Three practical consequences:
Anything a tool returns can contain instructions aimed at the model — a web page, a shared document, an issue comment, even a filename. Injection is not exotic; it is the routine failure mode of tool-using assistants.
The ecosystem's strength — thousands of community servers — is also its main soft spot. Documented attack patterns include tool poisoning, where a server's tool descriptions carry hidden instructions for the model; rug pulls, where a benign server changes behavior after an update; and tool shadowing, where one server's tool names impersonate or intercept another's. None of this is hypothetical: the ecosystem's most-cited vulnerability so far, CVE-2025-6514 (July 2025), was a critical remote-code-execution flaw in mcp-remote — the widely used bridge that connects stdio-only clients to remote servers — through which a malicious server could run commands on machines that connected to it. The plumbing needs the same vetting as the servers. Security platforms such as Aikido can help teams identify and manage vulnerabilities across their software environments.
Operational hygiene — logging, rotation, and a reviewed allowlist — is what turns an eventual MCP incident from a mystery into a report.
As a concrete reference: connecting an AFFiNE workspace to Claude Code issues a credential that reaches exactly one workspace with the requesting user's permissions, defaults to read-only (write capability is rolling out separately and stays off this checklist), expires on a date you set, and revokes per client without touching other connections. Search returns bounded passages with document or canvas locators rather than raw exports. Whatever server you deploy, those five properties — scope, default-deny writes, expiry, per-client revocation, bounded outputs — are the shape to insist on.
They are as safe as their scoping and provenance. First-party servers with workspace-scoped, expiring, read-only-by-default credentials are a well-contained risk; unvetted community servers with broad tokens and write access are not. The protocol provides the mechanisms, but the deployment choices above decide the outcome.
Prompt injection is untrusted content — a web page, shared document, or tool output — carrying instructions that steer the model into unintended actions. With MCP the stakes rise because actions are real tool calls. Defenses: confirmation gates on consequential tools, separating research sessions from acting sessions, and bounded tool outputs.
Yes. The specification's 2025 revisions define authorization for remote servers with the server classified as an OAuth resource server, PKCE in the flow, and tokens audience-bound to one server. Single-tenant deployments often use workspace-issued bearer credentials instead, which provide equivalent scoping and revocation for a private endpoint.
Check who maintains it and how recently; read the declared tools and their descriptions (they enter your prompt surface); confirm the credential model supports scoping, expiry, and revocation; and prefer registry or verified-directory installs over pasted commands. After connecting, keep an eye on tool-list changes across updates.
A documented attack where a server's tool names or descriptions embed hidden instructions that the model reads as guidance — for example, a description quietly telling the assistant to exfiltrate context. Mitigations are provenance checks, reading tool lists before and after updates, and preferring first-party or verified-publisher servers.
It is an authorization failure in proxy-style servers: an MCP server that fronts a third-party API using one static client ID can be tricked into exercising its authority for the wrong client, letting an attacker ride a consent the user granted once and walk away with an authorization code. The specification's security best practices require per-client consent in exactly this architecture — worth confirming before relying on any community proxy server.
Local ones, ideally yes: a stdio server is a process with your user privileges, so running community servers in a container — or otherwise restricting their filesystem and network access — caps what a compromise can reach, and the specification recommends clients sandbox spawned servers with minimal default privileges. For remote servers the equivalent control is scoping: a hosted endpoint never executes on your machine, so containment lives in what the credential can reach.
Security here is mostly the discipline of unglamorous defaults: smallest scope, shortest life, fewest tools, gates on. Set those once, and the connected-assistant setup that felt risky becomes the one you can actually reason about — starting with a server whose defaults already look like this.