/ ディレクトリ / プレイグラウンド / mcp-js (V8 sandbox)
● コミュニティ r33drichards ⚡ 即起動

mcp-js (V8 sandbox)

作者 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.

なぜ使うのか

主な機能

ライブデモ

実際の動作

mcp-js-v8.replay ▶ 準備完了
0/0

インストール

クライアントを選択

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

Claude Desktop → Settings → Developer → Edit Config を開く。保存後、アプリを再起動。

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

Cursor は Claude Desktop と同じ mcpServers スキーマを使用。プロジェクト設定はグローバルより優先。

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

Cline サイドバーの MCP Servers アイコンをクリックし、"Edit Configuration" を選択。

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

Claude Desktop と同じ形式。Windsurf を再起動して反映。

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

Continue はマップではなくサーバーオブジェクトの配列を使用。

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

context_servers に追加。保存時に Zed がホットリロード。

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

ワンライナー。claude mcp list で確認、claude mcp remove で削除。

ユースケース

実用的な使い方: mcp-js (V8 sandbox)

Iteratively shape a JSON dataset across multiple tool calls

👤 Data wranglers ⏱ ~15 min intermediate

使うタイミング: Multi-step transform where you want to keep intermediate variables.

前提条件
  • Server/skill installed and authenticated — See repo README
フロー
  1. Load data
    eval_js: const data = await fetch('https://example.com/data.json').then(r => r.json()); data.length✓ コピーしました
    → Length printed
  2. Iterate
    eval_js: const filtered = data.filter(x => x.status === 'active'); filtered.length✓ コピーしました
    → Filtered count — data still in heap
  3. Snapshot
    snapshot_save name=cleanup-2026-05-21✓ コピーしました
    → Saved

結果: Notebook-style JS sessions without a notebook.

注意点
  • 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.
組み合わせ: filesystem

組み合わせ

他のMCPと組み合わせて10倍の力を

mcp-js-v8 + filesystem

Pair with filesystem for complementary capabilities

Use this server together with filesystem to complete a multi-step task.✓ コピーしました

ツール

このMCPが提供する機能

ツール入力呼び出すタイミングコスト
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

コストと制限

運用コスト

APIクォータ
See provider docs for rate limits
呼び出しあたりのトークン
Varies by tool
金額
See repo README for pricing details
ヒント
Cache tool results and avoid repeated identical calls.

セキュリティ

権限、シークレット、影響範囲

認証情報の保管: Use environment variables; never commit secrets
データ送信先: Tool calls go to the provider's API as documented

トラブルシューティング

よくあるエラーと対処法

context expired

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

確認: Reload from snapshot_load
memory limit exceeded

Raise MCP_JS_MAX_HEAP_MB or chunk the input.

確認: Reduce dataset size and retry

代替案

mcp-js (V8 sandbox) 他との比較

代替案代わりに使う場面トレードオフ
yepcode/mcp-server-jsYou want hosted execution with secretsHosted/paid vs local/free

その他

リソース

📖 GitHub の公式 README を読む

🐙 オープンな issue を見る

🔍 400以上のMCPサーバーとSkillsを見る