Best sandbox · MCP servers
The best sandbox for MCP servers
Updated
An MCP server you install runs with your user's rights and gets to describe its own tools to your model. The best sandbox for it gives each server its own machine that reaches only the hosts it needs, keeps its secrets out of the registry file, pins its tool definitions so they cannot change behind your back, and decides each call by policy. kosa8 does that with kosa8 mcp add: every server runs in a microVM of its own behind kosa8's gateway.
01What an MCP server needs from a sandbox
Most MCP servers are installed with npx or uvx and run on your machine, so a compromised package or a malicious update reads your home directory. Servers also return text the model trusts and describe their tools in text the model reads, which is where tool poisoning happens.
A sandbox for them therefore has two jobs: contain the process, and stand between the server and the model so that definitions are pinned and calls are checked and recorded.
02Checklist for choosing one
- One machine per server. A bad server reaches only its own sandbox.
- Egress limited to what the server needs. Enforced outside the guest.
- Only the folder you choose. Read-only unless you say otherwise.
- Secrets kept out of config files. Asked for without echo and stored owner-only.
- Pinned tool definitions. A changed definition is noticed, not silently used.
- Policy per team and per tool. Which servers and tools are approved.
- Audit of every call. With digests of arguments and results.
03How kosa8 meets it
kosa8 mcp search kosa8 mcp add github kosa8 mcp add filesystem --dir ~/code/project kosa8 mcp add mytool --image node:22-alpine --egress-allow api.example.com -- npx -y [email protected] kosa8 mcp install kosa8 mcp pins
kosa8 mcp add ID installs a catalog server at a pinned version in its own sandbox (mcp-ID) whose egress is only the hosts that server needs, or reaches the publisher's remote endpoint through the gateway. --dir shares one folder, read-only unless --writable. Any other server is registered by its command with kosa8 mcp add NAME -- CMD. kosa8 mcp install registers the gateway with your clients; the servers' tools then appear namespaced as NAME_tool.
Each call is decided by the org MCP policy (kosa8 mcp-policy) and recorded in the audit log with digests of its arguments and result. Calls a policy holds wait in kosa8 mcp asks for kosa8 mcp approve.
04When another option fits better
- Docker's MCP tooling. Docker runs MCP servers as containers with a gateway in front, which is a solid step up from
npxon the host; containers share the host kernel. - Vendor-hosted remote servers. When a vendor runs the server (GitHub's hosted server, for example), there is no process of yours to sandbox; what remains is choosing which tools to allow, which kosa8's gateway also does.
- One trusted server you wrote. If you wrote it and it reads nothing sensitive, running it directly is reasonable.
05FAQ
Can an MCP server read my files in kosa8?
Only the folder you share with --dir, read-only unless --writable. Everything else on the host is absent from its sandbox.
What is tool pinning?
The first time kosa8 mcp serve starts a server, kosa8 records its tool definitions. kosa8 mcp pins shows them, so a later change to what a tool claims to do is visible instead of silently passed to the model.
Does this work with Claude Desktop?
Yes. kosa8 mcp install claude-desktop writes kosa8 into Claude Desktop's config; the Claude Desktop guide walks through it.
Where are the server's API keys kept?
In kosa8's owner-only secret store, asked for without echo, not in the registry file. --secrets-from-env takes them from your shell instead.
06Get started
Install kosa8 on a Mac, Linux or Windows (WSL2) machine, or make an account and run the same sandboxes on kosa8 Cloud.
07Sources
- kosa8 docs: Tool servers (MCP)
- kosa8 docs: MCP catalog
- kosa8 docs: Connect Claude, Cursor or Codex
- kosa8 docs: Governance
- MCP: Connect to local servers
- kosa8 command reference
Related
- How do I run MCP servers in a sandbox?
- How do I sandbox an MCP server I use from Claude Desktop?
- How do I give an AI agent API keys without exposing them?
- How do I require human approval before an AI agent runs a risky command?
- All best-sandbox pages
Updated 2026-11-14