MCP Server (135 Tools)
Connect Antigravity, Claude Code, Claude Desktop, Cursor, and Windsurf to the Hosted Streamable HTTP or local stdio MCP server.
StateSet Sandbox MCP Server (130 Tools)
@stateset/sandbox-mcp (v0.7.0 live on Hosted HTTP) exposes 130 Model Context Protocol tools over both a Live Hosted Streamable HTTP endpoint (https://mcp.sandbox.stateset.app/mcp) and a local stdio transport (npx -y @stateset/sandbox-mcp). Give Antigravity (agy), Claude Code, Claude Desktop, Cursor, Windsurf, and any MCP-compatible client isolated Linux sandboxes, stateful Python Jupyter kernels, persistent libghostty-vt terminals, Managed Cloud Swarms with Swarm Blackboard & Repo Memory, CoW repo-cache hot-forks, Model-Weight CSI caches, ephemeral Postgres/Redis/Playwright sidecars, and Spot GPU batch .map() jobs.
1. Hosted Streamable HTTP Endpoint (Zero Local Install)
Connect directly to StateSet's managed multi-tenant Streamable HTTP MCP server:
- MCP endpoint:
https://mcp.sandbox.stateset.app/mcp - RFC 9728 OAuth 2.0 Protected Resource Metadata:
https://mcp.sandbox.stateset.app/.well-known/oauth-protected-resource - Liveness probe:
https://mcp.sandbox.stateset.app/healthz
Authentication & Session Isolation (Per-Tenant API Key & RFC 9728 OAuth 2.0)
The hosted Streamable HTTP server enforces production authentication and tenant-isolation controls on every request:
- **Per-tenant API key auth (
STATESET_MCP_API_KEY_AUTH_ENABLED=true):** ValidatesAuthorization: ApiKey <key>(or non-JWTAuthorization: Bearer <key>) directly against the Sandbox Controller (GET /api/v1/settings), caches verified SHA-256 fingerprints with a short bounded TTL (30s), binds every session to(orgId, apikey:<sha256_prefix>), and executes downstream tool calls strictly under the caller's own key, scopes, quotas, and audit log. - **RFC 9728 OAuth 2.0 discovery:** Advertises authorization servers, supported scopes (
mcp:tools), and protected resource metadata at/.well-known/oauth-protected-resourceand/.well-known/oauth-protected-resource/mcp. - **RFC 8707 audience binding:** Verifies exact
iss,aud(https://mcp.sandbox.stateset.app/mcp),sub,org_id,exp, and optional revocation (jti) on every POST, GET, and DELETE call. - **Authorized token exchange:** Mints downstream Sandbox API credentials rather than blindly forwarding MCP-audience JWTs to a different API audience.
- **Per-session isolation:** Binds every
Mcp-Session-Idstrictly to(orgId, subject)with automatic idle and token-expiry session reaping so neither cross-org nor same-org cross-key session reuse is possible.
2. Client Setup (Antigravity, Claude Code, Claude Desktop, Cursor & Windsurf)
Generate or write ready-to-use client config in one command with the StateSet CLI:
stateset mcp connect claude-code # Hosted Streamable HTTP command
stateset mcp connect agy # Antigravity CLI Hosted HTTP command
stateset mcp connect cursor --write # Safely merges into ./.cursor/mcp.json
stateset mcp connect windsurf --write # Safely merges into Windsurf mcp_config.json
stateset mcp connect claude-desktop # Local stdio config for Claude Desktop- **Hosted Streamable HTTP (
https://mcp.sandbox.stateset.app/mcp)**: Authenticates via per-tenant API key (Authorization: ApiKey $STATESET_API_KEYor non-JWTAuthorization: Bearer $STATESET_API_KEY) or RFC 9728 OAuth 2.0 auto-discovery. - **Local stdio (
npx -y @stateset/sandbox-mcp)**: Authenticates directly with your workspace API key (STATESET_API_KEY) created under API Keys — no OAuth flow required.
Antigravity (agy)
# Hosted Streamable HTTP with your workspace API key (zero local install)
agy mcp add --transport http stateset-sandbox https://mcp.sandbox.stateset.app/mcp \
--header "Authorization: ApiKey $STATESET_API_KEY"
# Hosted Streamable HTTP via RFC 9728 OAuth
agy mcp add --transport http stateset-sandbox https://mcp.sandbox.stateset.app/mcp
# Local stdio using your workspace API key (all 135 tools enabled)
agy mcp add stateset-sandbox \
-e STATESET_API_KEY=YOUR_STATESET_API_KEY \
-e STATESET_MCP_TOOL_PROFILE=all \
-- npx -y @stateset/sandbox-mcpClaude Code
# Hosted Streamable HTTP with your workspace API key (zero local install)
claude mcp add --transport http stateset-sandbox https://mcp.sandbox.stateset.app/mcp \
--header "Authorization: ApiKey $STATESET_API_KEY"
# Hosted Streamable HTTP via RFC 9728 OAuth
claude mcp add --transport http stateset-sandbox https://mcp.sandbox.stateset.app/mcp
# Local stdio using your workspace API key
claude mcp add stateset-sandbox \
-e STATESET_API_KEY=YOUR_STATESET_API_KEY \
-e STATESET_MCP_TOOL_PROFILE=all \
-- npx -y @stateset/sandbox-mcpClaude Desktop (claude_desktop_config.json)
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"stateset-sandbox": {
"command": "npx",
"args": ["-y", "@stateset/sandbox-mcp"],
"env": {
"STATESET_API_KEY": "YOUR_STATESET_API_KEY",
"STATESET_MCP_TOOL_PROFILE": "all"
}
}
}
}Cursor (~/.cursor/mcp.json or .cursor/mcp.json)
Use the **1-Click Add to Cursor** button in Getting Started or add Hosted Streamable HTTP manually (RFC 9728 OAuth auto-discovery):
{
"mcpServers": {
"stateset-sandbox": {
"url": "https://mcp.sandbox.stateset.app/mcp"
}
}
}Local stdio (direct workspace API key):
{
"mcpServers": {
"stateset-sandbox": {
"command": "npx",
"args": ["-y", "@stateset/sandbox-mcp"],
"env": {
"STATESET_API_KEY": "YOUR_STATESET_API_KEY",
"STATESET_MCP_TOOL_PROFILE": "all"
}
}
}
}Windsurf (~/.codeium/windsurf/mcp_config.json)
Hosted Streamable HTTP (with OAuth Bearer JWT):
{
"mcpServers": {
"stateset-sandbox": {
"serverUrl": "https://mcp.sandbox.stateset.app/mcp",
"headers": {
"Authorization": "Bearer YOUR_OAUTH_ACCESS_TOKEN"
}
}
}
}Local stdio (direct workspace API key):
{
"mcpServers": {
"stateset-sandbox": {
"command": "npx",
"args": ["-y", "@stateset/sandbox-mcp"],
"env": {
"STATESET_API_KEY": "YOUR_STATESET_API_KEY",
"STATESET_MCP_TOOL_PROFILE": "all"
}
}
}
}Quick verification prompt: Ask your agent to "Create a sandbox, runpython3 -c 'print(6*7)'in it, then stop it." It callssandbox_create,sandbox_exec, andsandbox_stop, and reports42.
3. Tool Profiles (core vs all) & 130-Tool Catalog
Set STATESET_MCP_TOOL_PROFILE=core for a compact 17-tool context window, or STATESET_MCP_TOOL_PROFILE=all (default on the Hosted MCP endpoint) to unlock all 135 tools across 8 capability groups:
| Capability Group | Tool Count | Representative Tools |
|---|---|---|
| Core Sandbox, Files, Exec, Stateful REPL, Processes, Checkpoints, Snapshots, Desktop & Agent Tasks/Chat | 57 | sandbox_create, sandbox_exec, code_run, sandbox_pause, sandbox_resume, sandbox_snapshot, sandbox_fork, file_read, file_write, file_glob, process_start, process_logs, checkpoint_create, checkpoint_restore, sandbox_expose_port, sandbox_screenshot, desktop_mouse, desktop_keyboard, agent_task_launch, agent_chat_send, agent_team_launch |
10-Pillar Next-Gen Platform, Repo Memory, Swarm Blackboard, Model-Weight Caches & Spot GPU Batch .map() | 27 | repo_cache_list, repo_cache_warm_and_fork, model_cache_list, model_cache_warm, sandbox_services_provision, sandbox_db_branch, swarm_visual_preview, swarm_trigger_create, swarm_replay_timeline, swarm_worker_takeover, swarm_worker_handback, swarm_routing_recommend, swarm_routing_feedback, swarm_policy_evaluate, swarm_provenance_get, byoc_runner_list, swarm_marketplace_browse, swarm_marketplace_install, gpu_catalog_list, batch_map_run, batch_map_status, repo_memory_read, repo_memory_save, repo_memory_delete, swarm_blackboard_post, swarm_blackboard_read, swarm_claim_paths |
Managed Cloud Swarms & Gemini 4 Neon (agy) | 21 | swarm_presets, swarm_plan_dag, agent_run_agy, swarm_fanout_agy, swarm_status_agy, swarm_stop_agy, swarm_create_managed, swarm_list_managed, swarm_get_managed, swarm_cancel_managed, swarm_approve_wave, swarm_steer_managed, swarm_create_pr, swarm_schedule_create, swarm_schedule_list, swarm_get_report, swarm_worker_logs, swarm_replay, swarm_template_create, swarm_template_list, swarm_analytics |
| Server-Backed Task Registry & Family Grants | 8 | task_registry_list, task_registry_get, task_registry_observe, task_registry_logs, task_registry_register, task_registry_grants, task_registry_grant, task_registry_revoke |
Persistent libghostty-vt Terminal Sessions | 7 | terminal_create, terminal_list, terminal_write, terminal_screen, terminal_search, terminal_resize, terminal_close |
| Swarm DAG Plans | 4 | swarm_list, swarm_get, swarm_create, swarm_cancel |
| Prepaid Credits & Billing | 3 | credits_balance, credits_buy, credits_purchase_link |
| Verified Multi-File Input Batches | 3 | file_plan_input_batch, file_upload_input_batch, file_inspect_input_batch |
RL Workloads (stateset-agents RLVR, GRPO, DAPO, Batch .map() & GPU Costing) | 5 | rl_list_presets, rl_estimate_cost, rl_verify_solution, rl_score_group, rl_verify_batch |
Enabling STATESET_MCP_COMMERCE_ENABLED=true registers an additional 5 Commerce Workflows tools.
Core 17-Tool Profile (STATESET_MCP_TOOL_PROFILE=core)
sandbox_create, sandbox_list, sandbox_get, sandbox_stop, sandbox_exec, code_run, execution_list, execution_get, file_read, file_write, file_list, process_start, process_list, process_get, process_logs, process_kill, sandbox_expose_port.
4. Environment Variables (Stdio & Self-Hosted HTTP)
Requires Node.js 20.19+ (20.x) or 22.12+.
Local Stdio (stateset-sandbox-mcp)
| Variable | Default | Notes |
|---|---|---|
STATESET_API_KEY | required | API key (or JWT) for the StateSet Sandbox API. |
STATESET_BASE_URL | https://api.sandbox.stateset.app | Override for self-hosted or regional controllers. |
STATESET_MCP_TOOL_PROFILE | core | Set to all to expose all 135 tools. |
STATESET_ORG_ID | unset | Sent as x-org-id for multi-org JWT auth. |
STATESET_MCP_STOP_ON_EXIT | false | When true, stops sandboxes created by this session on SIGINT/SIGTERM or stdin close (bounded to 10s). |
STATESET_MCP_MAX_OUTPUT_CHARS | 20000 | Per-stream limit for command output and file_read. |
STATESET_DASHBOARD_URL | https://sandbox.stateset.app | HTTPS dashboard origin used by credits_purchase_link. |
Self-Hosted Streamable HTTP (stateset-sandbox-mcp-http)
Run your own OAuth-protected Streamable HTTP MCP gateway against a self-hosted controller:
export STATESET_MCP_RESOURCE_URL="https://mcp.internal.example.com/mcp"
export STATESET_MCP_ISSUER="https://auth.internal.example.com"
export STATESET_MCP_JWKS_URL="https://auth.internal.example.com/.well-known/jwks.json"
export STATESET_API_KEY="YOUR_DOWNSTREAM_SANDBOX_API_KEY"
export STATESET_MCP_TOOL_PROFILE="all"
npx -y -p @stateset/sandbox-mcp stateset-sandbox-mcp-httpKey HTTP server variables: STATESET_MCP_HTTP_HOST (default 127.0.0.1), STATESET_MCP_HTTP_PORT (default 3100), STATESET_MCP_RESOURCE_URL (required), STATESET_MCP_ISSUER (required), STATESET_MCP_AUTH_SERVERS, STATESET_MCP_API_KEY_AUTH_ENABLED (true/false, controller-verified per-tenant API keys), STATESET_MCP_API_KEY_CACHE_TTL_MS (0–300000, default 30000), STATESET_MCP_JWKS_URL (RS256/ES256 JWKS verification) or STATESET_MCP_JWT_SECRET (HS256, min 32 chars), and STATESET_MCP_MAX_SESSIONS (default 256).
5. Error Handling & Safe Recovery
Validation and API errors return structured MCP tool results (isError: true) with actionable next steps so the model can self-correct:
- 401 Unauthorized: Verify
STATESET_API_KEY(stdio) or Bearer OAuth token audience/expiry (HTTP) matchesSTATESET_BASE_URL. - 402 Payment Required (
PAYMENT_METHOD_REQUIREDorINSUFFICIENT_CREDITS): Checkcredits_balance, add credits viacredits_buy(requires owner key withbilling:purchasescope), or share the owner-onlycredits_purchase_link. - 429 Rate / Concurrency Limit: Wait for
Retry-Afteror stop unused sandboxes withsandbox_stop. - 404 / 409 Lifecycle Conflict: Sandbox expired or is still booting; inspect via
sandbox_listorsandbox_get. - Uncertain Execution Outcome: Inspect
execution_getorexecution_listbefore resubmitting any command with side effects.
Related Resources
- RL Workloads (RLVR, GRPO, DAPO & Flywheel) — End-to-end
stateset-agentsRL workloads across Python, SDK, CLI, MCP, and Dashboard - Next-Gen Platform Pillars (v2.18.0) — Deep dive into all 10 pillars exposed by the MCP server
- Migrating from E2B, Daytona & Modal — 5 drop-in adapters and
stateset migrate - Quickstart — First sandbox run in minutes
- Interactive Playground — Explore workflows without signing up
Ready to run this in a hardened gVisor sandbox?
Test live in the Playground with zero signup, or create a free workspace with $25 in trial credits.