Who it is forA developer adding a community MCP server to Claude Code who does not fully trust what it might write or call.
The problemA local MCP server runs with your full user permissions, so a bad one can read secrets or write anywhere.
The outcomeThe same MCP server running under OS-level limits, with writes outside allowed paths failing with operation not permitted.
What you need first
- Node.js and npm to install the CLI
- macOS, Linux with bubblewrap, or Windows
- Optional: a settings file at ~/.srt-settings.json; without one srt uses built-in defaults
Steps
- Run
npm install -g @anthropic-ai/sandbox-runtime - In .mcp.json, change the server's command to srt and move the original command into args, for example
"command": "srt"with"args": ["npx", "-y", "@modelcontextprotocol/server-filesystem"] - Create ~/.srt-settings.json with filesystem rules (denyRead, allowWrite, denyWrite) and network rules (allowedDomains, deniedDomains)
- Restart your agent and ask the MCP server to write to a denied path to confirm it gets EPERM
Prompt for your agent
Install anthropics/sandbox-runtime and wrap my <MCP server> in srt in .mcp.json. Write ~/.srt-settings.json so it can write only to <allowed path> and reach only <allowed domains>, then prove it by asking it to write to <denied path> and showing me the error.
Caveat. It is a beta research preview, so the README warns that APIs and configuration formats may change.
Use this in your AI agent
Ask your agent
Using the Deduped MCP, get the setup steps for anthropics/sandbox-runtime and "Sandbox an MCP server with one line in .mcp.json"
Add Deduped to Claude Code once
claude mcp add --transport http deduped https://dedupedai.com/mcp
Every Monday: the 5 hottest repos and exactly how to use them. Free, one email a week, unsubscribe anytime.
Get them freeShare: X LinkedIn Hacker News Email Copy link
Third-party repos we don't own. AI-written use cases can be wrong. Disclaimer