ScratchRun logo

ScratchRun

Runs Python, Node.js, or Bash in a fresh, hardware-isolated MicroVM for every agent request.

Install ScratchRun

Pick your client, then add it in one click or paste the config.

STDIONode.js
~/Library/Application Support/Claude/claude_desktop_config.json
claude_desktop_config.json
{
  "mcpServers": {
    "scratchrun": {
      "command": "npx",
      "args": [
        "-y",
        "@scratchrun/mcp-server"
      ],
      "env": {
        "SCRATCHRUN_API_KEY": "YOUR_VALUE_HERE"
      }
    }
  }
}

Settings → Developer → Edit Config, merge this into mcpServers, then fully quit and reopen Claude Desktop.

Values are written into the snippet above so you can paste it as is. They never leave your browser.

Automated check passed— started and listed 1 tools correctly ().

Overview

ScratchRun MCP server executes Python, Node.js, or Bash code inside a newly created hardware-isolated MicroVM for each call. It returns standard output, standard error, exit status, and optionally captured files, including inline image content for supported formats. Configure it with an API key and use it when code must run without persistent files or reused execution state. Calls can set timeouts, memory limits, environment variables, and input files.

Use cases

  • Run isolated Python calculations
  • Generate charts and return image files
  • Transform data with temporary scripts
  • Execute Bash or Node.js without persistent state

Key features

  • Fresh hardware-isolated MicroVM per execution
  • Python 3.12, Python 3.11, Node.js 20, and Bash runtimes
  • Configurable timeout and memory limits
  • Input files and environment variables
  • Captured output files returned as base64 or image content

Tools1

What ScratchRun lets your agent do. Expand a tool for its parameters.

Verified live~359 tokens of context

Security & health

What it can reach and how reliably it runs — from our own checks, not the maintainer’s claims.

ActiveLast checked

Recent health check succeeded.

22/26 checks healthy over the last 112d

What it can do

From the 1 tool this server returned when we ran it.

Runs commands · 1Handles credentials · 1
Network at startup3 connections
Files written at startupNone
Install scriptsNone
npm provenanceNot published
Package age76 days
Maintainers1

Observed 2026-10-20 in an isolated sandbox. A description of reach, not a security audit.

Supply-chain signal

No high-severity advisories surfaced by our automated scan.

Critical 0High 0Medium 0Low 0

Scanned 7d ago via OSV.dev · @scratchrun/mcp-server (npm)

Adoption & maintenance

Factual signals from GitHub, npm, and our automated checks — not a rating.

npm downloads1.1kPackage downloads in the last 30 days.
Last commit3mo agoMost recent push to the default branch.
Availability100%Our rolling endpoint + install checks that succeeded.
Install checkPassedOur sandbox started it and listed its tools.
Tools exposed1Callable tools this server registers over MCP.
Directory activity1 viewsConfig copies, upvotes, and views on AllMCPs.

How ScratchRun works

What ScratchRun MCP server does

ScratchRun MCP server gives an MCP-compatible agent one execution tool, scratchrun_exec, for running code in isolated MicroVMs. Supported runtimes are Python 3.12, Python 3.11, Node.js 20, and Bash. Every invocation receives a new virtual machine rather than sharing a prior execution environment.

The tool returns the program's standard output, standard error, and exit code. It can also collect selected files created during the run. Captured files are returned as base64; PNG, JPG, and SVG images are exposed as MCP image content blocks so compatible clients can display them inline.

The execution model suits agents that need temporary computation, data transformation, report generation, or visual output without retaining a workspace between requests.

How it works

A request specifies a runtime and code string. Optional inputs include an environment-variable map, files to create before execution, a timeout, a memory ceiling, and paths to return afterward. The default timeout is 10,000 milliseconds and the maximum is 30,000 milliseconds. Memory defaults to 256 MB and can be raised to 512 MB.

