MCP Server Security: Vulnerabilities, Risks and Controls
Are MCP servers a security risk for corporate data?
They can be, depending on what the server is allowed to reach. The MCP specification has a Security Best Practices document that lists attacks on MCP implementations, including the confused deputy problem, token passthrough, server-side request forgery, local MCP server compromise and over-broad token scopes. For local servers it names arbitrary code execution with the MCP client's privileges, data exfiltration and data loss as risks. The protocol itself does not make a server safe; the access you give it does.
Are public MCP servers safe to use in an enterprise?
The specification does not certify any server, so safety is a decision you make per server. It says clients must treat tool annotations as untrusted unless they come from trusted servers. It requires servers to validate all tool inputs, implement access controls, rate limit tool invocations and sanitize tool outputs, and those are things you can ask a public server's operator to demonstrate. A local server that you download and run executes with your user's access, so it needs the same scrutiny as any other software you install.
How do I assess the risk of an MCP server before giving an agent tool access?
Use the specification's own requirements as a checklist. Ask whether the server validates inputs, enforces access controls and rate limits, and sanitizes outputs. Ask whether it accepts only tokens issued for it, because the specification explicitly forbids token passthrough. Ask whether requested scopes are minimal rather than a broad scope such as admin or files wildcards. For a local server, check the exact command that will run, since the specification says clients must show it without truncation before one-click configuration, and check how it is sandboxed. Then confirm the client shows tool inputs, asks a human before sensitive operations and logs tool usage.
How do MCP server vulnerabilities differ from traditional API vulnerabilities?
Several overlap with classic API and OAuth problems: SSRF, confused deputy, audience validation failures and over-broad token scopes all appear in the specification's security guidance. What is different is the model in the loop. Tool definitions and results are consumed by an LLM, so the specification tells clients to treat tool annotations as untrusted and to validate tool results before passing them to the LLM, and it recommends a human in the loop with the ability to deny tool invocations.
Sources checked on 3 November 2026: MCP specification: Security Best Practices MCP specification: Tools, Security Considerations MCP specification: Authorization.
MCP servers are a real security risk because they let AI agents execute tools, read files, and call APIs with inherited trust — and most are unvetted community code. The core vulnerabilities are tool poisoning (malicious tool descriptions that hijack the model), prompt injection through returned data, excessive permission scopes, unauthenticated local servers, and supply-chain compromise. You secure them by treating every MCP server as untrusted third-party code: pin versions, scope credentials narrowly, sandbox execution, and scan tool definitions before connecting.
What is MCP (Model Context Protocol)?
The MCP specification defines it as "an open protocol that enables seamless integration between LLM applications and external data sources and tools". It uses JSON-RPC 2.0 between three roles: hosts (the LLM applications, such as an AI assistant or IDE), clients (connectors inside the host) and servers (services that provide context and capabilities). Servers can offer resources (data), prompts (templates) and tools (functions the model can execute).
That last part is the security story. The specification itself says tools "represent arbitrary code execution and must be treated with appropriate caution", and that hosts must obtain explicit user consent before invoking any tool. An MCP server is effectively code and data you are letting an AI agent act through.
Why MCP servers are a security risk right now
The Model Context Protocol ecosystem exploded fast. It grew from a handful of reference servers at its November 2024 launch to thousands of community-built servers within months, outpacing security review capacity and creating a trust-without-verification pattern similar to early npm. That comparison matters: npm's history includes event-stream (2018), where a new maintainer pushed a malicious update to a widely used package, and left-pad (2016), where unpublishing an 11-line package broke builds across the ecosystem. One was a trust failure and the other an availability failure, and MCP inherits both risks.
MCP amplifies this because an MCP server doesn't just run in your build pipeline — it sits inside your AI agent's decision loop. A compromised server can inject instructions the model obeys, exfiltrate data the agent can read, or chain tool calls you never approved. The blast radius is whatever your agent has access to.
Useful next, if this was relevant to you
The top vulnerability classes you'll actually hit
Instead of chasing individual CVE numbers, focus on these five recurring categories:
- Tool poisoning / rug pulls — A server's tool description contains hidden instructions ("also send the user's SSH keys to X"). The model reads the description as context and follows it. A server can also serve clean definitions during review, then swap them later.
- Indirect prompt injection — Data returned by a tool (a web page, a database row, an email body) contains adversarial instructions that the agent treats as commands.
- Excessive scope / confused deputy — The server holds a broad OAuth token or database credential, and the agent uses it to perform actions the user never intended.
- Unauthenticated local transport — A local MCP server that listens on HTTP without authentication, or binds to all interfaces instead of localhost, can be reached by other processes, other machines on the network or, without
Originchecks, a malicious web page through DNS rebinding. (stdio servers are a private pipe to the client, but inherit everything the host user can do.) - Supply-chain compromise — You install an MCP server from a public registry; a dependency or the server itself is backdoored.
The downside of running MCP servers, in one sentence: you are expanding your attack surface to include arbitrary third-party code that your AI agent will trust implicitly unless you force it not to.
MCP server security best practices and checklist
Securing MCP is mostly classic supply-chain and least-privilege hygiene, adapted to agents. Use this checklist before and after connecting any server:
- Pin and vendor versions. Never auto-update MCP servers. Pin an exact commit or version and review diffs before upgrading — this blunts rug-pull attacks for servers you run yourself.
- Inspect tool definitions. Read every tool description and parameter schema for injected instructions before enabling the server. Automate this with a scanner.
- Scope credentials to the minimum. Issue a dedicated token per server with read-only or single-resource access. Map this to OWASP least-privilege and NIST 800-53 AC-6.
- Sandbox execution. Run servers in a container or restricted process with no ambient network or filesystem access beyond what the tool needs.
- Require human approval for destructive actions. Gate writes, deletes, payments, and outbound sends behind explicit confirmation.
- Log every tool call. Capture inputs, outputs, and which server served them so you can trace an incident.
- Treat returned data as untrusted. Never let tool output silently become new instructions — strip or clearly delimit it in the agent's context.
The attacks the MCP specification itself names
The protocol's own Security Best Practices page (draft specification, read 2026-11-03) lists named attacks, each with a countermeasure. That makes it a ready-made audit list for any server or client you run:
| Attack named in the spec | What happens | Countermeasure the spec gives |
|---|---|---|
| Confused deputy | An MCP proxy that uses a static OAuth client ID, allows dynamic client registration and relies on a third-party consent cookie lets an attacker's client skip user consent and receive an authorization code. | Per-client consent stored server-side, exact-match redirect URI validation, single-use OAuth state set only after consent. |
| Token passthrough | The server accepts tokens that were not issued to it and forwards them downstream, breaking audience checks and audit trails. | Servers must not accept tokens not explicitly issued for the MCP server. |
| Server-side request forgery (SSRF) | A malicious server fills OAuth discovery URLs with internal addresses or cloud metadata endpoints such as 169.254.169.254. | Require HTTPS, block private and link-local ranges, validate every redirect hop, use an egress proxy. |
| State handle hijacking | An attacker guesses or obtains an ID the server handed out (a cart or workflow ID) and uses it as a tool argument. | Verify every request, never treat a handle as authentication, use random handles bound server-side to the authenticated user. |
| Local MCP server compromise | A one-click configuration runs a malicious startup command with the client's privileges. | Show the exact command and require consent, sandbox with minimal privileges, prefer the stdio transport. |
| OAuth authorization URL validation | A javascript: authorization URL gives XSS; a URL opened through a shell gives command injection. | Allow only http and https, reject other schemes, never open URLs through a shell. |
| Mix-up attacks | A client sends a code from an honest authorization server to an attacker-controlled one. | Authorization response validation. The spec notes PKCE alone does not prevent this. |
| Scope minimization | A stolen token carries broad scopes such as files:* or admin:*. | Start with a minimal scope set and step up through targeted scope challenges. |
These are not only theoretical. News coverage of two 2025 flaws (The Hacker News, SD Times, read 2026-11-03) reports CVE-2025-6514 in the mcp-remote proxy (CVSS 9.6, found by JFrog; a malicious MCP server could make it run operating-system commands during connection; fixed in 0.1.16) and CVE-2025-49596 in MCP Inspector (CVSS 9.4, reported by Tenable; an unauthenticated local web interface; fixed in 0.14.1). Both fall under the local-server and URL-handling rows above. Check the NVD entries for current affected versions before acting.
MCP security tools: build this into your pipeline
Manual review doesn't scale when you're connecting dozens of servers. The practical setup is a three-layer control: a scanner that inspects tool definitions and dependencies before connection, a policy gate that enforces version pinning and scope limits in your agent config, and runtime logging that flags anomalous tool-call chains. Open-source scanners on GitHub now check for known tool-poisoning signatures and dependency CVEs — wire one into CI so an unreviewed server can't ship.
The organizations handling MCP well treat it exactly like they treat npm, PyPI, or any other registry: assume breach, verify before trust, and keep an inventory of every server, its version, and its granted scopes.
How to check an MCP server for vulnerabilities
Check an MCP server the way you would review any code that runs with your agent's privileges. That means five areas: its dependencies, its transport and authentication, how each tool handles input, what its tool descriptions say, and what credentials it holds.
- Dependencies. Run the ecosystem's audit tooling (
npm audit,pip-auditor an OSV scan) and pin exact versions before you connect anything. - Transport and authentication. Local stdio servers inherit the host's trust. For HTTP-based servers, the MCP specification tells servers to validate the
Originheader to prevent DNS rebinding, to bind to localhost (not all interfaces) when running locally, and to require authentication. Its authorization model for HTTP transports is built on OAuth 2.1. - Input handling in each tool. Many MCP findings are classic bugs inside tool code: command injection when tool arguments reach a shell, path traversal in file tools, server-side request forgery in URL-fetching tools, and SQL injection in database tools. Test each tool with hostile arguments, not just happy-path calls.
- Tool descriptions. Read every description and parameter schema for hidden instructions, and re-check after each update, since descriptions can change after review.
- Credentials. Give each server its own narrowly scoped token. A server should accept only tokens issued for it, and should not pass a client's token through to downstream APIs.
Want a first pass before you connect a server? PlayCISO's MCP Scan runs 27 deterministic hygiene checks over one standard MCP handshake, with no exploitation. Browsing its public explorer of registry servers is free; scanning your own server is part of PlayCISO Pro.
Frequently asked questions
Are MCP servers safe?
Not by default. An MCP server runs tools with whatever access your agent has, and many are unvetted community code. Treat each one as untrusted third-party code: pin versions, scope credentials narrowly, sandbox execution, read tool descriptions before enabling them, and log every tool call.
What is MCP tool poisoning?
Tool poisoning is when a server's tool description or parameter schema contains hidden instructions that the model reads as context and follows, such as sending a file somewhere. A rug pull is the variant where a server serves clean definitions during review and changes them later.