Navigation
On this page

Environment Variables

Complete reference for all Mediabox MCP environment variables and their configuration.

All Mediabox MCP configuration is managed through a single .env file at the root of your project. This page documents every available variable.

Deployment

VariableRequiredDefaultDescription
DEPLOYMENT_MODEYeslocalDeployment mode: local or vps.
TZNoUTCTimezone for all services (e.g., America/New_York, Europe/London).

Domain & SSL

These variables are required depending on the deployment mode selected during setup.

VariableRequiredDefaultDescription
BASE_DOMAINConditionalDomain for services (e.g., media.example.com). Required for vps mode and Cloudflare Tunnel.
LETSENCRYPT_EMAILConditionalEmail for Let’s Encrypt SSL certificates. Required for vps mode.
CLOUDFLARE_TUNNEL_TOKENConditionalCloudflare Tunnel token from the Zero Trust dashboard. Required when using Cloudflare Tunnel.

Service API Keys

VariableRequiredDefaultDescription
JELLYFIN_API_KEYYesExtracted on first bootAPI key for Jellyfin. Auto-generated by Jellyfin during initial setup, then extracted by the wizard.
SONARR_API_KEYYesExtracted on first bootAPI key for Sonarr. Auto-generated by Sonarr on first run, extracted from config/sonarr/config.xml.
RADARR_API_KEYYesExtracted on first bootAPI key for Radarr. Auto-generated by Radarr on first run, extracted from config/radarr/config.xml.
QBIT_PASSWORDYesPassword for the qBittorrent web UI (username is admin). Minimum 8 characters. Set by user during wizard.

PyLoad

VariableRequiredDefaultDescription
PYLOAD_USERNopyloadUsername for PyLoad web UI and API authentication.
PYLOAD_PASSWORDNopyloadPassword for PyLoad web UI and API authentication.

MCP Server

VariableRequiredDefaultDescription
MCP_PUBLIC_URLYeshttp://localhost:3000The publicly accessible URL of the MCP server. Set to your domain URL when deploying with VPS or Tunnel mode.
MCP_AUTH_SECRETYesAuto-generated32-character hex secret used for OAuth2 authentication. Auto-generated by the wizard.
INTERNAL_API_KEYYesAuto-generatedInternal API key for service-to-service communication (e.g., Telegram bot to MCP server).

Telegram Integration (Optional)

These variables are only required if you enable the Telegram bot during setup.

VariableRequiredDefaultDescription
TELEGRAM_BOT_TOKENConditionalBot token from @BotFather. Required to enable the Telegram bot.
ALLOWED_TELEGRAM_USERSNoComma-separated list of Telegram user IDs allowed to interact with the bot. Leave empty to allow all users.

LLM Provider (Optional)

These variables configure the LLM used by the Telegram bot to interpret natural language commands and call MCP tools.

VariableRequiredDefaultDescription
LLM_PROVIDERConditionalLLM provider for the Telegram bot. Supported: openrouter, google. Required if Telegram bot is enabled.
LLM_MODELNoopenai/gpt-4oModel identifier (only for OpenRouter). Examples: openai/gpt-4o, anthropic/claude-sonnet-4.
OPENROUTER_API_KEYConditionalAPI key for OpenRouter. Required when LLM_PROVIDER=openrouter.
GOOGLE_AI_API_KEYConditionalAPI key for Google AI (Gemini). Required when LLM_PROVIDER=google.

Example .env File

# Deployment
DEPLOYMENT_MODE=local
TZ=America/New_York

# Domain (uncomment for VPS mode)
# BASE_DOMAIN=media.example.com
# [email protected]

# Service API Keys (extracted after first boot)
JELLYFIN_API_KEY=
SONARR_API_KEY=
RADARR_API_KEY=
QBIT_PASSWORD=your-secure-password

# PyLoad
PYLOAD_USER=pyload
PYLOAD_PASSWORD=pyload

# MCP Server
MCP_PUBLIC_URL=http://localhost:3000
MCP_AUTH_SECRET=
INTERNAL_API_KEY=

# Telegram (optional)
# TELEGRAM_BOT_TOKEN=123456:ABC-DEF
# LLM_PROVIDER=openrouter
# LLM_MODEL=openai/gpt-4o
# OPENROUTER_API_KEY=sk-or-...
# ALLOWED_TELEGRAM_USERS=12345678,87654321

Notes

  • API keys for Jellyfin, Sonarr, and Radarr are auto-generated by each service on first boot. The setup wizard extracts them automatically. For manual setup, extract them from the config XML files.
  • MCP_AUTH_SECRET and INTERNAL_API_KEY are auto-generated as 32-character hex strings by the wizard. For manual setup, generate them with: openssl rand -hex 32
  • After changing any variable, recreate the affected containers: docker compose up -d --force-recreate <service>