domdomegg

Tool Sandbox MCP β€” Development skill for Claude Code

Development community

πŸ“¦ MCP server that runs agent code in a sandbox with access to upstream MCP tools.

How to install Tool Sandbox MCP

This entry records only its repository, not the path inside it, so there is no exact command to give. Open domdomegg/tool-sandbox-mcp and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Tool Sandbox MCP does

πŸ“¦ MCP server that runs agent code in a sandbox with access to upstream MCP tools.

Alternatives in Development

  • Mempalace Init β€” Set up MemPalace β€” install the package, initialize a palace, register the MCP server with Cursor, and verify e 58.6k β˜…
  • Claude Context Mode β€” An MCP server that sits between Claude Code and these outputs 5.3k β˜…
  • 04 Fix MCP Server β€” Prompt 04: Fix MCP Server Build 2.2k β˜…

README

tool-sandbox-mcp

Give your AI agent a single `execute_code` tool that can call any of your upstream MCP tools β€” more efficiently.

When agents call tools directly, every tool definition and intermediate result flows through the context window. As I wrote about in [code execution with MCP](https://www.anthropic.com/engineering/code-execution-with-mcp), this gets expensive fast: hundreds of tool definitions consume tokens upfront, and intermediate results (like full documents being copied between tools) bloat the context further.

tool-sandbox-mcp solves this by exposing a single `execute_code` tool that runs JavaScript in a [sandboxed WASM environment](https://github.com/domdomegg/tool-sandbox) with access to all upstream MCP tools. The agent writes code to call tools, filter data, and compose logic β€” all without intermediate results passing through the context window. Auth is proxied transparently from the upstream server, so users authenticate once.

MCP Client (Claude, Cursor, etc.)
  β†’ tool-sandbox-mcp (execute_code)
    β†’ runs JS in sandbox
      β†’ calls upstream MCP tools as needed

Usage

Set `TOOL_SANDBOX_MCP_CONFIG` to a JSON config object and run:

TOOL_SANDBOX_MCP_CONFIG='{"upstream": "https://mcp.example.com"}' npx -y tool-sandbox-mcp

This starts an HTTP MCP server on localhost:3000. When a user connects, they authenticate with the upstream server (via proxied OAuth). The server exposes a single `execute_code` tool β€” the agent writes JavaScript that can call any tool on the upstream.

In general you'll want to point this at some kind of gateway which aggregates MCP servers. You can use [mcp-aggregator](https://github.com/domdomegg/mcp-aggregator) for this if you don't already have a gateway. (The `selfPrefix` config argument can prevent recursive calls if you want).

Other configuration methods

The env var can also point to a file path:

TOOL_SANDBOX_MCP_CONFIG=/path/to/config.json npx -y