ScratchRun
Ephemeral MicroVM-isolated code execution for AI agents. Fresh VM per call, hard-purged after.
Installation
Ajoutez ceci à la configuration MCP de votre client (Claude Desktop : claude_desktop_config.json ; Cursor : .cursor/mcp.json ; VS Code et les autres utilisent la même forme « mcpServers »).
@scratchrun/mcp-serverclaude mcp add scratchrun -e 'SCRATCHRUN_API_KEY=<your scratchrun_api_key>' -- npx -y @scratchrun/mcp-server@0.1.1
{
"mcpServers": {
"scratchrun": {
"command": "npx",
"args": [
"-y",
"@scratchrun/mcp-server@0.1.1"
],
"env": {
"SCRATCHRUN_API_KEY": "<your scratchrun_api_key>"
}
}
}
}
Variables d'environnement
SCRATCHRUN_API_KEYobligatoire secret ScratchRun API key — get one at https://scratchrun.dev
Documentation
Tirée du README du projet sur GitHub, actualisée chaque semaine. Les liens ouvrent GitHub.
@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.
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)
TerminateMicroVMcalled 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;
/tmpis RAM-backed and gone with the VM
Latency
~400ms median (warm pool). 2–8s cold start if the pool is empty.
License
MIT
Questions fréquentes
Qu'est-ce que ScratchRun ?
Ephemeral MicroVM-isolated code execution for AI agents. Fresh VM per call, hard-purged after.
Comment installer ScratchRun ?
Il s'exécute sur votre machine. Dans Claude Code : claude mcp add scratchrun -e 'SCRATCHRUN_API_KEY=<your scratchrun_api_key>' -- npx -y @scratchrun/mcp-server@0.1.1. Pour les autres clients, collez la configuration JSON de cette page dans leurs réglages MCP.
Faut-il une clé API pour ScratchRun ?
Oui. Il attend SCRATCHRUN_API_KEY, à renseigner dans sa configuration.
ScratchRun est-il open source ?
Son code est public sur GitHub, mais le dépôt ne déclare pas de licence standard.
Qui maintient ScratchRun ?
Il est publié par ar-blues. AI.tn le référence sans le maintenir ni le recommander.
Issu du registre MCP officiel. Être listé n'est pas une recommandation : vérifiez le code et les permissions d'un serveur avant de lui donner accès à vos données.