Node Code SandboxSAFE
A Node.js–based Model Context Protocol server that spins up disposable Docker containers to execute arbitrary JavaScript.
Overview
From the repository's own README, as read at the audited commit. Badges and raw HTML are left out.
Node.js server implementing the Model Context Protocol (MCP) for running arbitrary JavaScript in ephemeral Docker containers with on‐the‐fly npm dependency installation.
👉 Look at the official website
Features
- Start and manage isolated Node.js sandbox containers
- Execute arbitrary shell commands inside containers
- Install specified npm dependencies per job
- Run ES module JavaScript snippets and capture stdout
- Tear down containers cleanly
- Detached Mode: Keep the container alive after script execution (e.g. for long-running servers)
Note: Containers run with controlled CPU/memory limits.
Explore Cool Use Cases
If you want ideas for cool and powerful ways to use this library, check out the use cases section on the website It contains a curated list of prompts, examples, and creative experiments you can try with the Node.js Sandbox MCP Server.
⚠️ Prerequisites
To use this MCP server, Docker must be installed and running on your machine.
Tip: Pre-pull any Docker images you'll need to avoid delays during first execution.
Example recommended images:
- node:lts-slim
- mcr.microsoft.com/playwright:v1.55.0-noble
- alfonsograziano/node-chartjs-canvas:latest
Getting started
In order to get started with this MCP server, first of all you need to connect it to a client (for example Claude Desktop).
Once it's running, you can test that it's fully working with a couple of test prompts:
- Validate that the tool can run:
Create and run a JS script with a console.log("Hello World")This should run a console.log and in the tool response you should be able to see Hello World.
- Validate that you can install dependencie
d41900d4d31bOBSERVED · 2026-10-07Connect
Built from this server's own package name, version and transport as found in its source — not copied from anyone's documentation, so it cannot drift against a page we do not control. Replace the environment placeholders with a token scoped to the least it needs.
claude mcp add my-project --env OPENAI_API_KEY=${OPENAI_API_KEY} -- npx -y [email protected]{
"mcpServers": {
"my-project": {
"command": "npx",
"args": [
"-y",
"[email protected]"
],
"env": {
"OPENAI_API_KEY": "${OPENAI_API_KEY}"
}
}
}
}Exposed tools (11)
6 read · 4 write · 1 destructive. Blast radius: 1 tool can delete or overwrite — an agent that can be talked into calling a tool can be talked into calling this one.
| Tool | Risk | Description |
|---|---|---|
get_dependency_types | read | Given an array of npm package names (and optional versions), fetch whether each package ships its own TypeScript definitions or has a corresponding @types/... package, and return the raw .d.ts text. Useful whenwhen you |
incomplete-package | read | No description available. |
package1 | read | Test package 1 |
package2 | read | Test package 2 |
qualified-package | read | Qualified package |
run_js | write | |
run_js_ephemeral | write | |
sandbox_exec | write | Execute one or more shell commands inside a running sandbox container. Requires a sandbox initialized beforehand. |
sandbox_initialize | write | Start a new isolated Docker container running Node.js. Used to set up a sandbox session for multiple commands and scripts. |
sandbox_stop | destructive | Terminate and remove a running sandbox container. Should be called after finishing work in a sandbox initialized with sandbox_initialize. |
search_npm_packages | read | Search for npm packages by a search term and get their name, description, and a README snippet. |
Trust audit
SAFEgrade B · trust 89/100 Nothing in the source contradicts what it says it does. Grade A is reserved for packages that have also passed the behavioural sandbox.
| Layer | What it checks | Result |
|---|---|---|
| L0 | Provenance & inventory | PASS |
| L1 | Static analysis of the code | PASS |
| L2 | Instruction surface (what it tells the agent) | PASS |
| L3 | Class-specific surface | WARN |
| L4 | Behavioural (sandbox) | SKIPPED |
What the source does
- Filesystem
- declared (4 observation(s))
- Network
- declared (5 observation(s))
- Shell
- none-observed
- Dependencies
- not all pinned
- Secrets in source
- none-found
Findings (18)
sandbox_stop
.commitlintrc
.env.sample
.lintstagedrc
.prettierignore
.prettierrc.js
'js-sbx-123/../../etc/passwd',
'js-sbx-123/../../etc/passwd',
'js-sbx-123/../../etc/passwd',
import { lintAndRefactorCode } from '../../src/linterUtils.ts';(cd "$script_dir/../../.." && pwd)
'/9j/4AAQSkZJRgABAQAAAQABAAD/2wCEAAkGBxISEhUSEhIVFhUVFRUVFRUVFRUVFRUVFRUWFhUVFRUYHSggGBolGxUVITEhJSkrLi4uFx8zODMsNygtLisBCgoKDg0OGhAQGy0lHyYtLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0tLS0
@eslint/eslintrc, @modelcontextprotocol/sdk, @typescript-eslint/eslint-plugin, @typescript-eslint/parser, dotenv, eslint, eslint-config-prettier, eslint-plugin-n
@mdx-js/react, @mdx-js/rollup, @types/react-router-dom, buffer, clsx, ethers, lucide-react, react
website/public/images/graph-gpt.png
website/public/images/pillars/hitl_problem.png
website/public/images/pillars/hitl_solution.png
- **Manage Secrets:** **NEVER** hardcode secrets (API keys, passwords) in the source code. Load them from environment variables (e.g., using `dotenv` in development).
Gates applied: no_behavioural_pass.
d41900d4d31bfull audit observations/trust-audit/mcp-server/alfonsograziano__node-code-sandbox.json · Report an issue / request a re-scanAudit history
Every audit this server has had. A grade with a past is a grade somebody is still checking.
| Date | Source | Verdict | Grade | Score | Change |
|---|---|---|---|---|---|
| 2026-10-07 | d41900d4d31b | SAFE | B | 89 | first audit |
Questions
What is the Node Code Sandbox MCP server?
A Node.js–based Model Context Protocol server that spins up disposable Docker containers to execute arbitrary JavaScript.
What tools does Node Code Sandbox expose?
11 in total: 6 read-only, 4 that write, and 1 that can delete or overwrite (sandbox_stop). Every one is listed on this page with its risk.
Is Node Code Sandbox safe to connect to an agent?
The audit found nothing in the source that contradicts what it says it does, and graded it B (89/100). Grade A is held back for packages that have also passed a sandboxed behavioural run, which is why a clean server reads B. Separately from the audit: 1 of its tools can destroy data, so scope the token you give it to what you actually need.
What credentials does Node Code Sandbox need?
It reads OPENAI_API_KEY from the environment. Give it a token scoped to the least it needs — an agent that can be talked into calling a tool can be talked into calling it with your credentials.
How does Node Code Sandbox run?
It speaks stdio, so it runs as a local process your client starts. It is published on npm as my-project at 0.0.0.
How current is this page?
The grade is for one exact copy of the source (d41900d4d31b), read on 2026-10-07. The repository is watched and re-audited when it changes.