Architecture
SuperBox backend has three main components:Go API Server
RESTful API with Gin framework
Python CLI
Command-line tool for developers
Cloudflare Worker
Sandboxed MCP execution via Durable Objects
Go API Server
Technology:- Go 1.26
- Gin web framework
- Firebase Auth (Google/GitHub OAuth)
- Cloudflare R2 for storage via Python helper
/api/v1/servers- List, get, create, update, delete servers/api/v1/auth- Register, login, OAuth, device flow, profile
- Calls Python helper scripts for S3 operations
- Device authorization flow for CLI
- Multi-stage Docker build (Go binary + Python runtime)
- CORS enabled for web clients
Python CLI
Technology:- Python 3.11+
- Click framework
- boto3 for Cloudflare R2
- requests for HTTP calls
init- Create superbox.json configauth- Device flow OAuth loginpush- Security scan + upload to R2 registrypull- Configure AI clients (VSCode, Cursor, etc)run- Deprecated - prints a migration message and exits (usesuperbox pullinstead)search- Find servers in registryinspect- View server detailstest- Test servers in test mode (skip R2 registry lookup)logs- Printwrangler tailinstructions for viewing live Worker logs
- SonarCloud - Code quality and security
- Tool Discovery - Extract MCP tools from code
- Snyk - Dependency vulnerabilities
- GitGuardian - Secret detection
- Bandit - Python vulnerabilities
Cloudflare Worker Executor
Worker:superbox-executor
- URL:
https://superbox-executor.<your-subdomain>.workers.dev/mcp - Session runtime:
McpSessionDurable Object - Protocol: MCP Streamable HTTP (POST/DELETE)
- Auth: Firebase JWT
- AI client sends
POST /mcp?name=<server>with aMcp-Session-Idheader - Worker routes to (or creates) the
McpSessionDurable Object for that session - DO fetches
{server}.jsonmetadata from R2 - Embedded TypeScript interpreter executes the Python entrypoint
- JSON-RPC response streams back to the AI client
DELETE /mcp?name=<server>destroys the session
Data Flow
Storage Structure
R2 Bucket (flat files):superbox-mcp-registry
Each MCP server is a single JSON object stored at the bucket root:
<name>.json(e.g.,weather-server.json)
superbox.cli.commands.push):
namerepository{ "type": "git", "url": "<repo-url>" }descriptionentrypoint(defaults tomain.py)lang(defaults topython)tools{ "count": <int>, "names": ["..."] }security_report(SonarCloud, Bandit, GitGuardian results; may be null)meta.created_at,meta.updated_at(timestamps added on upsert)