Skip to main content
Glama
ar-blues

ScratchRun MCP Server

@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:

{
  "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.

Related MCP server: Code Executor MCP Server

Tool: scratchrun_exec

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

Parameters:

Parameter

Type

Required

Description

runtime

python3.12 | python3.11 | node20 | bash

yes

Runtime to use

code

string

yes

Code to execute

timeout_ms

integer

no

Timeout in ms (default 10000, max 30000)

memory_mb

integer

no

Memory limit in MB (default 256, max 512)

env

object

no

Environment variables — use for secrets, not code strings

files

object

no

Files to write before execution (path → content)

return_files

string[]

no

File paths to capture after execution (returned as base64)

Example — run Python and return a chart:

{
  "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

Install Server
A
license - permissive license
A
quality
C
maintenance

Maintenance

Maintainers
Response time
Release cycle
Releases (12mo)
Commit activity

Related MCP Servers

  • F
    license
    Not graded
    quality
    C
    maintenance
    Enables AI assistants to execute Python, JavaScript, Bash, and Go code in blazing-fast (~0.1ms startup), isolated cloud containers with secure, ephemeral environments that auto-destroy after use.
    155
  • A
    license
    Not graded
    quality
    A
    maintenance
    Provides sandboxed code execution for AI agents with support for Python, JavaScript, and shell commands. Includes comprehensive safety features like destructive pattern blocking, timeout protection, and restricted file access for secure production use.
    69
    MIT

View all related MCP servers

Related MCP Connectors

  • Execute code in 8 languages (Python, JS, TS, Go, Java, C++, C, Bash) in gVisor sandboxes.

  • Pay-per-call cybersecurity for AI agents: vuln scans, threat intel, compliance, code security.

  • Pay-per-call agent superpowers: media/video gen, product demos, research, GTM, scraping, compute.

View all MCP Connectors

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/ar-blues/scratchrun-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server