Guide · Claude Desktop and MCP
How do I sandbox an MCP server I use from Claude Desktop?
Updated
Add the server to kosa8 with kosa8 mcp add, which runs it in a microVM of its own that reaches only the hosts it needs and sees only the folder you name, then register kosa8 with Claude Desktop using kosa8 mcp install claude-desktop. Claude Desktop starts kosa8 mcp serve, and the server's tools appear through kosa8's gateway, with their definitions pinned and every call in the audit log.
01Steps
Install kosa8 on your Mac, sign in and start the daemon. Claude Desktop starts
kosa8 mcp serve, which talks to the kosa8 daemon, so the daemon has to be running.Look the server up in the catalog.
kosa8 mcp infoshows what a catalog server runs, the hosts and secrets it needs, and its risk.Add it, sharing one folder. The filesystem server gets the folder you name, read-only unless you add
--writable. It runs in its own sandbox,mcp-filesystem. A server that is not in the catalog is added by its command, as in the second line.Register kosa8 with Claude Desktop.
--printshows what would be added. Without it, kosa8 writes itself into~/Library/Application Support/Claude/claude_desktop_config.json, keeps your other servers, and saves the old file as.bak.Quit and reopen Claude Desktop. Then ask it something that needs the server, such as "list the files in my notes folder". The server's tools appear namespaced, such as
filesystem_read_file, beside kosa8's own sandbox tools.Check what it is allowed to do.
kosa8 mcp pinsshows the tool definitions recorded the first time the server started;kosa8 sandbox egressshows its network policy and anything refused; the audit log has every call.Remove it when you are done.
02Why sandbox an MCP server at all?
A server added to claude_desktop_config.json the usual way is a process on your Mac with your user's rights: it can read your home directory and reach any host. A malicious or compromised package, or a bad update, does not need to fool the model to do harm.
In kosa8 each server is a separate microVM. It sees only the folder you shared, reaches only the hosts it needs, keeps its secrets in kosa8's owner-only store instead of the config file, and its tool definitions are pinned so a later change is visible.
03Using kosa8 Cloud from Claude Desktop
Claude Desktop's config file starts local (stdio) servers, so it reaches kosa8 Cloud's remote MCP server through the mcp-remote bridge, which needs Node.js. Put the key in the env block, not in the arguments:
{ "mcpServers": { "kosa8-cloud": { "command": "npx", "args": ["-y", "mcp-remote", "https://api.kosa8.com/mcp", "--header", "Authorization:${KOSA8_AUTH_HEADER}"], "env": { "KOSA8_AUTH_HEADER": "Bearer k8c_live_..." } } } }
That gives Claude Desktop cloud sandboxes to run commands in; it does not move your other MCP servers to the cloud.
04Other options
- Docker's MCP tooling. Runs servers as containers behind a gateway; containers share the host kernel.
- Remote servers run by the vendor. Nothing runs on your Mac; you still decide which tools to allow.
- Only well-known servers. Fewer servers, from publishers you trust, pinned to versions, is the cheapest control of all.
05FAQ
Where is Claude Desktop's MCP config on a Mac?
~/Library/Application Support/Claude/claude_desktop_config.json. kosa8 mcp install claude-desktop edits it for you and keeps a .bak of the old file.
Do I have to restart Claude Desktop?
Yes. Claude Desktop reads its MCP servers when it starts, so quit it fully and reopen it after kosa8 mcp install.
Can the server still read my files?
Only the folder you passed with --dir, read-only unless --writable. Nothing else on your Mac is in its sandbox.
Does this work on Windows?
kosa8 runs on Windows through WSL2; the config path above is the macOS one, and kosa8 mcp install --print shows what it would write on your machine.
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: kosa8 Cloud MCP server
- MCP: Connect to local servers
- kosa8 command reference
Related
- How do I run MCP servers in a sandbox?
- The best sandbox for MCP servers
- 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?
- How do I restrict an AI agent's network access to an allow-list?
Updated 2026-11-14