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: HOPX 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 |
|
| yes | Runtime to use |
| string | yes | Code to execute |
| integer | no | Timeout in ms (default 10000, max 30000) |
| integer | no | Memory limit in MB (default 256, max 512) |
| object | no | Environment variables — use for secrets, not code strings |
| object | no | Files to write before execution (path → content) |
| 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 reusedRFC 1918 + cloud metadata (
169.254.x.x) always blocked at the network layerRead-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
Maintenance
Tools
Related MCP Servers
- Alicense-qualityFmaintenanceEnables LLM agents to execute arbitrary Python code in secure, isolated sandbox environments with automatic dependency management and file handling. Each code execution runs in a fresh virtual environment that gets destroyed after completion, providing safe and reproducible Python code execution.Last updated29MIT

HOPX MCP Serverofficial
Flicense-qualityCmaintenanceEnables 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.Last updated155- Alicense-qualityAmaintenanceProvides 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.Last updated14MIT
- Alicense-qualityCmaintenanceProvides isolated sandbox environments for AI agents to execute code securely, generating signed receipts for every execution to ensure auditability and trust.Last updated124MIT
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.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
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