Analyzed 34 days ago · 2 anonymous rescans remaining · register free to re-analyze any time.
Public analysis · read only
Register free to re-analyze

garc33/js-sandbox-mcp-server

5 7 0 issues
JavaScript

Project Overview

anthropic / claude-opus-4-7

js-sandbox MCP Server

An MCP server that executes JavaScript code inside a vm2 sandbox for AI assistants.

AI Verdict
Review Recommended— AI Trust Assessment

True Intent (AI Assessment)

Provide LLM clients with a JavaScript code execution tool over the Model Context Protocol.

README Accuracy

Partially Accurate

Notes

The code matches the README's stated functionality, but the 'secure' and 'protection against malicious code' claims are overstated: vm2 is a deprecated library with known sandbox escapes, and the forbidden-pattern filter is a simple string match that is easy to circumvent.

What Is This?

This is a Model Context Protocol (MCP) server written in TypeScript that exposes a single tool, `execute_js`, allowing an MCP client (such as Claude Desktop) to run arbitrary JavaScript code in an isolated environment and receive back the result, console output, execution time, and memory usage.

The problem it addresses is that large language models like Claude cannot natively execute code. By adding this MCP server, an AI assistant gains the ability to run JavaScript snippets to compute results, test logic, or process data, without giving the model direct access to the host system. Configurable timeout (100ms-30s) and memory limits (1MB-100MB) are exposed to prevent runaway scripts.

The intended users are developers integrating LLMs (primarily Anthropic's Claude via the MCP protocol) who want to give the model a code execution tool. Installation is either manual via a claude_desktop_config.json entry or automated through the Smithery registry, and the server communicates over stdio.

Internally, the server uses the `@modelcontextprotocol/sdk` to handle MCP requests, parses incoming code with `acorn` for basic syntactic validation, blacklists a handful of dangerous identifiers (`process`, `require`, `eval`, `Buffer`, `global`, etc.), and then runs the code inside a `vm2` NodeVM with `require: false` and `eval: false`. Execution results and errors are logged to a local `js-sandbox.log` file via winston. A Dockerfile and GitHub Actions workflow build and publish the package to npm.

Notable red flags: the project depends on `vm2` (^3.9.19), which has been publicly deprecated by its maintainer due to unfixable sandbox escape vulnerabilities — vm2 is no longer considered a secure isolation mechanism. The forbidden-pattern check is a naive substring match on source text, which can be trivially bypassed (e.g., by string concatenation or unicode escapes). Despite the README's security claims, the isolation guarantees here are weak and should not be relied upon for untrusted code in production.

Your Report, Tab by Tab
At a Glance
5Stars
7Forks
0Open Issues
October 10, 2025Last Active
MCP Server (CLI Tool)TypeScriptNot specified
Technology Stack
LanguagesTypeScript, JavaScript, Dockerfile
RuntimeNode.js 18+ / 20+
FrameworkModel Context Protocol SDK
DatabaseNone detected
Package Managernpm
Key Dependencies@modelcontextprotocol/sdk, vm2, acorn, winston
Build ToolTypeScript compiler (tsc)
Test FrameworkNone detected