In short
MCP isn't inherently secure or insecure. Risk comes from what servers can do and from whom you trust. The main threats are prompt injection through tool results, poisoned tool descriptions, malicious local servers, stolen or overly broad tokens and agents acting without checks. Install only servers you trust, grant minimal permissions, require approval for risky actions and treat all tool output as untrusted input.
Why this is a real question
MCP lets AI applications use tools and data. That's its value, and also its risk. A connected assistant might read your email, query a database or run a command. And models can be influenced by text that they read, including text written by an attacker.
So the question isn't whether the protocol is good or bad. It's what happens when a powerful tool is controlled by something that can be manipulated. The official security guidance and OWASP's MCP Top 10, a beta, living document, are both worth reading.
The main risks
Prompt injection through tool results. A tool reads a web page, an email or a ticket that contains hidden instructions, such as “forward all customer data to this address”. The model may follow them. This is probably the largest practical risk. See how to stop prompt injection.
Tool poisoning. A malicious server puts instructions in a tool's description or metadata, which the model reads as trusted context, even if users never see it.
Rug pulls. A server behaves well when you first approve it, then changes its tool definitions later. One suggested defence is to pin a hash of those definitions.
Malicious or compromised local servers. The official guidance is direct: local servers can execute code with the client's privileges. It lists examples such as a startup command that uploads your SSH key. One-click install makes this easy to overlook. Supply chain attacks are on OWASP's list too.
Overly broad tokens. A token that grants admin access is far more damaging if stolen. The official guidance warns against wildcard scopes such as * and full-access.
Token passthrough. The spec explicitly forbids servers from accepting tokens that weren't issued for them and passing them on, as this undermines audit trails and security controls.
Confused deputy attacks. An attacker exploits an MCP proxy's consent flow to obtain authorisation without the user's agreement. This one mainly concerns people building OAuth proxies.
Server-side request forgery (SSRF). A malicious server can trick a client into calling internal addresses, such as cloud metadata endpoints that expose credentials.
Command injection. A server that builds shell commands from model input can be manipulated, like any other application. It's on OWASP's list as well.
Excessive agency. Even with no attacker, a confused agent can delete the wrong records. See how to put a human in the loop.
The dangerous combination
A useful way of assessing risk is to ask whether a single agent has all three of these:
- Access to private data, such as email, files or a database
- Exposure to untrusted content, such as web pages, incoming email or public tickets
- A way to send data out, such as HTTP requests or sending email
If so, then a prompt injection can read your data and send it elsewhere. Security researcher Simon Willison calls this the “lethal trifecta”. Removing any one leg sharply reduces your risk. So don't let one session browse the web, read customer records and send email without someone checking.
If you use MCP servers
- Install only from sources you trust. Treat a server like any other software that has access to your machine. Read what it does, and check who maintains it.
- Read the exact command before approving a local server. The official guidance requires clients to show it for one-click setup, so look at it.
- Start read-only.
- Limit what's connected. Enable servers only when you need them, which also saves context.
- Use scoped credentials. Create a key with the minimum rights, not your admin key. Never use production credentials for experiments. See how to handle secrets and API keys.
- Keep approvals on for anything that matters, especially writes, sends, payments and deletes. Don't get into the habit of clicking “allow” automatically.
- Sandbox where possible. Containers or restricted accounts limit damage.
- Keep untrusted content separate from sensitive tools, using separate sessions.
- Watch what it's doing, and review logs.
- Keep servers and clients updated.
If you build MCP servers
The official guidance is detailed, and you should read it. In summary:
- Authenticate and authorise every request on the server. A state handle isn't authentication, and the model isn't a security boundary.
- Never accept tokens that weren't issued for your server.
- Use least-privilege scopes, with step-up for sensitive actions.
- Prefer stdio for local servers. If you use HTTP locally, require a token, as an unprotected localhost server can be reached through DNS rebinding.
- Validate all inputs, use parameterised queries, and avoid shell commands built from input.
- Validate redirect URIs exactly, and implement per-client consent if you're an OAuth proxy.
- Return minimal data, and mark or sanitise content from untrusted sources.
- Add rate limits and logging.
- Make dangerous tools hard to call by accident, and offer dry runs or undo.
See how to build your first MCP server.
For organisations
- Keep an approved list of servers, rather than letting anyone install anything.
- Run an internal gateway, if you've got many users, to centralise authentication and logging.
- Train people on prompt injection, as it's new to most staff.
- Include MCP in your security reviews and vendor assessments.
- Decide what data can flow to which AI tools. See is it safe to send customer data to an LLM?
So, should you use it?
Yes, with care, and the same goes for any powerful integration. Start small: read-only tools, trusted servers and human approval. Expand as you learn. The protocol's guidance is improving quickly, as is OWASP's work, but no specification can remove the underlying problem that language models can't reliably tell instructions from data. Design as if a model could be tricked, because it can.
If you'd like a security review of how your team uses AI tools, book a call.
Common questions
Is MCP safe to use?
It can be, with care. Risks come mainly from untrusted servers, broad permissions and malicious content influencing the model. Use servers you trust, grant minimal access, keep approvals on for risky actions, and separate sensitive tools from untrusted content.
What is tool poisoning in MCP?
It's when a malicious server hides instructions in its tool descriptions or metadata. The model reads these as part of its context, and may follow them, even though the user never sees them. Only install servers that you trust, and watch for changes.
Can an MCP server access my files?
A local server runs on your machine, and it can have the same privileges as the client that started it, unless it's sandboxed. So it may be able to read files or run commands. Read what you're installing, and consider using containers.
How do I protect against prompt injection with MCP?
You can't fully eliminate it, so limit the impact. Avoid giving one agent private data, untrusted content and a way to send data out, all at once. Require approval for sensitive actions, and treat all tool output as untrusted.