# ScratchRun

> ScratchRun is an open-source MCP server. Ephemeral MicroVM-isolated code execution for AI agents. It runs locally on your machine and is started by your AI client.

- **Kind:** MCP server
- **Pricing:** Open source
- **Repository:** https://github.com/ar-blues/scratchrun-mcp
- **MCP Registry name:** dev.scratchrun/mcp
- **Listing updated:** 2026-08-04

## About

Ephemeral MicroVM-isolated code execution for AI agents. Fresh VM per call, hard-purged after.

## Install

### Claude Code (Terminal)

```sh
claude mcp add mcp --env SCRATCHRUN_API_KEY='<SCRATCHRUN_API_KEY>' -- npx -y @scratchrun/mcp-server
```

### Claude Desktop (claude_desktop_config.json)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@scratchrun/mcp-server"
      ],
      "env": {
        "SCRATCHRUN_API_KEY": "<SCRATCHRUN_API_KEY>"
      }
    }
  }
}
```

### Cursor (~/.cursor/mcp.json)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@scratchrun/mcp-server"
      ],
      "env": {
        "SCRATCHRUN_API_KEY": "<SCRATCHRUN_API_KEY>"
      }
    }
  }
}
```

### VS Code (.vscode/mcp.json)

```json
{
  "servers": {
    "mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "-y",
        "@scratchrun/mcp-server"
      ],
      "env": {
        "SCRATCHRUN_API_KEY": "<SCRATCHRUN_API_KEY>"
      }
    }
  }
}
```

### Windsurf (~/.codeium/windsurf/mcp_config.json)

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@scratchrun/mcp-server"
      ],
      "env": {
        "SCRATCHRUN_API_KEY": "<SCRATCHRUN_API_KEY>"
      }
    }
  }
}
```

### Other clients (your client's MCP settings (most use this shape))

```json
{
  "mcpServers": {
    "mcp": {
      "command": "npx",
      "args": [
        "-y",
        "@scratchrun/mcp-server"
      ],
      "env": {
        "SCRATCHRUN_API_KEY": "<SCRATCHRUN_API_KEY>"
      }
    }
  }
}
```

## FAQ

### Is ScratchRun free?

Yes. ScratchRun is open source, so you can use and self-host it for free.

### How do I add ScratchRun to Claude Code?

Run this command in your terminal: claude mcp add mcp --env SCRATCHRUN_API_KEY='<SCRATCHRUN_API_KEY>' -- npx -y @scratchrun/mcp-server

## Where this comes from

- Description: from the official MCP Registry entry.
- Install steps: from the official MCP Registry entry.

---
Source: https://ai-powered.com/mcp/scratchrun
