MCP server security: what a server can reach and what to check before you connect it
GuideBy Lucas Matías García TorresUpdated Data checked 6 min read
Reviewed on . How we work.

Short answer
MCP server security on October 28, 2026: a local MCP server is an ordinary program that runs with your account's permissions, can read your files and environment variables and can reach the network, and the protocol does not sandbox it. Three documented incidents show the risk: critical flaws in MCP Inspector and mcp-remote in 2025 and a fake postmark-mcp package that copied its users' emails. Before you connect a server, check who publishes it, pin its version, read its tool list, keep a person approving tool calls and run it in a container with only the folder and secrets it needs.
Prices and limits change often: check the vendor's page before you pay. How we make money.
MCP server security comes down to one fact: a Model Context Protocol server is code that you let an agent use on your behalf, with whatever access you give it. A local server runs on your computer with your account's permissions, and every server you add can influence how the agent uses all the others. The MCP project's own documentation says no check proves what a server will do. This guide explains the real risks, with three documented incidents, and gives a checklist built from the MCP specification, the MCP project's guide to local server security, Anthropic's Claude Code documentation and OWASP, all read on October 28, 2026. If you are new to the protocol, start with what MCP is.
What a server can reach
Most servers you install yourself run locally over stdio: your app launches them as an ordinary child process of your user account. According to the MCP documentation, that process inherits your environment variables, can read anything your account can read, from SSH keys and cloud credentials to browser profiles, and can open outbound network connections to anywhere. The protocol does not sandbox it. The client and a stdio server share one trust domain, so the real decisions happen before launch: what you install and how you run it.
The risk also adds up. All your servers share the same model context, so a malicious server can influence how the agent uses the tools of every other server. Remote servers run nothing on your machine and use the protocol's authorization flow instead of a token in a local file, but they bring their own risks around tokens and permissions, which the specification's security best practices cover.
Five ways it goes wrong
The MCP project's local security guide lists five threats:
- A malicious server. A typosquatted package, a lookalike repository or an abandoned project taken over by someone new, which works as advertised while stealing your files or environment.
- An overcollecting server. A legitimate server that collects more than its job needs. Hidden instructions in content it reads can push an honest server into the same overreach, the attack explained in our guide to prompt injection.
- A compromised dependency. The author is honest, but one package in the server's dependency tree was hit by a supply chain attack.
- A poisoned tool catalogue. Tool names and descriptions are instructions the model reads, so a server can hide directives in them that steer the agent, even towards other servers' tools, without the poisoned tool ever being called. A server can also change its definitions after you approve it.
- A vulnerable server or bridge. An unmodified, legitimate component with a security flaw can be the way in.
These are not hypothetical.
Table: three documented MCP security incidents (NVD records and Postmark's alert, checked October 28, 2026)
| Date | Component | What happened | Type |
|---|---|---|---|
| June 13, 2025 | MCP Inspector, a developer tool, below version 0.14.1 | Remote code execution through a missing authentication step between its client and proxy, rated 9.4 out of 10 (critical) by GitHub under CVSS 4.0 | Vulnerable tool |
| July 9, 2025 | mcp-remote, a bridge to remote servers | Operating system command injection when connecting to an untrusted server, rated 9.6 out of 10 (critical) | Vulnerable bridge |
| September 25, 2025 | A fake postmark-mcp package on npm | It built trust over 15 versions, then version 1.0.16 secretly copied users' emails to an external server | Malicious server |
The dates of the two vulnerabilities are when the NVD published them; the third is the date of Postmark's alert, which says Postmark had nothing to do with the package.
Checklist before you connect a server
Where it comes from
- Ask whether it needs to run locally. A server that only wraps an internet service gains nothing from running on your laptop. The MCP guide recommends the remote version when a server needs none of your files, local tools or local network.
- Identify the publisher and check the exact package name. Tie the package to a real repository and maintainer; typosquatting is the cheapest attack there is.
- Pin the version, and know what the pin covers. Pinning with npx or uvx fixes only the top-level package, not its dependencies; pinning a container image by digest freezes the whole tree. Update deliberately when an advisory lands.
- Remove the servers you no longer use. If you do only one thing, the MCP guide says, open your app's MCP configuration and remove the servers you no longer use.
What it can do
- Read the tool list before you rely on a server. If a description contains instructions that have nothing to do with the tool's job, remove the server, and prefer a client that asks again when a tool definition changes.
- Keep a person in the loop. The specification says there should always be a human able to deny tool calls, and clients must treat tool annotations, the labels that describe what a tool does, as untrusted unless the server is trusted. Our guide to function calling explains how those calls work.
- Give it the least agency possible. OWASP's advice on excessive agency is to offer only the tools a task needs, with only the functions it needs, to avoid open-ended tools such as running a shell command or fetching any URL, to keep permissions minimal and to require approval for high-impact actions. A server that summarises email only needs to read it, not send or delete it.
How it runs
- Isolate it. The MCP guide ranks process isolation above every other mitigation it describes: run third-party servers in a container with nothing mounted except the directory they need, and with no network at all if they do not need one.
- Give each server its own secrets. Pass credentials per server in your client's configuration instead of exporting them in your shell profile, use narrowly scoped tokens and your system's secret store, and remember that folders such as .ssh and .aws are credentials too.
- Grant the narrowest folder, read-only where you can. Folder allowlists in a configuration file only bind honest servers; the isolation layer is what enforces them.
- Do not trust localhost. Bridges, development tools and other MCP components that listen on a port can be reached by other programs on your computer and, through your browser, by websites. The MCP guide warns that binding them to 127.0.0.1 is not an authentication boundary: they need real authentication, origin checks and prompt updates when advisories land.
In Claude Code and other apps
Anthropic's Claude Code documentation tells you to verify that you trust each server before connecting it, and warns that servers that fetch external content can expose you to prompt injection. It asks for approval before using servers defined in a project's .mcp.json file, and a cloned repository cannot approve its own servers. Under the specification, any app that offers one-click installation of a local server must show the exact command that will run, mark it as a potentially dangerous operation and ask for explicit approval. Our guide to connecting an MCP server shows where each app keeps its server list.
If something goes wrong
Remove the server, then rotate every credential it could reach, not only the ones you gave it. Postmark's advice after the fake package was to remove it, check email logs for suspicious activity and rotate any credentials that may have been sent by email. If you build your own agents, the same rules apply to the tools you give them, as our guide on how to build an agent explains.
How we checked
On October 28, 2026 we read the security best practices and the tools section of the MCP specification (revision 2026-07-28), the MCP project's guide to local server security, the MCP page of Anthropic's Claude Code documentation, OWASP's entry on excessive agency, the NVD records for CVE-2025-49596 and CVE-2025-6514, and Postmark's alert about the fake postmark-mcp package. We have not audited any MCP server ourselves.
What we checked
- The MCP project's Local Server Security guide says a local server launched over stdio is an ordinary process that inherits the user's environment variables, can read whatever the account can read, including SSH keys, cloud credentials, browser profiles and the home directory, and can open outbound network connections; stdio is not a sandbox, client and server share one trust domain, and that trust is cumulative across every configured server; it lists five threats: a malicious server, an overcollecting server, a compromised dependency, a poisoned tool catalogue (tool poisoning and tool shadowing, which work without the poisoned tool ever being invoked, and rug pulls that change definitions after approval) and a vulnerable server or bridge; it says no check proves what a server will do. (Model Context Protocol, )
- The same guide's main tip is to open the client's MCP configuration and remove the servers you no longer use; it recommends the remote version where one exists and whenever a server needs none of your files, local tools or local network; checking the publisher and the exact package name; pinning versions, noting that npx or uvx pin only the top-level package while a container image digest pins the whole tree; reading tool definitions and preferring clients that pin them; process isolation in a container with no extra mounts as the single highest-leverage mitigation; per-server credentials instead of tokens exported in the shell profile; the narrowest folder, read-only where possible; no network where possible; and it warns that binding local bridges and development tools to 127.0.0.1 is not an authentication boundary, so they need real authentication, origin validation and prompt updates. (Model Context Protocol, )
- The Security Best Practices of the MCP specification (revision 2026-07-28) cover confused deputy attacks, token passthrough, server-side request forgery, local MCP server compromise and several authorization risks, and say that clients offering one-click configuration of a local server MUST show the exact command without truncation, clearly mark it as a potentially dangerous operation, require explicit user approval and let the user cancel. (Model Context Protocol, )
- The Tools section of the MCP specification says there SHOULD always be a human in the loop with the ability to deny tool invocations, and that clients MUST consider tool annotations to be untrusted unless they come from trusted servers. (Model Context Protocol, )
- Anthropic's Claude Code MCP documentation tells users to verify they trust each server before connecting it and warns that servers that fetch external content can expose them to prompt injection risk; servers defined in a project's .mcp.json file need approval before use, a cloned repository cannot approve its own servers, and approvals can be reset with claude mcp reset-project-choices. (Anthropic (Claude Code docs), )
- OWASP's LLM06:2025 Excessive Agency entry names excessive functionality, excessive permissions and excessive autonomy as root causes and recommends minimising extensions and their functionality, avoiding open-ended extensions such as running a shell command or fetching a URL, minimising extension permissions, executing extensions in the user's context and requiring user approval for high-impact actions. (OWASP GenAI Security Project, )
- The NVD record for CVE-2025-49596, published June 13, 2025, describes remote code execution in versions of MCP Inspector below 0.14.1 caused by the lack of authentication between the Inspector client and proxy, scored 9.4 (critical) under CVSS 4.0 by GitHub, the only score in the record; the NVD has not added its own. (NIST National Vulnerability Database, )
- The NVD record for CVE-2025-6514, published July 9, 2025, describes OS command injection in mcp-remote when connecting to untrusted MCP servers, through crafted input from the authorization_endpoint response URL, scored 9.6 (critical) under CVSS. (NIST National Vulnerability Database, )
- Postmark's alert of September 25, 2025 says a postmark-mcp package on npm, which Postmark did not develop, authorize or have any involvement with, built trust over 15 versions before version 1.0.16 added a backdoor that secretly sent BCC copies of emails to an external server; Postmark had not published its own MCP server on npm before the incident, and it advised removing the package, checking email logs for suspicious activity and rotating credentials that may have been sent by email. (Postmark, )
What may change
- The MCP specification, its security guidance and the approval features of each app change often, and new vulnerabilities in MCP components keep being published. This page is reviewed every quarter.
Frequently asked questions
What can a local MCP server access?
Whatever your user account can reach: your environment variables, files such as SSH keys, cloud credentials and browser profiles, and outbound network connections, because the stdio transport is not a sandbox.
What is tool poisoning?
Hiding instructions in a tool's name or description, which the model reads as text. They can steer the agent, including how it uses other servers' tools, without the poisoned tool ever being invoked.
Sources
- Local Server Security: threats, provenance, untrusted tool definitions, isolation, credentials and network, Model Context Protocol. Accessed October 28, 2026.
- Security Best Practices (MCP specification, revision 2026-07-28): confused deputy, token passthrough, SSRF, local server compromise and one-click install consent, Model Context Protocol. Accessed October 28, 2026.
- Tools (MCP specification, revision 2026-07-28): human in the loop, tool annotations and security considerations, Model Context Protocol. Accessed October 28, 2026.
- Connect Claude Code to tools via MCP: server trust, prompt injection warning and project approvals, Anthropic (Claude Code docs). Accessed October 28, 2026.
- LLM06:2025 Excessive Agency (OWASP Top 10 for LLM Applications), OWASP GenAI Security Project. Accessed October 28, 2026.
- CVE-2025-49596: remote code execution in MCP Inspector below 0.14.1 (published June 13, 2025), NIST National Vulnerability Database. Accessed October 28, 2026.
- CVE-2025-6514: OS command injection in mcp-remote when connecting to untrusted MCP servers (published July 9, 2025), NIST National Vulnerability Database. Accessed October 28, 2026.
- Information regarding the malicious postmark-mcp package (September 25, 2025), Postmark. Accessed October 28, 2026.
Spotted an error or an outdated price? Tell us and we will fix it.
Change history
- : First published. Checked against the MCP specification and the MCP project's security guidance, Anthropic's Claude Code documentation, OWASP, two NVD records and Postmark's alert on October 28, 2026.
Next review: .
Part of our Agents & Automation guide.
Keep reading
- What is MCP (Model Context Protocol)?
What the Model Context Protocol is, how hosts, clients and servers work, what tools, resources and prompts are, and the security rules the MCP spec sets.
- How to add an MCP server to Claude, Claude Code, VS Code and ChatGPT
How to add an MCP server to Claude, Claude Desktop, Claude Code, VS Code and ChatGPT, remote or local, and the security checks to make before you connect.
- What is prompt injection, and why can't model makers fix it?
Prompt injection explained: how direct and indirect attacks hijack chatbots and agents, and why OWASP and the UK NCSC say it can only be reduced, not fixed.
- Function calling: how a language model uses your tools
Function calling explained: how a model asks your code to run a tool, the settings OpenAI, Anthropic and Google offer, what it costs and how many tools to give.
- How to build an agent: a tested example in five steps
How to build an agent without a platform: when you need one, tools and tool calling, a tested 60-line example, guardrails, costs and when to add a framework.
- Agent SDKs compared: OpenAI Agents SDK, LangGraph and Claude Agent SDK
Agent SDK comparison: license, languages, models, built-in tools, approvals and tracing in the OpenAI Agents SDK, LangGraph and the Claude Agent SDK.
Other topics

Assistants & Chatbots
21 guides

LLM APIs & Costs
16 guides

Local Models & Hardware
16 guides

Language Models Explained
18 guides