Each run uses hardware virtualization with its own kernel. After execution, the MicroVM is terminated unconditionally and is not reused. The system filesystem is read-only through OverlayFS, while /tmp is RAM-backed and disappears with the VM. Network access to RFC 1918 address space and the cloud metadata address 169.254.x.x is blocked at the network layer.

Warm-pool requests have a reported median latency of about 400 milliseconds. When no warm capacity is available, startup may take approximately 2–8 seconds.

Setup and configuration

The ScratchRun MCP server can be launched through npx using the package @scratchrun/mcp-server. Add a server entry to the MCP client configuration with npx -y @scratchrun/mcp-server as the command and provide SCRATCHRUN_API_KEY in its environment. An API key is obtained from scratchrun.dev.

A minimal configuration uses the scratchrun server name, the npx command, the -y and package-name arguments, and the API key environment variable. Pass secrets through the tool's env object when code needs them; do not embed those values directly in code strings.

Tools and capabilities

The ScratchRun MCP server exposes scratchrun_exec with these inputs:

  • runtime: required; one of python3.12, python3.11, node20, or bash.
  • code: required source text to execute.
  • timeout_ms: optional execution limit from the default of 10,000 up to 30,000 milliseconds.
  • memory_mb: optional limit from the default of 256 up to 512 MB.
  • env: optional environment variables for the process.
  • files: optional path-to-content mapping for files created before execution.
  • return_files: optional paths to capture after execution.

For example, an agent can run a Python plotting script, save an image under /tmp, and request that path in return_files.

Limitations and notes

Execution is intentionally non-persistent: files, installed state, and other VM contents are removed after each call. Work that depends on a previous invocation must recreate its inputs in a later request. Runtime choice is limited to the four listed options, and execution time and memory are capped by the documented maximums.

Network restrictions block private RFC 1918 ranges and cloud metadata access. The material does not describe package installation behavior, persistent storage, additional runtimes, or a mechanism for retaining state across calls, so those should not be assumed.

Written by AllMCPs with AI assistance from the project’s README and listing data. How we build listings

Reviews

No reviews yet — be the first to share how it worked for you.

Frequently Asked Questions about ScratchRun

ScratchRun is an MCP server that connects AI agents to ephemeral, hardware-isolated MicroVMs for code execution. Its main tool, scratchrun_exec, runs Python, Node.js, or Bash and returns stdout, stderr, exit status, and selected output files. Each VM is destroyed after the call, so state does not persist.

Install it through an MCP client configuration using npx and the @scratchrun/mcp-server package. Add the command npx -y @scratchrun/mcp-server and set SCRATCHRUN_API_KEY in the server environment. Obtain the API key from scratchrun.dev.

ScratchRun supports python3.12, python3.11, node20, and bash. Select one of these values in the required runtime parameter when calling scratchrun_exec.

Yes, ScratchRun can return selected files when their paths are supplied in return_files. Files are encoded as base64, while PNG, JPG, and SVG outputs are returned as MCP image content blocks.

No, ScratchRun does not preserve files between executions. Every call uses a fresh MicroVM, and the VM, its temporary filesystem, and its execution state are destroyed afterward.

Related MCP servers

Add a badge to your READMEShow it’s listed — live SVG, Markdown or HTML.

AllMCPs Directory Badge

Full Badge Customizer

Showcase your server listing on GitHub or your project documentation. Embed this dynamic SVG badge to highlight official listing status and live engagement.

Badge Style:
Live Dynamic SVG PreviewScratchRun AllMCPs Directory Badge
Markdown (GitHub README)
[![AllMCPs](https://allmcps.com/api/badge/scratchrun?style=directory)](https://allmcps.com/mcp/scratchrun)
HTML Embed
<a href="https://allmcps.com/mcp/scratchrun"><img src="https://allmcps.com/api/badge/scratchrun?style=directory" alt="ScratchRun on AllMCPs" /></a>