š¢š Node.js Sandbox MCP Server
@alfonsograziano
About š¢š Node.js Sandbox MCP Server
A Node.jsābased Model Context Protocol server that spins up disposable Docker containers to execute arbitrary JavaScript.
Config
Add this server to your MCP-compatible client using the configuration below.
{
"mcpServers": {
"js-sandbox": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"-v",
"/var/run/docker.sock:/var/run/docker.sock",
"-v",
"$HOME/Desktop/sandbox-output:/root",
"-e",
"FILES_DIR=$HOME/Desktop/sandbox-output",
"alfonsograziano/node-code-sandbox-mcp"
]
}
}
}Tools
No tools detected
We auto-extract tools from the README. The maintainer can list them under a ## Tools heading to populate this section.
Overview
What is š¢š Node.js Sandbox MCP Server?
It is a Node.js server implementing the Model Context Protocol (MCP) for running arbitrary JavaScript in ephemeral Docker containers with onātheāfly npm dependency installation. It is for developers and AI agents who need an isolated, sandboxed JavaScript execution environment.
How to use š¢š Node.js Sandbox MCP Server?
Install and run via Docker or npx, then configure your MCP client (e.g., Claude Desktop, VS Code) with the provided JSON config. Pass environment variables like FILES_DIR, SANDBOX_MEMORY_LIMIT, and SANDBOX_CPU_LIMIT. Use tools such as run_js_ephemeral for oneāoff scripts or sandbox_initialize ā run_js ā sandbox_stop for sessionābased workflows.
Key features of š¢š Node.js Sandbox MCP Server
- Isolated Docker containers for each sandbox.
- Execute shell commands inside running containers.
- Install specified npm packages per job.
- Run ES module JavaScript snippets and capture stdout.
- Clean teardown of containers after use.
- Detached mode for longārunning servers (background processes).
Use cases of š¢š Node.js Sandbox MCP Server
- Quick oneāoff JavaScript experiments with automatic cleanup.
- Run multiāstep scripts in a persistent sandbox environment.
- Spin up temporary servers with exposed ports for testing.
- Search npm packages and test them in isolation.
- Generate files (e.g., QR codes, images) and retrieve them automatically.
FAQ from š¢š Node.js Sandbox MCP Server
What are the prerequisites?
Docker must be installed and running on your machine. Preāpulling images like node:lts-slim is recommended to avoid delays.
How do I get files back from a script?
Save files during script execution in the containerās working directory. Images (PNG, JPEG) are returned as image content; other files (e.g., .txt, .json) are returned as resource content. This feature is available only in the run_js_ephemeral tool.
What is detached mode?
Detached mode keeps the container alive after script execution, allowing longārunning services (e.g., servers) to stay active in the background. Use run_js with the listenOnPort parameter.
How can I limit container resources?
Set environment variables SANDBOX_MEMORY_LIMIT (e.g., 512m) and SANDBOX_CPU_LIMIT (e.g., 0.5) when launching the server.
Can I use custom Docker images?
Yes. The image parameter in tools like run_js_ephemeral and sandbox_initialize accepts any Docker image (default is node:lts-slim).
Frequently asked questions
What are the prerequisites?
Docker must be installed and running on your machine. Preāpulling images like `node:lts-slim` is recommended to avoid delays.
How do I get files back from a script?
Save files during script execution in the containerās working directory. Images (PNG, JPEG) are returned as image content; other files (e.g., .txt, .json) are returned as resource content. This feature is available only in the `run_js_ephemeral` tool.
What is detached mode?
Detached mode keeps the container alive after script execution, allowing longārunning services (e.g., servers) to stay active in the background. Use `run_js` with the `listenOnPort` parameter.
How can I limit container resources?
Set environment variables `SANDBOX_MEMORY_LIMIT` (e.g., `512m`) and `SANDBOX_CPU_LIMIT` (e.g., `0.5`) when launching the server.
Can I use custom Docker images?
Yes. The `image` parameter in tools like `run_js_ephemeral` and `sandbox_initialize` accepts any Docker image (default is `node:lts-slim`).
Basic information
More Reasoning MCP servers
Proplan Mcp
King-ProplanMCP server that gives Claude persistent project memory ā roadmap, session history, and codebase context. Type continue and Claude picks up exactly where you left off
mcp-agentic-rag
rukshannetMCP Server for Agentic RAG applications
Agenticstore ā The Open Source Standard For Local Mcp Tooling
agenticstoreAgenticStore: The secure toolkit for AI agents. Instantly equip Claude Desktop, Cursor, and Windsurf with 27+ MCP tools, persistent memory, and SearXNG search, all protected by a built-in PII prompt firewall to protect your data from being exposed to AI agents.
Agentic Radar
splx-aiA security scanner for your LLM agentic workflows
End-to-End Agentic AI Automation Lab
MDalamin5This repository contains hands-on projects, code examples, and deployment workflows. Explore multi-agent systems, LangChain, LangGraph, AutoGen, CrewAI, RAG, MCP, automation with n8n, and scalable agent deployment using Docker, AWS, and BentoML.
Comments