Skip to main content
Glama

JS-VM-MCP-Server

Usage

{
  "mcpServers": {
    "JavaScript VM": {
      "command": "npx",
      "args": [
        "--allow-git",
        "all",
        "-y",
        "github:Quicksilver0218/JS-VM-MCP-Server"
      ]
    }
  }
}

Related MCP server: Netmind Code Interpreter

Tools

There are 2 available tools:

  • run_javascript — runs the snippet as-is.

  • run_typescript — compiles the snippet with esbuild (loader: "ts", target: "esnext"), then runs the emitted JavaScript through the exact same path as run_javascript.

Both VM tools behave identically; run_typescript just strips the types off first.

Run

Executes the submitted snippet inside a fresh isolated-vm V8 isolate and returns the captured stdout, stderr, the top-level return value and any failure. The first line of the response is always Code execution finished in #.### seconds..

Per call:

Limit

Value

V8 heap

512 MB

Wall clock

30 seconds

Buffered output

262,144 characters per stream

The isolate is a separate heap with no access to the host process, so there is no require, process, timer or file-system API. Each call gets a brand new isolate, so nothing is shared between runs. The snippet is evaluated as the body of an async function, which means top-level await and top-level return both work. import/export module syntax is not supported in either tool. setTimeout is unavailable.

fetch

The isolate has no network stack of its own, so fetch is bridged to the host, which performs the request and copies the buffered response back in:

Limit

Value

Timeout per request

10 seconds (rejects with TimeoutError)

Request/response body

8,388,608 bytes

Only http: and https: URLs are allowed and the host sends no cookies. A Blob or FormData can be the fetch body: a Blob sends its bytes under its MIME type and a FormData is sent as multipart. Request does not exist.

run_typescript caveats:

  • Type annotations, interfaces, type aliases and generics are erased, and line numbers in runtime stack traces stay exact.

  • enum, namespace and constructor parameter properties emit new code, which can push a runtime stack trace past the line you wrote.

  • esbuild reports compile errors on the line numbers you submitted.

Available Tools

2 tools
run_javascriptRun JavaScriptA

Execute JavaScript inside a hardened V8 isolate (isolated-vm) and return everything it printed.

Each call gets a brand new isolate, so no state, memory or globals are shared between runs. The isolate is a separate heap with no access to the host process: there is no require, process, timer or file-system API available.

Limits, per call:

  • 512 MB of V8 heap.

  • 30 seconds of wall time; the isolate is disposed when the limit is hit.

fetch is available: the isolate has no network stack of its own, so each request is performed by the host process and the response is copied back in. Per request:

  • 10 seconds of wall time; a slower request rejects with a TimeoutError.

  • Bodies in either direction are capped at 8388608 bytes.

  • http: and https: URLs only; the host sends no cookies and follows redirects unless redirect says otherwise.

Language notes:

  • The first line of the response reports how long the run took.

  • The snippet runs as the body of an async function, so top-level await and top-level return are both allowed.

  • console.log/console.info/console.debug are captured as stdout; console.warn, console.error and console.trace are captured as stderr.

  • fetch, Headers, Response, AbortController, TextEncoder and TextDecoder are minimal shims: response.text(), response.json(), response.arrayBuffer() and response.clone() work, but response.body is null (no streams, no blob()), URL/Request/FormData/Blob do not exist, and the isolate has no timers, so setTimeout and AbortSignal.timeout are unavailable.

  • A top-level return value is reported back under result:. - Uncaught exceptions, syntax errors and their stack traces are reported back under error:, and the tool is flagged as an error.

Inputs: code (required).

run_typescriptRun TypeScriptA

Execute TypeScript inside a hardened V8 isolate (isolated-vm) and return everything it printed.

Each call gets a brand new isolate, so no state, memory or globals are shared between runs. The isolate is a separate heap with no access to the host process: there is no require, process, timer or file-system API available.

Limits, per call:

  • 512 MB of V8 heap.

  • 30 seconds of wall time; the isolate is disposed when the limit is hit.

fetch is available: the isolate has no network stack of its own, so each request is performed by the host process and the response is copied back in. Per request:

  • 10 seconds of wall time; a slower request rejects with a TimeoutError.

  • Bodies in either direction are capped at 8388608 bytes.

  • http: and https: URLs only; the host sends no cookies and follows redirects unless redirect says otherwise.

Language notes:

  • The first line of the response reports how long the run took.

  • The snippet is compiled with esbuild (types stripped) and then executed exactly like run_javascript: same isolate, same limits, same output capture.

  • import/export module syntax is not supported: the isolate has no module resolver, so the snippet has to be self-contained.

  • Constructs that emit new code (enum, namespace, constructor parameter properties) make esbuild produce extra lines, so a runtime stack trace can point past the line you wrote. Plain type annotations keep line numbers exact.

  • The snippet runs as the body of an async function, so top-level await and top-level return are both allowed.

  • console.log/console.info/console.debug are captured as stdout; console.warn, console.error and console.trace are captured as stderr.

  • fetch, Headers, Response, AbortController, TextEncoder and TextDecoder are minimal shims: response.text(), response.json(), response.arrayBuffer() and response.clone() work, but response.body is null (no streams, no blob()), URL/Request/FormData/Blob do not exist, and the isolate has no timers, so setTimeout and AbortSignal.timeout are unavailable.

  • A top-level return value is reported back under result:. - Uncaught exceptions, syntax errors and their stack traces are reported back under error:, and the tool is flagged as an error.

Inputs: code (required).

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.2/5.0

    Scored across 2 tools

    Disambiguation4/5

    The two tools are distinguished primarily by language (JavaScript vs TypeScript), which is a clear and predictable selection criterion. However, TypeScript is close to a superset of JavaScript, so a plain JS snippet often runs fine in either tool, leaving a narrow band of genuine overlap.

    Naming Consistency5/5

    Both names follow the same verb_noun snake_case pattern (run_javascript, run_typescript) with a single shared verb and a language noun. The naming is fully predictable and symmetric.

    Tool Count4/5

    Two tools is on the thin side, but the server's scope is narrowly 'execute code in a sandbox,' and one tool per supported language is a defensible, minimal surface. No tool feels redundant or padded.

    Completeness4/5

    Core execution, output capture, error reporting, and fetch are covered, which is the full lifecycle for a stateless code sandbox. Gaps are deliberate constraints rather than omissions: no session/state persistence, no module resolution, no package installation, and no way to pass structured inputs into a run.

    Maintenance

    ActivityMaintained
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers