Hadronbox
Official# @hadronbox/mcp
MCP server (stdio) that lets an AI agent use [hadronbox.tr](https://hadronbox.tr) machines as its sandbox: create a
machine, run commands, read and write files, pause or resume it, start from a snapshot and open a preview URL.
```bash
HADRONBOX_API_KEY=... npx -y @hadronbox/mcp
```
Node.js 20 or later. One bundled file, no runtime dependencies. Docs: https://hadronbox.tr/docs/mcp
## Tools
| Tool | What it does | API key scope |
| ---------------------- | ------------------------------------------------------------------------ | ---------------------------------- |
| `create_machine` | Create a machine and wait until it runs (template, size, tools) | `machines:create`, `machines:read` |
| `list_machines` | Machines with id, name, status and the quota | `machines:read` |
| `exec` | Run a command; exit code, stdout, stderr; timeout; long output shortened | `machines:exec` |
| `read_file` | Read a text file under `/workspace` | `machines:exec` |
| `write_file` | Create or replace a text file under `/workspace` | `machines:exec` |
| `pause_machine` | Pause a machine | `machines:manage` |
| `resume_machine` | Resume a paused machine | `machines:manage` |
| `list_snapshots` | Saved snapshots | `snapshots:read` |
| `create_from_snapshot` | New machine from a ready snapshot | `machines:create`, `machines:read` |
| `expose_port` | Private https preview URL for a port | `machines:manage` |
| `delete_machine` | Delete a machine (listed only with `--allow-delete`) | `machines:delete` |
Use a **scoped API key** (panel: API keys page). `machines:read` + `machines:exec` is enough to work on existing
machines; add `machines:create` to let the agent create machines. Errors come back as tool results the model can act
on: a missing scope names the scope, `COMMAND_BLOCKED` explains the blocked part, `CREDIT_INSUFFICIENT` (402) shows the
balance.
## Configuration
| Variable | Meaning |
| ---------------------------- | ------------------------------------------------------------ |
| `HADRONBOX_API_KEY` | API key (required) |
| `HADRONBOX_BASE_URL` | API base URL (default `https://api.hadronbox.tr/v1`) |
| `HADRONBOX_MCP_ALLOW_DELETE` | `1` = also offer `delete_machine` (same as `--allow-delete`) |
Claude Code:
```bash
claude mcp add hadronbox --env HADRONBOX_API_KEY=$HADRONBOX_API_KEY -- npx -y @hadronbox/mcp
```
Claude Desktop / Cursor (`claude_desktop_config.json`, `.cursor/mcp.json`):
```json
{
"mcpServers": {
"hadronbox": {
"command": "npx",
"args": ["-y", "@hadronbox/mcp"],
"env": { "HADRONBOX_API_KEY": "<HADRONBOX_API_KEY>" }
}
}
}
```
Replace `<HADRONBOX_API_KEY>` with your own API key, and do not commit a file that contains it.
## Development (in the ai-sandbox-platform repository)
```bash
npx vitest run sdks/mcp # tests (fake API server, no network)
npm run build --prefix sdks/mcp # dist/hadronbox-mcp.js (bundles sdks/typescript)
```
License: Apache-2.0
TDQS
Scored across 10 tools
Each tool targets a distinct resource and action: machine lifecycle (create, pause, resume, list), snapshot listing/instantiation, port exposure, and file/shell operations. The only mild overlap is create_machine versus create_from_snapshot, but the descriptions make the distinction clear (blank VM vs. from a ready snapshot).
Nine of ten tools follow a clean verb_noun snake_case pattern (list_snapshots, create_from_snapshot, pause_machine, read_file, write_file, etc.). The lone bare verb 'exec' is a minor deviation but remains unambiguous.
Ten tools is a well-scoped set for a sandbox VM service, with each tool earning its place across lifecycle, file I/O, command execution, and preview exposure. Nothing feels padded or missing at the count level.
Core workflows are covered, but the lifecycle is a dead end: there is no delete/stop machine tool and no create_snapshot tool, so the snapshot surface is read-only and machines can only be paused, never destroyed. File deletion is also only possible indirectly via exec.