Skip to main content

sandstorm MCP server

An MCP server that exposes Sandstorm sandboxes as tools to any MCP-aware client — Claude Desktop, Claude Code, Cursor, Cline, etc.

What it lets the agent do

Once registered, the agent can:

Tool What
list_templates See the templates a sandbox can start from
list_snapshots See the tags a sandbox can fork from
spawn_sandboxes Start N sandboxes from a template, or fork them from a tag, and wait until they run
branch_sandbox Checkpoint a running sandbox into a new tag
touch_sandbox Bring an idle sandbox back to hot
list_sandboxes List sandboxes
get_sandbox Inspect one sandbox by id
exec_command Run a shell command in a sandbox
eval_code Run a code snippet and return what it printed
wait_for_text Poll a file in the guest for a marker string
ping_sandbox Health-check a sandbox
kill_sandbox Delete one sandbox
delete_snapshot Delete a tag

The killer one is branch_sandbox: checkpoint a running agent sandbox, then fan out N children that inherit the source's exact state.

Most tools map 1:1 onto a route of a master's REST API (docs/API.md). The server is stateless; the master owns sandbox lifecycle.

Install

pip install sandstorm-mcp
# or from source:
pip install -e .

Requires a Sandstorm master (README), reachable on https://127.0.0.1:8080 by default.

Configure

Environment variables:

Var Default Purpose
SANDSTORM_URL https://127.0.0.1:8080 Master base URL
SANDSTORM_TOKEN unset The master's API token, in pki/api-token under its state directory
SANDSTORM_CA unset PEM bundle to verify an https:// master, usually its pki/ca.pem
SANDSTORM_HTTP_TIMEOUT 60 Per-request timeout (seconds)

A master signs its certificate with a CA of its own, so the public trust store cannot verify it, and until SANDSTORM_CA is set every tool fails with CERTIFICATE_VERIFY_FAILED. Get the CA from the master's pki/ca.pem, or fetch it:

curl -k https://127.0.0.1:8080/ca.pem -o ca.pem

-k is for this one download. Check ca.pem against the fingerprint in a registration token before you trust it, and give SANDSTORM_CA an absolute path, since an MCP client decides the directory the server starts in. A path that cannot be read stops the server at startup. There is deliberately no way to turn verification off: an unverified control plane carries the API token and every command run inside a sandbox.

SANDSTORM_CA replaces the trust store rather than adding to it: the master's CA is the only issuer that can sign for it.

The certificate names 127.0.0.1, localhost and the master's --bind address. To connect by any other name, start the master with --tls-san master.example.

Sandbox credentials (v0.6)

Retain the token returned for each sandbox by spawn_sandboxes. GET/LIST responses do not return it. Pass that sandbox's token on every exec_command, eval_code, ping_sandbox, and wait_for_text call, for example:

sandbox = spawn_sandboxes(template="python", n=1)[0]
exec_command(sandbox["id"], ["echo", "hello"], sandbox_token=sandbox["token"])
eval_code(sandbox["id"], "print(2+2)", sandbox_token=sandbox["token"])
ping_sandbox(sandbox["id"], sandbox_token=sandbox["token"])
wait_for_text(sandbox["id"], "/tmp/output", "READY", sandbox_token=sandbox["token"])

sandbox_token is sent as x-sandstorm-sandbox-token, including every poll. It is separate from the API Bearer configured with SANDSTORM_TOKEN; v0.6 requires both. The tools do not cache sandbox tokens. Missing or incorrect tokens cause authentication failures.

Register with Claude Desktop

Add to your claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json):

{
  "mcpServers": {
    "sandstorm": {
      "command": "sandstorm-mcp",
      "env": {
        "SANDSTORM_URL": "https://127.0.0.1:8080",
        "SANDSTORM_CA": "/absolute/path/to/ca.pem",
        "SANDSTORM_TOKEN": "<contents-of-/var/lib/sandstorm/pki/api-token>"
      }
    }
  }
}

Restart Claude Desktop. The tools above will appear in the "hammer" menu.

Register with Claude Code

