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.
The current MCP surface mirrors the highest-signal agent workflow: execute code, batch snippets, discover runtimes, inspect capabilities, and install packages into sessions.
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.
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
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
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
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
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
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 serversOther MCP clients can connect when they support Streamable HTTP and a custom Authorization: Bearer header. Never put a RapidAPI key in the endpoint URL.
An agent in Claude Code, Codex, or Cursor runs code and reports the results in its coding workflow.
The MCP integration is the fastest way to ship one of these primitives in your AI agent product.
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.
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.
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.
Get an API key, follow your client's setup, and give your agent isolated code execution.