Environment Variables (.env)
Create a .env file in the same directory as docker-compose.yml and set the required values before starting the application.
Security (Required)
In the shipped Docker image,
STUDIO_ENCRYPTION_KEY, STUDIO_JWT_SECRET, STUDIO_AGENT_SERVICE_TOKEN, and REDIS_PASSWORD are hard-required - startup fails if any is missing. Auto-generation of STUDIO_ENCRYPTION_KEY/STUDIO_JWT_SECRET only applies when STUDIO_ENV=dev.Public Ports
Database
FastMCP
Agent MCP
Redis
Logging
GeoIP (Optional)
The GeoLite2-Country MMDB is downloaded at Docker build time and works air-gapped after build. When a MaxMind license key is configured, you can update the database at runtime via the Settings UI.
Security Controls
See Security > Prompt Injection Protection for details on what is scanned and how blocked attempts are reported.
SSL/TLS (Optional)
The SSL domain and ACME contact email are not environment variables - they are set as
ServerConfig fields via the SSL / TLS settings in the UI, see below.
Generate Secrets
Server Settings (UI)
Server settings are managed through the Settings tab on the Server page (/server > Settings tab).
General
Security
SSL / TLS
Global Variables
Server-level key-value pairs accessible in all tool transform templates as{{ vars.key_name }}.
Manage via the Global Variables card on the Settings tab, or via the API:
PATCH /api/v1/server/config with global_variables.
Maximum 100 global variables. Names must match
^[a-zA-Z_]\w{0,63}$.CORS Configuration
Default CORS origins allow onlylocalhost:3000 and localhost:5173. For production, update to your actual domain:
PATCH /api/v1/server/config with cors_origins.
Encryption Key Management
TheSTUDIO_ENCRYPTION_KEY is a symmetric encryption key used to encrypt:
- Database connection passwords
- Bearer authentication tokens
- DNS API credentials for SSL
- Sensitive
extra_paramsfields (e.g., BigQuerycredentials_json) - TOTP 2FA secrets
- OAuth2 client credentials (MCP auth)
- OAuth2 introspection client secret (MCP auth)
.env to persist encrypted data across container restarts.
Key Rotation
SMKRV MCP Studio supports encryption key rotation. To rotate:- Generate a new key:
python -c "from cryptography.fernet import Fernet; print(Fernet.generate_key().decode())" - Set
STUDIO_ENCRYPTION_KEYtonew_key,old_key(comma-separated, new key first) - Restart the backend - new data is encrypted with the new key, old data can still be decrypted with the old key
- After all data has been re-encrypted (on next update of each entity), remove the old key
See Also
- Security - encryption architecture, authentication, and hardening checklist
- SSL/HTTPS Setup - configure automatic SSL certificates
- Agent MCP - agent service token and rate limiting
- Queue Management - Redis queue configuration
- Troubleshooting - common configuration issues and solutions