One MCP session equals one Podflare sandbox. The sandbox is created lazily on the first tool call and destroyed when the server receives
SIGTERM or SIGINT. If the client reconnects, a fresh sandbox starts — prior state is lost, which matches MCP’s own session model.Installation
Build the MCP server from the Podflare repository. Node 20 or later is required.Build the server
Clone the repository (or navigate to an existing checkout), then build the MCP package.The compiled entry point lands at
mcp/dist/index.js. Note its absolute path — you will need it in every client configuration block.Client configuration
Add apodflare entry to your MCP client’s mcpServers configuration. The shape is identical across all clients — only the config file location differs.
- Claude Desktop
- Cursor
- Cline
- Zed
Add the block below to After restarting, Claude lists Podflare’s tools alongside its built-in capabilities in every conversation.
~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or the equivalent path on your OS. Restart Claude Desktop after saving.Environment variables
The base URL of the Podflare API. Set this in the
env block of every client configuration so the MCP server can reach the API. Use https://api.podflare.dev for the hosted service.Your Podflare API key, forwarded on every request. Required for the hosted API at
https://api.podflare.dev. See Authentication for how to obtain and use your key.Available tools
Every MCP session exposes the following tools. The AI client can call them autonomously or in response to user prompts.Execute a Python snippet inside the sandbox. State persists across calls — variables, imports, and open file handles are all retained between invocations (REPL semantics). Returns
{stdout, stderr, exit_code}.Execute a bash snippet. Each call spawns a fresh subprocess, so environment variables set in one call do not persist to the next.
Snapshot the current sandbox and spawn
n children from that moment’s state. Returns a list of child sandbox IDs. Each child inherits the parent’s Python REPL state, filesystem, and running processes.Compare the filesystems of two sandboxes. Returns the set of added, removed, and modified paths. Useful for inspecting what a fork changed relative to a sibling.
Commit a winner fork as the new state of the parent sandbox. After this call the parent’s ID drives the winner’s VM; the winner’s ID becomes defunct.
Write base64-encoded bytes to a path inside the sandbox filesystem.
Read a file from the sandbox filesystem and return its contents as base64.
Session model
Each time an MCP client opens a connection to the Podflare MCP server, a single sandbox is created for that session. All tool calls within the session share that sandbox — state accumulates across calls just like a terminal session. When the connection closes (or the server receivesSIGTERM/SIGINT), the sandbox is destroyed. If the client reconnects, a new sandbox starts from scratch. This behaviour is intentional: it keeps the session model predictable and consistent with how MCP itself defines session boundaries.