Node.js Sandbox MCP Server

Node.js Sandbox MCP Server is an MCP server that enables AI assistants to execute arbitrary JavaScript and Node.js code inside secure, isolated Docker containers. It connects AI clients such as Claude Desktop or VS Code directly to the host Docker daemon, allowing assistants to dynamically run ES modules, install npm packages on the fly, and inspect script outputs. Developers, automation engineers, and data practitioners use this server to safely test code snippets, generate diagrams, create local files, and inspect package documentation without polluting their host operating systems. The server offers both disposable, single-execution environments that self-terminate and long-lived sessions that allow incremental testing or persistent background servers via detached mode. Additionally, generated artifacts such as images and text files are automatically captured and passed back to the client interface, while resource controls like configurable CPU and memory limits ensure the host machine remains stable during intensive executions.

Category: Cloud & Infrastructure

Tags: docker, javascript, nodejs, npm, sandbox

Visit Node.js Sandbox MCP Server

How to install and configure Node.js Sandbox MCP Server

  1. Ensure Docker is installed, running, and accessible on your machine. 2. Open your client configuration file, such as claude_desktop_config.json for Claude Desktop or settings.json for VS Code. 3. Add the server entry under the mcpServers object using Docker: json { "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", "mcp/node-code-sandbox" ] } } } 4. Alternatively, configure the server via NPX by setting command to npx and args to ["-y", "node-code-sandbox-mcp"]. 5. Restart your MCP client to initialize the sandbox connection.

What you can do with Node.js Sandbox MCP Server

  • Execute single-use JavaScript scripts using run_js_ephemeral to process data and automatically receive created files directly in your chat interface. * Search the npm registry with search_npm_packages to inspect dependencies, package descriptions, and README excerpts before running code. * Spin up persistent environments via sandbox_initialize to execute multiple shell commands and share context across multiple script runs. * Launch background web servers or services inside containers using run_js with the listenOnPort parameter enabled. * Generate media assets such as QR codes, charts, or images by running scripts with pre-installed Node.js graphical libraries.

Key facts

  • Open Source
  • https://github.com/alfonsograziano/node-code-sandbox-mcp
  • Cloud & Infrastructure, Developer Tools & Code Intelligence
  • docker, javascript, nodejs, npm, sandbox

Part of MCP Servers

Related MCP servers

  • MCP KQL Server — MCP KQL Server is an MCP server that connects AI assistants to Azure Data Explorer clusters using Azure CLI authentication.…
  • MCP LaTeX Server — MCP LaTeX Server is an MCP server that provides tools for creating, editing, validating, and compiling LaTeX documents directly through…
  • MCP JSON — MCP JSON is an MCP server collection that bundles tools for file system operations, Google search, browser-based web automation, and…
  • MCP Jupyter Complete — MCP Jupyter Complete is an MCP server that provides tools for manipulating Jupyter notebook files through position-based cell operations and…
  • MCP LSP Go — MCP LSP Go is an MCP server that connects AI assistants to the official Go Language Server Protocol implementation, gopls,…
  • MCP Manager — MCP Manager is an MCP server management tool that connects directly to your Claude Desktop environment, enabling users to discover,…

What can Node.js Sandbox MCP Server do?

Node.js Sandbox MCP Server lets AI clients run JavaScript in Docker containers. It supports installing npm dependencies on the fly, running ephemeral or persistent containers, running shell commands, searching the npm registry, exposing ports for long-running servers, and returning generated files like images and text directly back to the chat interface.

What are the prerequisites for Node.js Sandbox MCP Server?

Docker must be installed and actively running on the host system. The server interacts with the Docker socket to spin up, configure, and tear down containers. Pre-pulling recommended Docker images like node:lts-slim or custom Playwright images is recommended to avoid download delays during initial runs.

Which MCP clients work with Node.js Sandbox MCP Server?

The server works with any Model Context Protocol client supporting stdio transport. It includes tested setup instructions for Claude Desktop and Visual Studio Code, and it can be run either directly via an official Docker container image or through an NPX execution command.

Is Node.js Sandbox MCP Server open source?

Yes, Node.js Sandbox MCP Server is open source software published under the MIT License. The complete source code, issue tracker, and contribution details are publicly available in its GitHub repository.

  • AI Tools
  • Categories
  • Industries
  • CLI Coding Agents
  • MCP Servers
  • MCP Categories