Scratchrun MCP server
{
"mcpServers": {
"scratchrun": {
"command": "npx",
"args": [
"-y",
"@scratchrun/mcp-server@latest"
],
"env": {
"SCRATCHRUN_API_KEY": "<scratchrun_api_key>"
}
}
}
}{
"mcpServers": {
"scratchrun": {
"command": "npx",
"args": [
"-y",
"@scratchrun/mcp-server@latest"
],
"env": {
"SCRATCHRUN_API_KEY": "<scratchrun_api_key>"
}
}
}
}{
"mcpServers": {
"scratchrun": {
"command": "npx",
"args": [
"-y",
"@scratchrun/mcp-server@latest"
],
"env": {
"SCRATCHRUN_API_KEY": "<scratchrun_api_key>"
}
}
}
}{
"servers": {
"scratchrun": {
"command": "npx",
"args": [
"-y",
"@scratchrun/mcp-server@latest"
],
"env": {
"SCRATCHRUN_API_KEY": "${input:scratchrun_api_key}"
}
}
},
"inputs": [
{
"id": "scratchrun_api_key",
"type": "promptString",
"description": "Scratchrun api key",
"password": true
}
]
}{
"mcpServers": {
"scratchrun": {
"command": "npx",
"args": [
"-y",
"@scratchrun/mcp-server@latest"
],
"env": {
"SCRATCHRUN_API_KEY": "<scratchrun_api_key>"
}
}
}
}file .mcp.json (in your project root)file claude_desktop_config.jsonfile ~/.cursor/mcp.jsonfile .vscode/mcp.jsonfile ~/.codeium/windsurf/mcp_config.jsoninstall npx -y @scratchrun/mcp-serverversion 0.1.1
What it does
Executes code in ephemeral, hardware-isolated MicroVMs that are destroyed after each run. For AI agents that need to run untrusted code safely without state persistence or side effects.
- Run data analysis or plotting code and retrieve generated files like charts or images.
- Execute arbitrary code snippets in sandboxed environments without risk of persistence or state leakage between runs.
- Provide safe code execution for agents working with untrusted input or experimental scripts.
Tools this server exposes
| Tool | Does |
|---|---|
| scratchrun_exec | Execute code in an isolated MicroVM with specified runtime, capture stdout/stderr, and optionally return generated files as base64. |
Before you enable it
An MCP server runs with whatever access you give it. Start with a development account rather than production, and check which tools the server exposes before you let an agent call them unattended.