Node.js Sandbox — Claude Code MCP server for JavaScript
Node.js Sandbox runs JavaScript in disposable Docker containers and returns script output. Use it to execute code with npm packages or retrieve files the script creates.
no license updated 2026-10-29
Open on GitHubWhat Node.js Sandbox does
The MCP server runs each one-off JavaScript job in a fresh container. It prepares index.js and a package.json, installs the requested npm packages, executes the script, then returns its stdout. Files saved in the working directory can also be returned, but that feature applies to one-off runs.
Docker must be installed and running before the server can start containers. You can choose a Docker image, and detached mode keeps a container alive after a script finishes. Separate tools also let you run shell commands in an existing sandbox.
What it helps with
- run JavaScript in a separate Docker container
- install npm packages for a script run
- retrieve an image or file created by a script
- execute a shell command in a running container
Example prompts for the agent
- Run JavaScript that creates
report.jsonand prints a message when it is done. - Use the
qrcodenpm package to make a QR image and save it to a file. - Start a sandbox, then check the Node.js version inside it.
How to install Node.js Sandbox
Install
The MCP registry has no launch command for it: see the repository README
Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about Node.js Sandbox
How do I install Node.js Sandbox in Claude Code?
Install and start Docker, then connect the server through Claude Code's MCP configuration. The server can be launched with npx -y node-code-sandbox-mcp.
What does Node.js Sandbox do?
It runs JavaScript in Docker, installs the npm packages supplied for a job, and returns the script output. In one-off runs, it can also return files created by the script.
Does Node.js Sandbox require Docker?
Yes. Docker has to be installed and running so the server can create containers.