JavaScript VM
You can run JavaScript and TypeScript snippets in a fresh sandboxed V8 isolate and retrieve their output, return value, or errors.
run_javascript: executes JavaScript as-is.run_typescript: strips TypeScript types with esbuild, then executes like JavaScript.Runs code as the body of an async function, allowing top-level
awaitand top-levelreturn.Captures
console.log/info/debugas stdout andconsole.warn/error/traceas stderr; reportsresult:anderror:.Provides host-bridged
fetchforhttp:/https:URLs (no cookies, 10s timeout, 8 MB body cap, redirects configurable).Uses minimal
fetch,Headers,Response,AbortController,TextEncoder,TextDecodershims; no streams, timers,require,process, or file-system APIs.No
import/export; each call gets a fresh isolate with no shared state.Per-call limits: 512 MB V8 heap, 30s wall clock, 262,144 characters buffered output per stream.
TypeScript caveat:
enum,namespace, and constructor parameter properties can shift runtime stack trace line numbers.
Provides a tool to run JavaScript snippets inside a fresh isolated V8 isolate, capturing stdout, stderr, return value, and errors, with support for top-level await and a bridged fetch API.
Provides a tool to run TypeScript snippets by compiling them with esbuild to JavaScript and executing them in the same isolated V8 VM, with type erasure and exact stack trace line numbers.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@JavaScript VM run this JavaScript: console.log([1,2,3].map(x => x*2))"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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 asrun_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 |
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,namespaceand 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 toolsrun_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:andhttps:URLs only; the host sends no cookies and follows redirects unlessredirectsays 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
awaitand top-levelreturnare both allowed.console.log/console.info/console.debugare captured as stdout;console.warn,console.errorandconsole.traceare captured as stderr.fetch,Headers,Response,AbortController,TextEncoderandTextDecoderare minimal shims:response.text(),response.json(),response.arrayBuffer()andresponse.clone()work, butresponse.bodyisnull(no streams, noblob()),URL/Request/FormData/Blobdo not exist, and the isolate has no timers, sosetTimeoutandAbortSignal.timeoutare unavailable.A top-level
returnvalue is reported back underresult:. - Uncaught exceptions, syntax errors and their stack traces are reported back undererror:, 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:andhttps:URLs only; the host sends no cookies and follows redirects unlessredirectsays 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/exportmodule 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
awaitand top-levelreturnare both allowed.console.log/console.info/console.debugare captured as stdout;console.warn,console.errorandconsole.traceare captured as stderr.fetch,Headers,Response,AbortController,TextEncoderandTextDecoderare minimal shims:response.text(),response.json(),response.arrayBuffer()andresponse.clone()work, butresponse.bodyisnull(no streams, noblob()),URL/Request/FormData/Blobdo not exist, and the isolate has no timers, sosetTimeoutandAbortSignal.timeoutare unavailable.A top-level
returnvalue is reported back underresult:. - Uncaught exceptions, syntax errors and their stack traces are reported back undererror:, 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
Scored across 2 tools
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.
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.
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.
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
Related MCP Connectors
Execute code in 8 languages (Python, JS, TS, Go, Java, C++, C, Bash) in gVisor sandboxes.
Hosted one-shot code execution: send a snippet plus optional files, get stdout, stderr, exit...
Beta code sandbox for agents. Run Python or JavaScript with no network and a 30 s timeout.
Run Python code in a secure sandbox without local setup. Declare inline dependencies and execute s…
Related MCP Servers
- FlicenseBqualityDmaintenanceProvides a secure, isolated JavaScript execution environment with configurable time and memory limits for safely running code from Claude.15-
- AlicenseNot gradedqualityDmaintenanceEnables secure cloud-based execution of code across 14+ programming languages within a sandboxed environment. It supports file management, standard input/output handling, and automatic generation of visual artifacts like plots and charts.MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to securely execute Python and C++ code snippets inside disposable, isolated Docker containers and receive structured results.31MIT
- FlicenseNot gradedqualityDmaintenanceExecutes Python code in isolated subprocesses with resource limits and timeout, designed for safe execution in Docker containers.-