Environment Variables
MCPX can be configured via environment variables to control logging, authentication, metrics, configuration paths, and runtime behavior. Below is a list of supported variables, their meaning, expected input, and default values.
LOG_LEVEL
Description: Sets the logging verbosity for MCPX.
Accepted Values: error
, warn
, info
, http
, verbose
, debug
, silly
Default: info
AUTH_KEY
Description: Optional shared secret used for authenticating incoming connections to MCPX. When set, all requests must include the x-lunar-auth-key
header matching this value. This will only be effective if auth.enabled
is set to true
in app.yaml
Accepted Values: Any string
Default: None (authentication is disabled)
PORT
Description: Specifies the port MCPX will bind to for incoming HTTP traffic to MCPX.
Accepted Values: Any valid port number (integer)
Default: 9000
CONTROL_PLANE_HOST
Description: Sets the host URL of the Lunar AI Gateway MCPX should connect to.
Accepted Values: Any valid URL
Default: http://localhost:9001
ENABLE_METRICS
Description: Controls whether metrics should be exposed (e.g. for Prometheus scraping).
Accepted Values: true
, false
(as strings)
Default: true
SERVE_METRICS_PORT
Description: Defines the port on which MCPX serves its metrics endpoint.
Accepted Values: Any valid port number (integer)
Default: 3000
APP_CONFIG_PATH
Description: Path to the YAML file containing application-level configuration (e.g., ACLs, rate limits).
Accepted Values: String path to a .yaml
file
Default: config/app.yaml
SERVERS_CONFIG_PATH
Description: Path to the JSON file that defines which MCP servers/tools should be spawned by MCPX.
Accepted Values: String path to a .json
file
Default: config/mcp.json