Skip to main content

Environment Variables

Pcnaid MCP Hub uses environment variables for configuration. This guide covers all available variables and their usage.

Core Application Settings

Server Configuration

Authentication & Security

Admin Password

JWT Configuration

Smart Routing & Embeddings

Embedding Configuration

Configuration Examples

Development Environment

Production Environment

Docker Environment

Environment Variable Loading

Pcnaid MCP Hub loads environment variables in the following order:
  1. System environment variables
  2. .env.local (ignored by git)
  3. .env.{NODE_ENV} (e.g., .env.production)
  4. .env

Using dotenv-expand

Pcnaid MCP Hub supports variable expansion:

Security Best Practices

  1. Never commit secrets to version control
  2. Use strong, unique secrets for production
  3. Rotate secrets regularly
  4. Use environment-specific files
  5. Validate all environment variables at startup
  6. Use Docker secrets for container deployments