← Blog

MCP servers your team's agents install: run them on the agent's own machine, not the laptop with everyone's keys

A local MCP server runs with the same rights as the client that starts it. What the MCP spec's security guidance says about that, and how to put the coding agent and its MCP servers on a microVM of their own, with no code to write.

Every coding agent on your team picks up MCP servers: one for the issue tracker, one for the database, one for docs, one a teammate found last week. Most of them are local stdio servers, started by a line like npx -y some-package in the agent’s config. That line runs a program from the internet, on the developer’s laptop, as the developer.

This post is about where those servers should run. The short answer is on the agent’s own machine, together with the agent, and not on the laptop that holds everyone’s keys.

What the MCP spec says about local servers

The MCP specification’s security best practices have a section on “Local MCP Server Compromise”. It describes local servers as binaries “downloaded and executed on the same machine as the MCP client” that “may have direct access to the user’s system”. It lists the risks: arbitrary code execution “with MCP client privileges”, no visibility into what commands run, command obfuscation, data exfiltration and data loss. Its example of a malicious startup command is an npx install chained to a curl that posts ~/.ssh/id_rsa to another host.

Among the guardrails it recommends to clients:

  • Warn that MCP servers run with the same privileges as the client.
  • Execute MCP server commands in a sandboxed environment with minimal default privileges.
  • Launch MCP servers with restricted access to the file system, network and other system resources.

Those are recommendations to the client. Most teams cannot wait for every client to implement them, and they can’t audit every server either. What they can control is which machine the client and its servers run on.

Why “just review the package” does not scale

You can read a server’s source before installing it, pin a version and watch for updates. You should. But a team running several agents, each with its own handful of servers, takes on a lot of third-party code, and npx -y fetches whatever version is current each time it starts. Review lowers the risk. Changing the machine changes what a bad server can reach.

Put the agent and its servers on their own machine

A Sandscale workspace is a persistent cloud computer: a Firecracker microVM with its own kernel and its own disk. The workspaces docs say you can run Claude Code, Codex, Gemini CLI or your own agent inside one. When the agent lives there, its stdio MCP servers live there too, because the agent is the process that starts them.

Setting it up uses the CLI, with no code to write. These forms are from the --help of the Sandscale CLI (version 1.4.1):

sandscale workspace templates-list
sandscale workspace create --name agent-tracker --template-id TEMPLATE_ID
sandscale workspace ssh agent-tracker

create makes the workspace and starts it. ssh connects you with a short-lived certificate that Sandscale signs, so you do not add an SSH key. See also the workspace guide. Inside, install the agent the way its own docs describe, clone the repository, and add the MCP servers there, not on your laptop:

# Claude Code (from the Claude Code MCP docs)
claude mcp add --transport stdio tracker -- npx -y PACKAGE

# Codex (from the Codex MCP docs)
codex mcp add tracker -- npx -y PACKAGE

Replace PACKAGE with the server you are adding. See the Claude Code MCP docs and the Codex MCP docs for the other options.

Now a server’s npx install, its startup command and every tool call it makes run in the workspace. Your ~/.ssh, your cloud credentials and your other projects are not on that machine unless you put them there. Give each agent its own workspace, and one agent’s servers cannot see another agent’s files either.

Give the servers only the secrets they need

Most servers need a token: for the tracker, the database or a docs API. Put the minimum on the workspace: a token scoped to the one project, read-only where the server only reads, and short-lived where the service supports it. Claude Code’s own MCP docs make the same point for databases: their DBHub example says to use a read-only database user in the connection string.

Vault keeps secrets out of prompts and logs. A sandbox, workspace or build host references a secret, and Vault injects the value at run time. The docs say sandscale mcp never offers a Vault value to a model. Any process on the workspace, including an MCP server, can read a secret you put there, so scope matters more than storage.

Trying an unknown server in a throwaway sandbox first

Before a server goes on any agent’s workspace, you can look at what it does on install in a sandbox that is thrown away afterwards. These forms are from the Sandscale CLI’s --help (version 1.4.1):

sandscale sandbox create --template-id builtin:node --network allowlist
sandscale sandbox run SANDBOX_ID -- npm install PACKAGE
sandscale sandbox terminate --id SANDBOX_ID

The install, and any install script the package runs, happens inside the box, which is gone after terminate. Sandboxes start with network none. The CLI’s help says allowlist reaches only your organization’s egress allowlist and package registry presets, and it is available where your plan and policy allow it.

What the team gets on top

Because the workspace is a Sandscale machine, the rest of your organization’s controls apply to it:

  • Policies set which templates, sizes and run times members may use, and which agents may run. Approval gates make a person sign off first. See approvals and policies.
  • The audit log records workspaces started and stopped, commands run, files moved, secrets used and approvals, with who, when and where. It is hash-chained, so a change or a gap shows. Every plan can read it. See the audit log docs.
  • A kill switch for every organization stops its agents at once.

What this does not fix

  • A malicious server on the workspace can still do anything the workspace can do: read the repository that is there, use the tokens you gave it, and reach whatever the network policy allows. The point is that this is much less than a developer’s laptop, and it belongs to one agent.
  • Tool annotations from a server you do not trust are not a safety signal. The MCP spec says clients must treat them as untrusted unless they come from trusted servers. More on that in our post on MCP tool annotations.
  • You still decide which servers your agents may use. A short allowlist in your project config beats a long one nobody reads.

If your agents also need a throwaway machine for the code they write, Sandscale’s MCP server gives them one per run from the same account. The Quickstart covers sign-up and the CLI.

Run your agents in a box of their own

Each sandbox is a Firecracker microVM. Free includes 100 awake vCPU-hours a month.

Start free

Keep reading