# MCP

Flashbox runs an MCP server at `https://flashbox.app/mcp` (Streamable HTTP). Authenticate with your API key as a bearer token.

## Claude Code

```sh
claude mcp add --transport http flashbox https://flashbox.app/mcp --header "Authorization: Bearer $FLASHBOX_API_KEY"
```

## Other clients

Any client that speaks Streamable HTTP: URL `https://flashbox.app/mcp`, header `Authorization: Bearer fbx_...`. For clients that only run stdio servers, run the stdio server from the SDK download with `FLASHBOX_API_URL` and `FLASHBOX_API_KEY` set.

## Tools

| Tool | What it does |
| --- | --- |
| `sandbox_create` | Create a Flashbox sandbox: an isolated Linux machine (Alpine; node, npm, python3, git, curl, ripgrep, jq, GNU tools) for an agent's thin commands. Ready in tens of milliseconds. Write to /workspace (the default directory), /tmp or home; the rest is read-only. Public internet by default. Every command is billed and checkpointed; idle sandboxes cost nothing. |
| `run_command` | Run a shell command in the sandbox (sh -c, as the user, in /workspace). Good for curl, grep, sed, cat, small python or node scripts, git. Package installs, builds, compilers and test suites are refused (too CPU-heavy here) unless heavy is "try". Each run ends in a checkpoint you can roll back to. |
| `read_file` | Read a text file from the sandbox (relative paths are under /workspace). |
| `write_file` | Write a file in /workspace, /tmp or home (relative paths are under /workspace). Billed as one command; ends in a checkpoint. |
| `list_files` | List a directory in the sandbox (default /workspace). |
| `list_checkpoints` | The sandbox's checkpoints, newest first: one per command, file write or process start. |
| `rollback` | Put the sandbox back to one of its checkpoints (files, and running processes for a memory checkpoint). Later commands branch from there. |
| `fork` | New sandboxes starting from a checkpoint: try alternatives in parallel without touching the original. |
| `start_process` | Start a long-running background process (a server, a watcher). Its output is kept; checkpoints then include memory so it survives rollback and hibernation. |
| `process_logs` | Output of a background process so far (from an offset; wait up to wait_ms for more). |
| `sandbox_destroy` | Destroy a sandbox. Its checkpoints stay for a day (fork one to bring it back). |
