{
  "markdown": "# @scratchrun/mcp-server\n\nMCP server for [ScratchRun](https://scratchrun.dev) — ephemeral, MicroVM-isolated code execution for AI agents.\n\nEach call runs in a fresh hardware-isolated MicroVM. The VM is hard-purged after execution. No state, no files, nothing persists between calls.\n\n## Install\n\nAdd to your `claude_desktop_config.json`:\n\n```json\n{\n  \"mcpServers\": {\n    \"scratchrun\": {\n      \"command\": \"npx\",\n      \"args\": [\"-y\", \"@scratchrun/mcp-server\"],\n      \"env\": {\n        \"SCRATCHRUN_API_KEY\": \"sr_live_your_key_here\"\n      }\n    }\n  }\n}\n```\n\nGet an API key at [scratchrun.dev](https://scratchrun.dev).\n\n## Tool: `scratchrun_exec`\n\nExecutes code in an ephemeral sandbox and returns stdout, stderr, exit code, and any output files.\n\n**Parameters:**\n\n| Parameter | Type | Required | Description |\n|-----------|------|----------|-------------|\n| `runtime` | `python3.12` \\| `python3.11` \\| `node20` \\| `bash` | yes | Runtime to use |\n| `code` | string | yes | Code to execute |\n| `timeout_ms` | integer | no | Timeout in ms (default 10000, max 30000) |\n| `memory_mb` | integer | no | Memory limit in MB (default 256, max 512) |\n| `env` | object | no | Environment variables — use for secrets, not code strings |\n| `files` | object | no | Files to write before execution (path → content) |\n| `return_files` | string[] | no | File paths to capture after execution (returned as base64) |\n\n**Example — run Python and return a chart:**\n\n```json\n{\n  \"runtime\": \"python3.12\",\n  \"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')\",\n  \"return_files\": [\"/tmp/plot.png\"]\n}\n```\n\nOutput files are returned as base64. Image files (PNG, JPG, SVG) are returned as MCP image content blocks and render inline in Claude.\n\n## Isolation\n\n- Hardware-virtualized MicroVM per execution (own kernel, not a shared-kernel container)\n- `TerminateMicroVM` called unconditionally after every run — VM destroyed, never reused\n- RFC 1918 + cloud metadata (`169.254.x.x`) always blocked at the network layer\n- Read-only system filesystem via OverlayFS; `/tmp` is RAM-backed and gone with the VM\n\n## Latency\n\n~400ms median (warm pool). 2–8s cold start if the pool is empty.\n\n## License\n\nMIT\n",
  "bytes": 2257,
  "sha": "0b7e6f996e698bb82d5de8a4c34b82305f73a3dea0d77e2376a11ac06321bd22",
  "repo_slug": "ar-blues/scratchrun-mcp",
  "fonte": "repo",
  "truncated": false,
  "api": "https://agentalog.com/api/listings/mcp_dev_scratchrun_mcp_3231a694/readme"
}