
node-code-sandbox-mcp
MCP server that runs JavaScript and shell commands in disposable Docker sandboxes for AI
node-code-sandbox-mcp is an open-source MCP server for developer tools. It is available on API, CLI, Linux, macOS, Windows, VS Code and Self-hosted.
- Pricing
- Open source
- Platforms
- API, CLI, Linux
- What it can do
- Can change data (4 tools)
- GitHub stars
- 156
- Last commit
- Language
- TypeScript
Similar MCP servers
About node-code-sandbox-mcp
Gives an AI assistant a place to execute Node.js code without touching the host machine. Each run happens in a throwaway Docker container, with npm packages installed on demand before the script starts. Output from the script is returned to the client, and files the script writes can be sent back as images or resources.
Two workflows are offered. A one-shot tool creates a fresh container, runs a snippet, and removes the container afterward. A session workflow keeps one container alive so several commands and scripts can share installed dependencies. A detached option leaves a process running in the container, which is useful for testing a small server or endpoint that the host can reach through a mapped port.
The server is aimed at developers and people who connect MCP clients such as Claude Desktop or VS Code to Docker and want the model to test code, generate artifacts like charts or QR codes, or check npm packages through an included search tool. Docker must be installed and running, and CPU and memory limits for containers can be set through environment variables.
Tools this server provides (6)
Taken from the project documentation; the running server may differ.
From the tool list in its README, going by the names, 4 of 6 tools change data; 1 name doesn't say.
From the server's own tool labels and tool names; not verified by us.
- run_js_ephemeralName suggests: changes
- Runs a one-off JavaScript script in a new disposable container and returns its output and any saved files.
- sandbox_initialize
- Starts a fresh sandbox container and returns its ID.
- sandbox_execName suggests: changes
- Runs shell commands inside a running sandbox.
- run_jsName suggests: changes
- Installs npm dependencies and executes JavaScript inside an existing sandbox.
- sandbox_stopName suggests: changes
- Terminates and removes a sandbox container.
- search_npm_packagesName suggests: reads
- Searches npm packages and returns their name, description and README snippet.
What it does
- Disposable Docker containers
- Each one-shot run starts a fresh container that is removed once the script finishes.
- On-demand npm installs
- Packages and version ranges are installed per job before the script executes.
- Persistent sandbox sessions
- A long-lived container can be reused for multiple commands and scripts.
- Detached server mode
- A script can keep running in the container and expose a chosen port to the host.
- File output capture
- Files saved by a script are returned to the client as images or resources.
- npm package search
- Searches the npm registry and returns name, description and a README snippet for matches.
- Configurable resource limits
- Memory and CPU caps for containers are set through environment variables.
Good for
- Let an assistant test a JavaScript snippet and show its console output
- Generate a chart or QR code image from a script and save it to a local folder
- Try out an npm package in an isolated environment before adding it to a project
- Spin up a temporary Express or other Node server and call its endpoints
- Run a sequence of shell and Node commands in one reusable container
Pricing
Open source
Free and open source under the MIT license.
node-code-sandbox-mcp FAQ
What must be installed to use node-code-sandbox-mcp?
Docker must be installed and running on the machine where the server runs.
Can the server return files created by a script?
Yes. Files a script saves in its working directory are returned automatically, with images sent as image content and other files as resources. This is available in the one-shot tool.
Which Node image does node-code-sandbox-mcp use by default?
The default image is node:lts-slim, though a different Docker image can be specified for each run.
Can I run node-code-sandbox-mcp without the Docker image?
Yes. It can be launched with npx using the node-code-sandbox-mcp package, provided Docker is running.
Is node-code-sandbox-mcp free?
Yes. node-code-sandbox-mcp is open source, so you can use and self-host it for free.
What are the best alternatives to node-code-sandbox-mcp?
The closest alternatives to node-code-sandbox-mcp are Sandbox Env MCP, NEPHIS MCP Server, mcp-v8, MCP Server Commands and mcp-server-commands.
Where this comes from
- Description: written from the project's README.
