Architecture
SuperBox backend has three main components:Go API Server
RESTful API with Gin framework
Python CLI
Command-line tool for developers
AWS Lambda
Sandboxed MCP execution
Go API Server
Technology:- Go 1.21+
- Gin web framework
- Firebase Auth (Google/GitHub OAuth)
- S3 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 AWS S3
- requests for HTTP calls
init- Create superbox.json configauth- Device flow OAuth loginpush- Security scan + upload to S3pull- Configure AI clients (VSCode, Cursor, etc)run- Interactive test sessionsearch- Find servers in registryinspect- View server detailstest- Test servers locallylogs- View CloudWatch logs
- SonarCloud - Code quality and security
- Bandit - Python vulnerabilities
- GitGuardian - Secret detection
- Tool Discovery - Extract MCP tools from code
AWS Lambda Executor
Function:lambda.lambda_handler
- Runtime: Python 3.11
- Memory: 512 MB (configurable)
- Timeout: 60 seconds
- Trigger: Lambda Function URL (HTTPS)
- Receive HTTP request with server name
- Fetch
{server}.jsonmetadata from S3 - Download GitHub repo as ZIP
- Extract to
/tmp - Install dependencies (pip/npm)
- Execute entrypoint with JSON-RPC request
- Return response
- Log to CloudWatch
Data Flow
Storage Structure
S3 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(array of discovered tool names)tool_countsecurity_report(SonarCloud, Bandit, GitGuardian results; may be null)meta.created_at,meta.updated_at(timestamps added on upsert)
Core Services
Execution Service
Execution Service
Coordinates Lambda execution pipeline.
Security Scanning Service
Security Scanning Service
Orchestrates multi-tool security scanning:
- SonarQube for code quality
- Bandit for Python security issues
- GitGuardian for secret detection
- Semgrep for pattern matching
- OWASP Dependency-Check
CLI Tool (Python)
1
Initialization
superbox init creates project structure:2
Authentication
superbox auth performs device flow: 1. Generates device code 2. Opens
browser for authorization 3. Polls for token 4. Stores credentials securely3
Security Scan
superbox push runs 5-step pipeline: 1. SonarQube code quality 2. Bandit
security issues 3. GitGuardian secrets 4. Semgrep vulnerabilities 5. OWASP
dependencies4
Publish
Uploads server to SuperBox:
- Validates configuration
- Packages server code
- Uploads to S3
- Registers in database
- Triggers Lambda deployment
API Endpoints
Authentication
- POST /auth/register - POST /auth/login - GET /auth/oauth/:provider - POST /auth/device-flow
Servers
- GET /servers - GET /servers/:id - POST /servers - PUT /servers/:id - DELETE /servers/:id
Execution
- POST /execute/:serverId - GET /execution/:id/logs - GET /execution/:id/status
Performance Metrics
SuperBox is designed for high performance with the following targets:
- API Performance
- Lambda Performance
- Database Performance
| Metric | Target | Actual |
|---|---|---|
| Average Response Time | < 100ms | 85ms |
| P95 Response Time | < 200ms | 175ms |
| P99 Response Time | < 500ms | 425ms |
| Throughput | > 10k req/s | 12k req/s |
| Error Rate | < 0.1% | 0.05% |
Scaling Strategy
Horizontal Scaling
Horizontal Scaling
API servers scale automatically based on CPU/memory:
- Auto Scaling Groups with min 2, max 10 instances
- Scale up at 70% CPU utilization
- Scale down at 30% CPU utilization
- Health checks every 30 seconds
Database Scaling
Database Scaling
PostgreSQL RDS with read replicas: - Primary instance for writes - 2 read
replicas for queries - Automatic failover - Daily backups with 7-day retention
Cache Strategy
Cache Strategy
Redis ElastiCache for performance: - Server metadata cached for 1 hour - User
sessions cached for 7 days - Search results cached for 15 minutes - Cache
invalidation on updates
Lambda Concurrency
Lambda Concurrency
AWS Lambda auto-scales execution:
- Reserved concurrency: 1000
- Burst concurrency: 3000
- Cold start optimization with provisioned concurrency
- Dead letter queue for failed executions
Security Features
End-to-End Encryption - All data encrypted in transit (TLS 1.3) and at
rest (AES-256)
WAF Protection - AWS WAF rules for DDoS and common attacks
Rate Limiting - Redis-based rate limiting per user and IP
Input Validation - Strict validation and sanitization of all inputs
Sandbox Isolation - Lambda functions run in isolated containers
Secrets Management - AWS Secrets Manager for sensitive data
Monitoring & Observability
Logs
CloudWatch Logs Centralized logging with structured JSON format
Metrics
CloudWatch Metrics Custom metrics for API, Lambda, and database
Traces
X-Ray Tracing Distributed tracing across services