Skip to content

A self-hosted, secure code execution sandbox for LLM agents deployed on your cloud infrastructure using SkyPilot. Built on llm-sandbox for multi-language code execution.

Notifications You must be signed in to change notification settings

alex000kim/skypilot-code-sandbox

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SkyPilot Code Sandbox

A self-hosted, secure code execution sandbox for LLM agents deployed on your cloud infrastructure using SkyPilot. Built on llm-sandbox for multi-language code execution.

Key Features

  • Team Collaboration: Mount S3 buckets in read-only mode for shared data access across team members
  • Secure & Scalable: Token-based auth, Docker sandboxing, auto-scaling
  • Multi-language: Python, JavaScript, Java, C++, etc with dynamic package installation
  • Universal MCP Integration: Works with Claude Desktop, VS Code, and other MCP clients
  • Cloud Native: Deploy on any cloud (AWS, GCP, Azure, etc.) with built-in load balancing and cost optimization

Requirements

  • SkyPilot for deployment
  • Valid cloud credentials
  • Docker for local development

Quick Start

1. Deploy the Service

export AUTH_TOKEN=<YOUR_AUTH_TOKEN>
sky serve up -n code-executor src/code-execution-service.sky.yaml --env AUTH_TOKEN --secret AUTH_TOKEN

2. Get the API Endpoint

sky serve status code-executor-service --endpoint

3. Configure Your MCP Client

Using Claude Desktop as an example:

  • macOS: ~/Library/Application\ Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
{
  "mcpServers": {
    "code-execution-server": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/alex000kim/skypilot-code-sandbox.git",
        "mcp-server"
      ],
      "env": {
        "API_BASE_URL": "<YOUR_ENDPOINT>",
        "AUTH_TOKEN": "<YOUR_AUTH_TOKEN>"
      }
    }
  }
}
claude_desktop_demo.mp4

VS Code: Add the same configuration to .vscode/mcp.json (rename mcpServers to servers).

vscode_demo.mp4

Team Deployment Benefits

The S3 read-only mount feature enables seamless team collaboration:

  • Shared datasets: All team members access the same data without duplication
  • Security: Read-only access prevents accidental data modification
  • Cost efficient: Single data storage, multiple execution environments

Great for collaborative research projects.

Local Development

pip install -e .
python -m uvicorn src.api:app --host 0.0.0.0 --workers 4 --port 8080

Update MCP config to use "API_BASE_URL": "http://localhost:8080" for local testing.

About

A self-hosted, secure code execution sandbox for LLM agents deployed on your cloud infrastructure using SkyPilot. Built on llm-sandbox for multi-language code execution.

Topics

Resources

Stars

Watchers

Forks

Languages