/ Directory / Playground / mcp-js (V8 sandbox)
● Community r33drichards ⚡ Instant

mcp-js (V8 sandbox)

by r33drichards · r33drichards/mcp-js

Run untrusted JS in a V8 isolate — persistent heap, S3-backed snapshots.

mcp-js exposes a V8 isolate as an MCP code-execution tool. It can persist the heap across calls (so variables survive between tool calls) and snapshot to S3 — useful for long-running data-prep sessions where you want JavaScript state without standing up a notebook.

Why use it

Key features

Live Demo

What it looks like in practice

mcp-js-v8.replay ▶ ready
0/0

Install

Pick your client

~/Library/Application Support/Claude/claude_desktop_config.json  · Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "mcp-js-v8": {
      "command": "mcp-js",
      "args": []
    }
  }
}

Open Claude Desktop → Settings → Developer → Edit Config. Restart after saving.

~/.cursor/mcp.json · .cursor/mcp.json
{
  "mcpServers": {
    "mcp-js-v8": {
      "command": "mcp-js",
      "args": []
    }
  }
}

Cursor uses the same mcpServers schema as Claude Desktop. Project config wins over global.

VS Code → Cline → MCP Servers → Edit
{
  "mcpServers": {
    "mcp-js-v8": {
      "command": "mcp-js",
      "args": []
    }
  }
}

Click the MCP Servers icon in the Cline sidebar, then "Edit Configuration".

~/.codeium/windsurf/mcp_config.json
{
  "mcpServers": {
    "mcp-js-v8": {
      "command": "mcp-js",
      "args": []
    }
  }
}

Same shape as Claude Desktop. Restart Windsurf to pick up changes.

~/.continue/config.json
{
  "mcpServers": [
    {
      "name": "mcp-js-v8",
      "command": "mcp-js",
      "args": []
    }
  ]
}

Continue uses an array of server objects rather than a map.

~/.config/zed/settings.json
{
  "context_servers": {
    "mcp-js-v8": {
      "command": {
        "path": "mcp-js",
        "args": []
      }
    }
  }
}

Add to context_servers. Zed hot-reloads on save.

claude mcp add mcp-js-v8 -- mcp-js 

One-liner. Verify with claude mcp list. Remove with claude mcp remove.

Use Cases

Real-world ways to use mcp-js (V8 sandbox)

Iteratively shape a JSON dataset across multiple tool calls

👤 Data wranglers ⏱ ~15 min intermediate

When to use: Multi-step transform where you want to keep intermediate variables.

Prerequisites
  • Server/skill installed and authenticated — See repo README
Flow
  1. Load data
    eval_js: const data = await fetch('https://example.com/data.json').then(r => r.json()); data.length✓ Copied
    → Length printed
  2. Iterate
    eval_js: const filtered = data.filter(x => x.status === 'active'); filtered.length✓ Copied
    → Filtered count — data still in heap
  3. Snapshot
    snapshot_save name=cleanup-2026-05-21✓ Copied
    → Saved

Outcome: Notebook-style JS sessions without a notebook.

Pitfalls
  • V8 isolate has no Node APIs by default. If you need fs/net, opt in explicitly — V8 isolate has no Node APIs by default. If you need fs/net, opt in explicitly — and remember Claude can then write to disk.
Combine with: filesystem

Combinations

Pair with other MCPs for X10 leverage

mcp-js-v8 + filesystem

Pair with filesystem for complementary capabilities

Use this server together with filesystem to complete a multi-step task.✓ Copied

Tools

What this MCP exposes

ToolInputsWhen to callCost
eval_js context_id, code Run a JS snippet, optionally with state from prior calls free (local)
snapshot_save context_id, name Persist current heap free / S3 PUT
snapshot_load name Resume an earlier session free / S3 GET

Cost & Limits

What this costs to run

API quota
See provider docs for rate limits
Tokens per call
Varies by tool
Monetary
See repo README for pricing details
Tip
Cache tool results and avoid repeated identical calls.

Security

Permissions, secrets, blast radius

Credential storage: Use environment variables; never commit secrets
Data egress: Tool calls go to the provider's API as documented

Troubleshooting

Common errors and fixes

context expired

Contexts expire after the configured idle window. Use snapshot_save before long pauses.

Verify: Reload from snapshot_load
memory limit exceeded

Raise MCP_JS_MAX_HEAP_MB or chunk the input.

Verify: Reduce dataset size and retry

Alternatives

mcp-js (V8 sandbox) vs others

AlternativeWhen to use it insteadTradeoff
yepcode/mcp-server-jsYou want hosted execution with secretsHosted/paid vs local/free

More

Resources

📖 Read the official README on GitHub

🐙 Browse open issues

🔍 Browse all 400+ MCP servers and Skills