Rust-based MCP server running sandboxed JavaScript/TypeScript with persistent V8 heap snapshots and policy-gated host capabilities.
Copy the AI prompt to install this server into Claude Code, Cursor, or another agent โ or use 1-click editor setup below.
๐ก Paste the JSON block into your client's configuration file under mcpServers, then restart the application.
Inspect callable tools, capabilities, and parameters exposed to AI agents by MCP Js.
run_jsStateful: queue execution โ `{execution_id}`. Stateless: run and return `{output, error?}`.
get_executionPoll status/result of an execution.
get_execution_outputRead paginated console output (line or byte).
cancel_executionTerminate a running execution.
list_executionsList executions and their status.
mcp-v8 is a Model Context Protocol server,
written in Rust, that lets an AI agent run JavaScript and TypeScript in a
sandboxed V8 isolate. Instead of wiring up dozens of narrow tools, you give the
agent one tool โ run_js โ and it writes code: looping, branching, transforming
data, and calling other tools, often with far fewer tokens than equivalent
tool-call chains.
In its default stateful mode the V8 heap is saved as a content-addressed snapshot, so an agent can build up state across many turns. Host capabilities (network, filesystem, subprocess, WebAssembly, module imports, and calls to other MCP servers) are all off by default and unlocked only by explicit OPA/Rego policies.
fetch, filesystem, subprocess, and external imports are denied until you grant them via policy.--sandbox-manifest confines the whole process with a nono capability manifest (Landlock on Linux, Seatbelt on macOS) as defense in depth beneath the policy layer.Maintainers: see Publishing to the MCP Registry for the Docker-backed registry manifest and automated release process.
Full documentation lives at https://r33drichards.github.io/mcp-js/ (built
from site-docs/) โ tutorials, how-to guides, concept
explanations, and complete reference for the CLI flags,
HTTP API, and
MCP tools.
Installs to /usr/local/bin. Supported platforms: Linux x86_64/arm64 and macOS
Apple Silicon. You can also nix run github:r33drichards/mcp-js, use Docker (see
the docker-compose.*.yml stacks), or build from source.
Prefer a hosted server? Deploy on Railway โ the repo's
railway.json configures the build, healthcheck, and restart policy, and
RAILWAY.md walks through the volume, variables, and one-click
template setup.
For Claude Desktop / Cursor, add to the client's mcpServers config:
Then ask the agent: "Run this JavaScript: console.log([1,2,3].map(x => x*2))".
/api/exec accepts either a JSON body or a raw-body file upload โ send the
script as the request body with a non-JSON Content-Type
(curl --data-binary @script.js -H 'Content-Type: application/javascript' .../api/exec).
The run_js MCP tool can also read a script from a path on the server itself
via an optional file parameter โ off by default, enabled with
--allow-run-js-file or a run_js_file
policy.
See the Quick Start tutorials and the transports guide for more.
Every flag can also live in one TOML or JSON file passed via --config (or
MCP_V8_CONFIG), including structured sections that replace the separate
WASM / MCP-server / fetch-header / policy JSON files:
Precedence is CLI flag > MCP_V8_* env var > config file > default. See the
configuration file reference.
deno_core); TypeScript types are stripped with SWC (type removal, not type checking).setTimeout/clearTimeout.console.log/info/warn/error/debug/trace, streamed to storage and readable with line- or byte-based pagination.run_js returns an execution ID; poll status and stream output; cancel running work.WebAssembly API, plus pre-loaded modules (--wasm-module) exposed as globals and advertised to clients as runjs__wasm__<name> stub tools.npm:, jsr:, and URL imports fetched at runtime (policy-gated).fetch, filesystem (fs), and subprocess access, each checked against a Rego policy per operation; plus header/OAuth injection for fetch.mcp.callTool() / mcp.listTools().instructions and the run_js description (--instructions, --run-js-description).--config file can set every flag (precedence: CLI flag > env var > config file > default).--sse-port, served by a vendored rmcp 0.1.5), with a REST sidecar and OpenAPI spec.run_js as a task (tasks/get, tasks/result, tasks/list, tasks/cancel), ideal for long-running calls. (The legacy SSE transport does not offer tasks.)These globals are available inside run_js (capability globals require a policy):
| Global | Purpose | Gated by |
|---|---|---|
console, setTimeout | Output & timers | โ |
fetch(url, opts?) | HTTP requests (Fetch API) | fetch policy |
fs.* | File I/O (readFile, writeFile, โฆ) | filesystem policy |
child_process / Deno.Command | Run subprocesses | subprocess policy |
import (npm: / jsr: / URL) | External ES modules | --allow-external-modules + modules policy |
WebAssembly, __wasm_<name> | Run/instantiate WASM | โ |
mcp.callTool/listTools/servers | Call upstream MCP servers | mcp_tools policy |
See Concepts โ Security policies for the policy model.
| Tool | Mode | Description |
|---|---|---|
run_js | both | Stateful: queue execution โ {execution_id}. Stateless: run and return {output, error?}. |
get_execution | stateful | Poll status/result of an execution. |
get_execution_output | stateful | Read paginated console output (line or byte). |
cancel_execution | stateful | Terminate a running execution. |
list_executions | stateful | List executions and their status. |
list_sessions, list_session_snapshots | stateful | Browse named sessions and history. |
get_heap_tags, set_heap_tags, delete_heap_tags, query_heaps_by_tags | stateful | Tag and search heap snapshots. |
Full parameters: MCP tools reference.
The server natively implements the MCP tasks utility (spec 2025-11-25 /
SEP-1319) via rmcp, over both the Streamable HTTP and stdio transports. The
initialize result advertises a tasks capability, and a client may run the
task-augmentable run_js tool as a task by adding a task object to the
request params:
Factual signals from GitHub, npm, and our automated checks โ not a rating.
No reviews yet โ be the first to share how this listing worked for you.
Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.
[](https://allmcps.com/mcp/r33drichards-mcp-js)<a href="https://allmcps.com/mcp/r33drichards-mcp-js"><img src="https://allmcps.com/api/badge/r33drichards-mcp-js?style=directory" alt="MCP Js on AllMCPs" /></a>