ScratchRun

dev.scratchrunPublished by scratchrun.devv0.1.1Updated Oct 24, 2026

Ephemeral MicroVM-isolated code execution for AI agents. Fresh VM per call, hard-purged after.

VerifiedSTDIODesktop onlyCloud & InfrastructureDeveloper Tools

Overview

AI-generated overview

Runs short Python, Node, or Bash snippets in a disposable isolated MicroVM and returns stdout, stderr, exit code, and output files.

What you can do
ScratchRun exposes a single tool, scratchrun_exec, that executes code in a fresh hardware-isolated MicroVM and returns stdout, stderr, the exit code, and any requested output files. Callers choose a runtime (python3.12, python3.11, node20, or bash), can set a timeout and memory limit, pass environment variables, write input files before the run, and capture files afterward as base64. Image outputs are returned as MCP image content blocks. Each VM is destroyed after the call, so nothing persists between runs.
When to use it
Useful when an assistant needs to actually run code — quick calculations, data transforms, generating a chart, or testing a snippet — without touching the user's own machine or leaving state behind. It fits one-off, stateless execution rather than long-running jobs or work that must persist files between calls.
Requirements
A local Node.js runtime to run the npm package @scratchrun/mcp-server via npx, plus a ScratchRun API key supplied in the SCRATCHRUN_API_KEY environment variable. Network access to the ScratchRun service is required. Desktop client only; no web execution.
Before you install
The server requires the secret SCRATCHRUN_API_KEY, which is sent to a third-party service, and code and any files passed to scratchrun_exec leave the user's machine for remote execution. Environment variables passed to the tool are intended for secrets, so avoid placing credentials in code strings. Execution is billed or quota-limited by the provider, and the sandbox blocks private and cloud metadata addresses, so code needing internal network access will fail.

Installation

In SourceWeft

  1. Open ScratchRun in the dashboard and add it to a workspace.
  2. Enable the server for the chats that should use its tools.

Desktop only via STDIO. STDIO servers start a local process, so they need the SourceWeft desktop host.

Other MCP clients

Follow the launch instructions in the repository.

README

@scratchrun/mcp-server

MCP server for ScratchRun — ephemeral, MicroVM-isolated code execution for AI agents.

Each call runs in a fresh hardware-isolated MicroVM. The VM is hard-purged after execution. No state, no files, nothing persists between calls.

Install

Add to your claude_desktop_config.json:

json
{  "mcpServers": {    "scratchrun": {      "command": "npx",      "args": ["-y", "@scratchrun/mcp-server"],      "env": {        "SCRATCHRUN_API_KEY": "sr_live_your_key_here"      }    }  }}

Get an API key at scratchrun.dev.

Tool: scratchrun_exec

Executes code in an ephemeral sandbox and returns stdout, stderr, exit code, and any output files.

Parameters:

ParameterTypeRequiredDescription
runtimepython3.12 | python3.11 | node20 | bashyesRuntime to use
codestringyesCode to execute
timeout_msintegernoTimeout in ms (default 10000, max 30000)
memory_mbintegernoMemory limit in MB (default 256, max 512)
envobjectnoEnvironment variables — use for secrets, not code strings
filesobjectnoFiles to write before execution (path → content)
return_filesstring[]noFile paths to capture after execution (returned as base64)

Example — run Python and return a chart:

json
{  "runtime": "python3.12",  "code": "import matplotlib.pyplot as plt\nimport numpy as np\nx = np.linspace(0, 10, 100)\nplt.plot(x, np.sin(x))\nplt.savefig('/tmp/plot.png')",  "return_files": ["/tmp/plot.png"]}

Output files are returned as base64. Image files (PNG, JPG, SVG) are returned as MCP image content blocks and render inline in Claude.

Isolation

  • Hardware-virtualized MicroVM per execution (own kernel, not a shared-kernel container)
  • TerminateMicroVM called unconditionally after every run — VM destroyed, never reused
  • RFC 1918 + cloud metadata (169.254.x.x) always blocked at the network layer
  • Read-only system filesystem via OverlayFS; /tmp is RAM-backed and gone with the VM

Latency

~400ms median (warm pool). 2–8s cold start if the pool is empty.

License

MIT

Source: README.md at commit 2d8ebee

Tools

0
SourceWeft has not started this package in its sandbox yet, so its tools are not known.

Version history

1
  1. v0.1.1LatestSep 16, 2026

Score

40% of the applicable checks met

How complete this listing is, computed from the registry entry, the endpoint and public sources. Not a rating of the server and not a statement that it is safe or working today: reachability is a dated check, and no installs or reviews go into the score.

  • Reached in the last 30 days25 pts

    Keep the endpoint answering the MCP handshake; SourceWeft probes it every 30 days.

  • Auth declared10 pts

    Declare the credential headers in the registry entry, or keep the endpoint answering the probe so its auth can be classified.

  • Tools listed15 pts

    Answer tools/list without a credential, or ship a package that starts in a sandbox without one.

  • DescriptionRequired15 pts
  • Logo10 pts
  • Documentation15 pts
  • License10 pts

    Declare a license in the repository or the registry entry.