Safeguard
Security Guides•

Local or remote MCP server: which is riskier to run?

Local MCP servers run code on your machine, remote ones hold your data elsewhere. A comparison of risks, controls and when each is the better choice.

Safeguard Security Team
3 min read

Neither is simply safer. A local MCP server runs code with your privileges, so the risk is what that code can touch. A remote server runs elsewhere, so the risk is what it can see, what tokens it holds and who else can reach it. Match your controls to the type.

Local servers

A local server is a program you download or write and run on your own machine, usually over stdio. The MCP security best practices page lists the main risks: a malicious startup command in a configuration, a malicious payload inside the server, and an insecure server left running on localhost that an attacker reaches through DNS rebinding.

The consequences it names include arbitrary code execution with client privileges, no visibility into what commands run, obfuscated commands, data exfiltration and data loss.

Controls that help:

  • Show the full command before a one-click install, and require explicit approval.
  • Run servers in a sandbox with minimal default privileges, such as a container.
  • Prefer stdio, which limits access to the client. If you use local HTTP, require a token or a restricted socket.
  • Pin package versions and read the source of anything that touches secrets.

Remote servers

A remote server runs on someone else's infrastructure, or yours, and clients reach it over HTTP. Risks shift to authentication, authorization and data handling. The same page covers token passthrough, confused deputy attacks in proxy servers, and server-side request forgery when clients fetch URLs supplied by a server.

OpenAI's MCP documentation adds practical ones: any server can receive sensitive data that appears in a query, a server may ask for broader parameters than it needs, and untrusted content from one server may be used to steer calls to another.

Controls that help:

  • Prefer official servers hosted by the service provider, and verify the URL.
  • Use OAuth with narrow scopes.
  • Restrict who can reach servers holding sensitive data.
  • Disable tools you do not need, and keep approval on for writes.

A side by side view

  • Where does code run?. Local: Your machine. Remote: Provider or your cloud.
  • Main risk. Local: Code execution, file access. Remote: Data exposure, token misuse.
  • Key control. Local: Sandbox and package trust. Remote: OAuth scopes and vendor trust.
  • Who patches it?. Local: You. Remote: The operator.

How to choose

Use local for tools that need your files and that you can audit. Use remote when a reputable provider offers an official server and you can scope the access. Whichever you pick, keep a list of what is installed, and read securing MCP servers: a practical checklist.

Safeguard's MCP Guardrail is designed for governing which MCP tools agents may use, described in MCP Guardrail and agent identity.

Quick check

Is a local server safe because it never touches the internet?

No. It can still read your files and run commands, and a compromised package can do harm without network access to you.

Is an official remote server automatically safe?

It lowers the trust question but not the prompt injection and data exposure risks. Scope tokens and review writes.

Sources

Last reviewed: 19 October 2026.

Never miss an update

Weekly insights on software supply chain security, delivered to your inbox.

Self-healing security runs on Safeguard.

Your first fix PR is minutes away.

No sales call required, even your agent can complete the purchase over MCP.