4 tools · 8 languages · RapidAPI-backed

Code execution for MCP-compatible AI agents

Connect Claude Code, Codex, Cursor, VS Code, or Antigravity to isolated code execution. The hosted Streamable HTTP endpoint at https://mcp.sandboxapi.dev/mcp uses your RapidAPI key as a Bearer token and forwards every tool invocation through RapidAPI, so your subscription, request quota, and tier limits remain authoritative.

4 focused tools for safe code execution

The V4 MCP surface is intentionally stateless: execute code, batch snippets, discover runtimes, and inspect capabilities. Sessions, package install, and managed HTTPS remain REST-only.

execute_codeOne-shot synchronous execution
execute_batch20 items on paid plans; 10 on BASIC
list_languagesDiscover available runtimes & versions
get_capabilitiesRuntime feature discovery

get_capabilities reports global_max_batch_size: 20. BASIC has a lower 10-item limit; PRO, ULTRA, and MEGA each accept 20.

Every MCP call shares one 2 MiB encoded JSON-RPC request envelope, so the separate 1 MiB code and stdin field ceilings cannot both be filled once escaping and protocol overhead are included. execute_code returns at most 256 KiB for each of stdout and stderr and sets truncated: true when clipped. Batch items retain 16 KiB per stream.

Connect a supported client

Use a SandboxAPI RapidAPI key as the Bearer token. Each client has its own configuration format. Keep the key in an environment variable, secret store, or personal configuration outside your repository.

Claude Code Coding agent

Add this to .mcp.json at your project root. Set SANDBOXAPI_RAPIDAPI_KEY in the environment that launches Claude Code, then approve the server when prompted.

{
  "mcpServers": {
    "sandboxapi": {
      "type": "http",
      "url": "https://mcp.sandboxapi.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${SANDBOXAPI_RAPIDAPI_KEY}"
      }
    }
  }
}
.mcp.json · check the connection with /mcp

Claude Code MCP documentation →

Codex Coding agent

Add this to ~/.codex/config.toml. Set SANDBOXAPI_RAPIDAPI_KEY in the environment available to your Codex client. The timeout allows for the hosted adapter's 150-second execution ceiling and response delivery.

[mcp_servers.sandboxapi]
url = "https://mcp.sandboxapi.dev/mcp"
bearer_token_env_var = "SANDBOXAPI_RAPIDAPI_KEY"
tool_timeout_sec = 180
~/.codex/config.toml · shared Codex client configuration

Codex MCP documentation →

Cursor IDE agent

Add this to ~/.cursor/mcp.json. Set SANDBOXAPI_RAPIDAPI_KEY in the environment available to Cursor, then restart the client.

{
  "mcpServers": {
    "sandboxapi": {
      "url": "https://mcp.sandboxapi.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${env:SANDBOXAPI_RAPIDAPI_KEY}"
      }
    }
  }
}
~/.cursor/mcp.json · personal configuration

Cursor MCP documentation →

VS Code Copilot

Add this to .vscode/mcp.json. VS Code prompts for the secret and stores it securely.

{
  "inputs": [{
    "type": "promptString",
    "id": "sandboxapi-key",
    "description": "SandboxAPI RapidAPI key",
    "password": true
  }],
  "servers": {
    "sandboxapi": {
      "type": "http",
      "url": "https://mcp.sandboxapi.dev/mcp",
      "headers": {
        "Authorization": "Bearer ${input:sandboxapi-key}"
      }
    }
  }
}
.vscode/mcp.json or your VS Code user profile

Antigravity Google

Open MCP Servers → Manage MCP Servers → View raw config. Add the remote server using serverUrl and replace the placeholder with your RapidAPI key in personal configuration.

{
  "mcpServers": {
    "sandboxapi": {
      "serverUrl": "https://mcp.sandboxapi.dev/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_RAPIDAPI_KEY"
      }
    }
  }
}
Use personal mcp_config.json; keep the key out of shared workspace configuration

Antigravity MCP documentation →

Claude Desktop Limited beta

Use Customize → Connectors → Add custom connector. If your account has the Request headers beta, select No sign-in and add the Bearer header below. Anthropic currently limits this feature to selected organizations.

URL: https://mcp.sandboxapi.dev/mcp
Authentication: No sign-in
Request header: Authorization
Value: Bearer <your RapidAPI key>

If Request headers is unavailable, use one of the coding clients above. SandboxAPI OAuth onboarding is planned.

Remote connectors use the connector UI; the Desktop JSON config is for local MCP servers

Claude connector documentation →

Other MCP clients can connect when they support Streamable HTTP and a custom Authorization: Bearer header. Never put a RapidAPI key in the endpoint URL.

One tool call, one RapidAPI request

The adapter does not execute code beside the billing path. It translates one MCP tool invocation into one SandboxAPI endpoint call through the RapidAPI gateway.

MCP client → RapidAPI gateway → SandboxAPI V4 → gVisor sandbox
No network access unless you use the separate paid REST opt-in

What you can build

Use the compact stateless MCP surface for execution primitives; use the REST API when you need sessions, package workflows, streaming, async, or managed HTTPS.

Code interpreter

Give an MCP-compatible agent isolated one-shot Python execution with structured output and no execution-network access.

execute_code, get_capabilities

Autonomous debugger

Failing test? The agent runs a self-contained snippet, reads the traceback, revises the input, and runs again in a fresh sandbox.

execute_code, execute_batch, get_capabilities

REPL agent

Build a lightweight code execution tool on your own stack and model. 8 languages, gVisor isolation, and a small MCP surface agents can reason about.

execute_code, execute_batch, list_languages

Ready to give your AI a code interpreter?

Subscribe on RapidAPI and configure your client with the key. Every tool call is forwarded through RapidAPI under your plan's REST limits, with hosted-MCP ceilings on top: at most 20 batch items, 150-second runs, and 256 KiB output per stream.

Get an API key Read MCP docs