5 tools · 8 languages · MCP-native

Code execution for any MCP-compatible AI agent

Connect Claude Code, Codex, Cursor, VS Code, or Antigravity to isolated code execution. Use the hosted Streamable HTTP endpoint at https://mcp.sandboxapi.dev/mcp with your API key as a Bearer token. Each client has its own setup below.

5 focused tools for safe code execution

The current MCP surface mirrors the highest-signal agent workflow: execute code, batch snippets, discover runtimes, inspect capabilities, and install packages into sessions.

execute_codeOne-shot synchronous execution
execute_batchRun up to 20 snippets in a single call
list_languagesDiscover available runtimes & versions
session_install_packagespip / npm
get_capabilitiesRuntime feature discovery

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 longer tool calls 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.

30-second demo

An agent in Claude Code, Codex, or Cursor runs code and reports the results in its coding workflow.

Demo GIF coming soon — the visual assets team is producing it.
img/mcp-demo.gif (1280×720, ~10s loop)

What you can build

The MCP integration is the fastest way to ship one of these primitives in your AI agent product.

Code interpreter

Give your AI safe Python execution with file-backed state. The agent can pip install into an existing session and keep working with generated files.

execute_code, session_install_packages, get_capabilities

Autonomous debugger

Failing test? The agent runs the code, sees the traceback, edits the file, runs again. Tight loops via stateful sessions instead of restart-and-pray.

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?

Get an API key, follow your client's setup, and give your agent isolated code execution.

Get an API key Read MCP docs