Track MCP LogoTrack MCP
Track MCP LogoTrack MCP

The world's largest repository of Model Context Protocol servers. Discover, explore, and submit MCP tools.

Product

  • Categories
  • Top MCP
  • New & Updated
  • Submit MCP

Company

  • About

Legal

  • Privacy Policy
  • Terms of Service
  • Cookie Policy

© 2026 TrackMCP. All rights reserved.

Built with ❤️ by Krishna Goyal

    Mcp Js

    MCP server that exposes a V8 JavaScript runtime as a tool for AI agents like Claude and Cursor. Supports persistent heap snapshots via S3 or local filesystem, and is ready for integration with modern AI development environments.

    19 stars
    Rust
    Updated Oct 17, 2025

    Table of Contents

    • Why mcp-v8
    • Documentation
    • Quick start
    • Install
    • Connect an MCP client
    • Run over HTTP
    • Features
    • What the agent's code can do
    • MCP tools
    • Configuration
    • CLI client (mcp-v8-cli)
    • Rust client (mcp-v8-client)
    • Build from source
    • Limitations
    • License
    • Results
    • P95 Latency
    • Notes

    Table of Contents

    • Why mcp-v8
    • Documentation
    • Quick start
    • Install
    • Connect an MCP client
    • Run over HTTP
    • Features
    • What the agent's code can do
    • MCP tools
    • Configuration
    • CLI client (mcp-v8-cli)
    • Rust client (mcp-v8-client)
    • Build from source
    • Limitations
    • License
    • Results
    • P95 Latency
    • Notes

    Documentation

    mcp-v8 — a JavaScript/TypeScript runtime for AI agents

    Docs

    Release

    License: AGPL v3

    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.

    Why mcp-v8

    • One tool, unbounded capability. The agent runs a program, not a fixed menu of tools.
    • Durable state. Heap snapshots persist variables and objects across calls.
    • Secure by default. fetch, filesystem, subprocess, and external imports are denied until you grant them via policy.
    • Production-ready. stdio / Streamable HTTP / SSE transports, a REST sidecar, async execution with pagination, JWKS auth, and Raft-replicated clustering.

    Documentation

    Full documentation lives at **** (built

    from [site-docs/](./site-docs)) — tutorials, how-to guides, concept

    explanations, and complete reference for the CLI flags,

    HTTP API, and

    MCP tools.

    Quick start

    Install

    bash
    # Server
    curl -fsSL https://raw.githubusercontent.com/r33drichards/mcp-js/main/install.sh | sudo bash
    
    # Optional CLI client
    curl -fsSL https://raw.githubusercontent.com/r33drichards/mcp-js/main/install-cli.sh | sudo bash

    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.

    Connect an MCP client

    bash
    # Claude Code (stdio)
    claude mcp add mcp-v8 -- mcp-v8 --directory-path /tmp/mcp-v8-heaps   # stateful
    claude mcp add mcp-v8 -- mcp-v8 --stateless                          # stateless

    For Claude Desktop / Cursor, add to the client's mcpServers config:

    json
    { "mcpServers": { "js": { "command": "mcp-v8", "args": ["--stateless"] } } }

    Then ask the agent: *"Run this JavaScript: console.log([1,2,3].map(x => x*2))"*.

    Run over HTTP

    bash
    mcp-v8 --stateless --http-port 8080
    # MCP endpoint: POST http://localhost:8080/mcp
    # REST sidecar: POST http://localhost:8080/api/exec  (JSON body, or a raw-body file upload)

    /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.

    Features

    • JavaScript & TypeScript in an isolated V8 engine (via deno_core); TypeScript types are stripped with SWC (type removal, not type checking).
    • Async/await & timers — Promises and the event loop, plus setTimeout/clearTimeout.
    • Console capture — console.log/info/warn/error/debug/trace, streamed to storage and readable with line- or byte-based pagination.
    • Async execution model — run_js returns an execution ID; poll status and stream output; cancel running work.
    • Content-addressed heap snapshots — persist/restore V8 state across calls (local FS, S3, or S3 + write-through cache), or run stateless.
    • WebAssembly — the standard WebAssembly API, plus pre-loaded modules (--wasm-module) exposed as globals and advertised to clients as runjs__wasm__ stub tools.
    • ES module imports — optional npm:, jsr:, and URL imports fetched at runtime (policy-gated).
    • Policy-gated capabilities — fetch, filesystem (fs), and subprocess access, each checked against a Rego policy per operation; plus header/OAuth injection for fetch.
    • Compose other MCP servers — connect upstream MCP servers and call them from JS via mcp.callTool() / mcp.listTools().
    • Customizable surface — override the server instructions and the run_js description (--instructions, --run-js-description).
    • Auth & clustering — JWKS-based JWT verification, and optional Raft clustering with replicated session metadata and horizontal scaling.
    • Multiple transports — stdio, Streamable HTTP (MCP 2025-03-26+), and SSE, with a REST sidecar and OpenAPI spec.

    What the agent's code can do

    These globals are available inside run_js (capability globals require a policy):

    GlobalPurposeGated by
    console, setTimeoutOutput & timers—
    fetch(url, opts?)HTTP requests (Fetch API)fetch policy
    fs.*File I/O (readFile, writeFile, …)filesystem policy
    child_process / Deno.CommandRun subprocessessubprocess policy
    import (npm: / jsr: / URL)External ES modules--allow-external-modules + modules policy
    WebAssembly, __wasm_Run/instantiate WASM—
    mcp.callTool/listTools/serversCall upstream MCP serversmcp_tools policy

    See Concepts → Security policies for the policy model.

    MCP tools

    ToolModeDescription
    run_jsbothStateful: queue execution → {execution_id}. Stateless: run and return {output, error?}.
    get_executionstatefulPoll status/result of an execution.
    get_execution_outputstatefulRead paginated console output (line or byte).
    cancel_executionstatefulTerminate a running execution.
    list_executionsstatefulList executions and their status.
    list_sessions, list_session_snapshotsstatefulBrowse named sessions and history.
    get_heap_tags, set_heap_tags, delete_heap_tags, query_heaps_by_tagsstatefulTag and search heap snapshots.

    Full parameters: MCP tools reference.

    Configuration

    mcp-v8 is configured entirely through CLI flags — storage backend, transport,

    execution limits, policies, fetch-header injection, WASM modules, clustering, JWKS

    auth, and the prompt/tool-description overrides. The complete, always-current list

    is the generated CLI flags reference.

    bash
    mcp-v8 --help            # all flags
    mcp-v8 --print-openapi   # print the REST OpenAPI spec

    CLI client (mcp-v8-cli)

    A fully-typed client for the REST API, generated from the OpenAPI spec via

    progenitor:

    bash
    mcp-v8 --stateless --http-port 3000 &
    mcp-v8-cli exec "console.log('hello'); 1 + 1"
    mcp-v8-cli exec --file ./script.js                # run a local file (uploaded as the code)
    mcp-v8-cli executions get 
    mcp-v8-cli executions output 
    export MCP_V8_URL=https://my-server.example.com   # point at a remote server

    Rust client (mcp-v8-client)

    toml
    [dependencies]
    mcp-v8-client = { git = "https://github.com/r33drichards/mcp-js" }
    rust
    use mcp_v8_client::Client;
    let client = Client::new("http://localhost:3000");
    let body = mcp_v8_client::types::ExecRequest {
        code: "1 + 1".to_string(),
        heap: None, session: None,
        heap_memory_max_mb: None, execution_timeout_secs: None, tags: None,
    };
    let resp = client.exec_handler(&body).await?;
    println!("execution_id: {}", resp.into_inner().execution_id);

    Build from source

    The repo is a Nix flake (it wires up the prefetched V8 archive so the build stays

    offline-friendly):

    bash
    nix build github:r33drichards/mcp-js   # → ./result/bin/server
    # or for development:
    nix develop      # then: cargo build -p server

    A plain cargo build --release inside server/ also works if your toolchain can

    build deno_core/V8.

    Limitations

    • **setInterval is not available** — use a loop with awaited setTimeout.
    • No DOM or browser APIs — there is no window/document.
    • TypeScript is type-stripped, not type-checked — invalid types are removed, not reported. JSX/TSX is not supported (it parses to a clear error).

    License

    GNU AGPL-3.0.

    MCP-V8 Load Test Benchmark Report v0.1.0

    Comparison of single-node vs 3-node cluster at various request rates.

    Results

    ran on railway gha runners on pr

    TopologyTarget RateActual Iter/sHTTP Req/sExec Avg (ms)Exec p95 (ms)Exec p99 (ms)Success %DroppedMax VUs
    cluster-stateful100/s99.599.544.9196.88416.99100%3141
    cluster-stateful200/s199.6199.623.2279.32131.13100%1333
    cluster-stateless1000/s999.9999.93.827.7213.09100%0100
    cluster-stateless100/s1001003.675.658.03100%010
    cluster-stateless200/s2002003.565.98.61100%020
    cluster-stateless500/s5005003.425.859.2100%050
    single-stateful100/s99.199.1215.12362.5376.6100%3242
    single-stateful200/s97.897.81948.822212.552960.96100%5939200
    single-stateless1000/s977.1977.160.98482.98602.38100%843561
    single-stateless100/s1001003.715.738.73100%010
    single-stateless200/s2002003.615.437.74100%020
    single-stateless500/s5005004.678.4927.98100%050

    P95 Latency

    TopologyRateP95 (ms)
    cluster-stateful100/s196.88█████████████████████
    cluster-stateful200/s79.32█████████████████
    cluster-stateless100/s5.65███████
    cluster-stateless200/s5.9███████
    cluster-stateless500/s5.85███████
    cluster-stateless1000/s7.72████████
    single-stateful100/s362.5███████████████████████
    single-stateful200/s2212.55██████████████████████████████
    single-stateless100/s5.73███████
    single-stateless200/s5.43██████
    single-stateless500/s8.49████████
    single-stateless1000/s482.98████████████████████████

    Notes

    • Target Rate: The configured constant-arrival-rate (requests/second k6 attempts)
    • Actual Iter/s: Achieved iterations per second (each iteration = 1 POST /api/exec)
    • HTTP Req/s: Total HTTP requests per second (1 per iteration)
    • Dropped: Iterations k6 couldn't schedule because VUs were exhausted (indicates server saturation)
    • Topology: single = 1 MCP-V8 node; cluster = 3 MCP-V8 nodes with Raft

    Similar MCP

    Based on tags & features

    • WI

      Winx Code Agent

      Rust·
      19
    • IM

      Imagen3 Mcp

      Rust·
      46
    • MC

      Mcp Access Point

      Rust·
      135
    • CO

      Code Assistant

      Rust·
      103

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k
    View All MCP Servers

    Similar MCP

    Based on tags & features

    • WI

      Winx Code Agent

      Rust·
      19
    • IM

      Imagen3 Mcp

      Rust·
      46
    • MC

      Mcp Access Point

      Rust·
      135
    • CO

      Code Assistant

      Rust·
      103

    Trending MCP

    Most active this week

    • PL

      Playwright Mcp

      TypeScript·
      22.1k
    • SE

      Serena

      Python·
      14.5k
    • MC

      Mcp Playwright

      TypeScript·
      4.9k
    • MC

      Mcp Server Cloudflare

      TypeScript·
      3.0k