mcp-v8 — Claude Code MCP server: sandboxed JavaScript runtime
Hands the agent one tool, run_js, and executes the JavaScript or TypeScript it writes inside an isolated V8. Useful once tool-call chains get long.
claude mcp add mcp-v8 -- docker run -i --rm docker.io/wholelottahoopla/mcp-js:0.22.0What mcp-v8 does
The server is written in Rust and runs on deno_core. Rather than a menu of narrow tools, the agent gets run_js and writes a program: loops, branches, data reshaping, calls to other tools. State is kept by default. The V8 heap goes into a content-addressed snapshot, so variables survive across turns. A stateless mode exists too.
Network access, filesystem, subprocesses, WebAssembly and module imports stay shut until a Rego policy opens them, and the check happens per operation. TypeScript gets its types stripped by SWC, with no type checking. Reading a script from a path on the server requires --allow-run-js-file or the run_js_file policy; otherwise the file parameter does nothing.
Settings can live in a single TOML or JSON file passed with --config. Precedence runs CLI flag, then the MCP_V8_* variable, then the file, then the default. Transports are stdio, Streamable HTTP and SSE.
What it helps with
- reshape data in one script instead of a chain of tool calls
- keep variables alive between agent turns with a heap snapshot
- grant network or file access only through an explicit Rego policy
- compute on the server and pull the output back page by page
- call another MCP server from JavaScript with
mcp.callTool()
Example prompts for the agent
- Run this JavaScript:
console.log([1,2,3].map(x => x*2)) - Execute the script in
mcp-v8and show me the last lines of output - Use
run_jsto compute stats over this array and return the result
How to install mcp-v8
Platform CLI
claude mcp add mcp-v8 -- docker run -i --rm docker.io/wholelottahoopla/mcp-js:0.22.0Platform CLI
codex mcp add mcp-v8 -- docker run -i --rm docker.io/wholelottahoopla/mcp-js:0.22.0Config file
{
"mcpServers": {
"mcp-v8": {
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"docker.io/wholelottahoopla/mcp-js:0.22.0"
]
}
}
}Config file
{
"servers": {
"mcp-v8": {
"type": "stdio",
"command": "docker",
"args": [
"run",
"-i",
"--rm",
"docker.io/wholelottahoopla/mcp-js:0.22.0"
]
}
}
}Platform CLI
gemini mcp add mcp-v8 docker run -i --rm docker.io/wholelottahoopla/mcp-js:0.22.0Step by step, with commands for each platform: How to add an MCP server to Claude Code, Codex, Cursor, VS Code, Gemini CLI and more
Questions about mcp-v8
How do I install mcp-v8 in Claude Code?
One command does it: claude mcp add mcp-v8 -- docker run -i --rm docker.io/wholelottahoopla/mcp-js:0.22.0. The server runs in a container over stdio.
What does mcp-v8 do?
It runs JavaScript and TypeScript on the agent's behalf in a separate V8 and returns the result. Heap state can persist between calls.
Which capabilities are off by default?
Network, filesystem, subprocesses and module imports. Rego policies turn them on, and every operation is checked.