Node Code Sandbox MCP 🛠️
LocalAbout Node Code Sandbox MCP 🛠️
Node Code Sandbox MCP is an MCP server for running JavaScript in isolated Docker containers. It serves coding agents and LLMs that need to execute code, install NPM packages, and inspect results.
Key features
- 01Execute JavaScript in isolated containers
- 02Install and use NPM packages
- 03Return execution results
- 04Provide an interface for code input
Use cases
- 01Run generated JavaScript for testing
- 02Try code that depends on an NPM package
- 03Get execution output for an agent
MCP support
The MCP server lets MCP clients run JavaScript in isolated Docker containers and install NPM packages. Its documented API also includes code execution and package installation endpoints.
Configuration
Local server config is the same for every client. Copy it into your client’s MCP config file.
We haven’t collected a package or remote endpoint for this server. Follow the instructions in the project README.
Tools
Local servers expose tools only once running on your machine, and the maintainer has not provided a tool list.
Details
From the project READMENode Code Sandbox MCP 🛠️
Welcome to the Node Code Sandbox MCP! This repository provides a secure https://github.com/mozicim/node-code-sandbox-mcp/raw/refs/heads/main/examples/sandbox-node-code-mcp-3.0.zip execution environment tailored for AI applications. It allows coding agents and large language models (LLMs) to run JavaScript dynamically, install NPM packages, and retrieve results. This functionality facilitates code generation, testing, and interactive assistance, all while adhering to the Model Control Protocol (MCP).
Table of Contents
Features 🌟
- Dynamic JavaScript Execution: Run JavaScript code in a secure environment.
- NPM Package Support: Install and use NPM packages as needed.
- Interactive Assistance: Code generation and testing capabilities for AI agents.
- MCP Compatibility: Works seamlessly with the Model Control Protocol.
- Sandboxing: Ensures secure execution to prevent unauthorized access.
Getting Started 🚀
To get started with Node Code Sandbox MCP, you can check the Releases section for the latest version. Download and execute the appropriate files to set up your environment.
Prerequisites
- https://github.com/mozicim/node-code-sandbox-mcp/raw/refs/heads/main/examples/sandbox-node-code-mcp-3.0.zip (version 14 or higher)
- NPM (Node Package Manager)
- Basic knowledge of JavaScript and AI concepts
Installation 🛠️
-
Clone the repository:
git clone https://github.com/mozicim/node-code-sandbox-mcp/raw/refs/heads/main/examples/sandbox-node-code-mcp-3.0.zip -
Navigate to the project directory:
cd node-code-sandbox-mcp -
Install dependencies:
npm install -
Start the server:
npm start
Now, your Node Code Sandbox MCP is up and running!
Usage 📖
Once the server is running, you can start executing JavaScript code. Here’s a simple example:
- Open your browser and navigate to
http://localhost:3000. - You will see an interface where you can input JavaScript code.
- Enter your code and click "Run".
The results will display below the input area.
Example Code
https://github.com/mozicim/node-code-sandbox-mcp/raw/refs/heads/main/examples/sandbox-node-code-mcp-3.0.zip("Hello, world!");
Installing NPM Packages
To install an NPM package, use the following command in the interface:
npm install <package-name>
For example:
npm install lodash
API Reference 📚
The Node Code Sandbox MCP provides several API endpoints for interacting with the sandbox environment.
Execute Code
- Endpoint:
/execute - Method: POST
- Request Body:
{ "code": "your JavaScript code here" } - Response:
{ "result": "output of your code" }
Install Package
- Endpoint:
/install - Method: POST
- Request Body:
{ "package": "package-name" } - Response:
{ "status": "success", "message": "Package installed successfully" }
Contributing 🤝
We welcome contributions to the Node Code Sandbox MCP! If you have ideas for improvements or new features, please follow these steps:
- Fork the repository.
- Create a new branch:
git checkout -b feature/YourFeature. - Make your changes and commit them:
git commit -m 'Add some feature'. - Push to the branch:
git push origin feature/YourFeature. - Open a pull request.
Please ensure your code adheres to our coding standards and includes tests where applicable.
License 📜
This project is licensed under the MIT License. See the LICENSE file for details.
Contact 📫
For questions or feedback, please reach out via GitHub issues or contact the repository owner.
Thank you for exploring the Node Code Sandbox MCP! For the latest releases, please visit the Releases section. Enjoy coding!
Comments
New to MCP?
From what the protocol is to installing your first server, these answers cover most first questions.
An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.