# mcp-v8

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.

- MCP server · `type=mcp` · Claude Code, Codex, Cursor, GitHub Copilot, Windsurf (Devin Desktop), Cline, Zed, Gemini CLI · ★ 62
- Author: r33drichards
- License: AGPL-3.0 · policy=link-only · description only; the file stays with the author
- Source: https://github.com/r33drichards/mcp-js
- Updated: 2026-10-23
- HTML: https://affpapa.org/en/nevibecode/mcp/mcp-v8

## What it 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.

## Requirements
- Needs: Docker

## Install

### Claude Code (native platform)

**Platform CLI**
```bash
claude mcp add mcp-v8 -- docker run -i --rm docker.io/wholelottahoopla/mcp-js:0.22.0
```

### Codex

**Platform CLI**
```bash
codex mcp add mcp-v8 -- docker run -i --rm docker.io/wholelottahoopla/mcp-js:0.22.0
```

### Cursor

**Config file**
File `.cursor/mcp.json`:
```json
{
    "mcpServers": {
        "mcp-v8": {
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "docker.io/wholelottahoopla/mcp-js:0.22.0"
            ]
        }
    }
}
```

### GitHub Copilot

**Config file**
File `.vscode/mcp.json`:
```json
{
    "servers": {
        "mcp-v8": {
            "type": "stdio",
            "command": "docker",
            "args": [
                "run",
                "-i",
                "--rm",
                "docker.io/wholelottahoopla/mcp-js:0.22.0"
            ]
        }
    }
}
```

### Gemini CLI

**Platform CLI**
```bash
gemini mcp add mcp-v8 docker run -i --rm docker.io/wholelottahoopla/mcp-js:0.22.0
```

## When to use it
- 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
- Run this JavaScript: `console.log([1,2,3].map(x => x*2))`
- Execute the script in `mcp-v8` and show me the last lines of output
- Use `run_js` to compute stats over this array and return the result

## Similar
- [REA](https://affpapa.org/en/nevibecode/mcp/rea.md) — MCP server · ★ 386989
- [GitHub](https://affpapa.org/en/nevibecode/mcp/github.md) — MCP server · ★ 33918
- [Netdata](https://affpapa.org/en/nevibecode/mcp/netdata.md) — MCP server · ★ 81115
- [browser-use](https://affpapa.org/en/nevibecode/mcp/browser-use.md) — MCP server · ★ 119160
- [Codebase Memory](https://affpapa.org/en/nevibecode/mcp/codebase-memory.md) — MCP server · ★ 47392
- [mcp-server](https://affpapa.org/en/nevibecode/mcp/mcp-server.md) — MCP server · ★ 43872

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
