node-code-sandbox-mcp

alfonsograziano
60
A Node.js–based Model Context Protocol server that spins up disposable Docker containers to execute arbitrary JavaScript.

Overview

What is node-code-sandbox-mcp

node-code-sandbox-mcp is a Node.js-based Model Context Protocol server designed to run arbitrary JavaScript code in isolated, disposable Docker containers, allowing for on-the-fly installation of npm dependencies.

How to Use

To use node-code-sandbox-mcp, you can call its API methods such as 'run_js_ephemeral' to execute a one-off JavaScript script, 'sandbox_initialize' to start a new sandbox container, and 'sandbox_exec' to run shell commands within the container.

Key Features

Key features include the ability to start and manage isolated Node.js sandbox containers, execute arbitrary shell commands, install specified npm dependencies per job, run ES module JavaScript snippets, and ensure clean teardown of containers with controlled CPU/memory limits.

Where to Use

node-code-sandbox-mcp can be used in various fields such as software development for testing and executing code snippets, educational platforms for teaching JavaScript, and any environment where isolated execution of code is required.

Use Cases

Use cases include running temporary scripts for testing, executing user-submitted code in a safe environment, and automating tasks that require specific npm packages without affecting the host system.

Content