claude mcp add sandstorm --env SANDSTORM_URL=https://127.0.0.1:8080 \
                     --env SANDSTORM_CA=$PWD/ca.pem \
                     --env SANDSTORM_TOKEN=$(sudo cat /var/lib/sandstorm/pki/api-token) \
                     -- sandstorm-mcp

Verify with claude mcp list.

Register with Cursor

Add to ~/.cursor/mcp.json (or per-workspace .cursor/mcp.json):

{
  "mcpServers": {
    "sandstorm": {
      "command": "sandstorm-mcp",
      "env": {
        "SANDSTORM_URL": "https://127.0.0.1:8080",
        "SANDSTORM_CA": "/absolute/path/to/ca.pem",
        "SANDSTORM_TOKEN": "<contents-of-/var/lib/sandstorm/pki/api-token>"
      }
    }
  }
}

Restart Cursor (or hit "Refresh" on the MCP settings page).

Register with Cline

In the Cline extension settings, open "MCP Servers" → "Edit MCP Settings" and add:

{
  "mcpServers": {
    "sandstorm": {
      "command": "sandstorm-mcp",
      "env": {
        "SANDSTORM_URL": "https://127.0.0.1:8080",
        "SANDSTORM_CA": "/absolute/path/to/ca.pem",
        "SANDSTORM_TOKEN": "<contents-of-/var/lib/sandstorm/pki/api-token>"
      },
      "disabled": false,
      "autoApprove": ["list_templates", "list_snapshots", "list_sandboxes", "get_sandbox", "ping_sandbox"]
    }
  }
}

The autoApprove list is read-only tools that don't need per-call confirmation. Mutating tools (spawn_sandboxes, branch_sandbox, exec_command, kill_sandbox, delete_snapshot) always prompt by default.

Smoke test

# In one shell, start a master and a node:
sudo sandstormd serve --master --node

# In another, run the MCP server stand-alone (stdio transport):
curl -k https://127.0.0.1:8080/ca.pem -o ca.pem
SANDSTORM_CA=$PWD/ca.pem SANDSTORM_TOKEN=$(sudo cat /var/lib/sandstorm/pki/api-token) sandstorm-mcp
# The server will block on stdin waiting for an MCP client.

To exercise the server without an MCP client, point any MCP debugger at it (e.g. npx @modelcontextprotocol/inspector sandstorm-mcp).

What this is and isn't

Is — a thin wrapper that lets MCP clients drive Sandstorm. The agent plans, the MCP server forwards, the master actually places sandboxes.

Isn't — a sandbox itself. A master must be running, with at least one node and a registered template.

Metadata

Release files for sandstorm-mcp 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for sandstorm-mcp 0.3.0
File Size Uploaded Provenance Actions
sandstorm_mcp-0.3.0.tar.gz 16.0 kB With provenance Details for sandstorm_mcp-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for sandstorm-mcp 0.3.0
File Interpreter ABI Platform Actions
sandstorm_mcp-0.3.0-py3-none-any.whl Python 3 none any Details for sandstorm_mcp-0.3.0-py3-none-any.whl

Total release size: 25.2 kB

Release files / sandstorm_mcp-0.3.0.tar.gz

Download URL sandstorm_mcp-0.3.0.tar.gz
Size 16.0 kB
Tags Source
SHA-256 checksum
How to use checksums
abf012529e37e8b26cd64061d6078dae13b3d62a0daf1b09f971da8b0f633c70
BLAKE2b-256 checksum
How to use checksums
344099d7c41689465ebf1845bfce55ea9e1ab01e0abad26d5a317415ea9ceb23
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Release files / sandstorm_mcp-0.3.0-py3-none-any.whl

Download URL sandstorm_mcp-0.3.0-py3-none-any.whl
Size 9.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c651b39a2064eaa6f0dc71df3d5e7629d3ea86e2b80ce91e999dd0bdadaf465a
BLAKE2b-256 checksum
How to use checksums
9a4c31e6af45758391a92b9f2a590460f100cdbed99a5e7590f99522b52e81f7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

Security for sandstorm-mcp 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for sandstorm_mcp-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.3.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page