Pass environment variables to Wassette components using shell exports or config files. Components need explicit permission to access variables.
Wassette supports the following environment variables for server configuration (following the twelve-factor app methodology):
Sets the port number for HTTP-based transports (SSE and StreamableHttp) when bind_address is not specified via CLI or config file.
PORT=8080 wassette serve --streamable-httpDefault: 9001
Precedence: CLI (--bind-address) > Config file (bind_address) > PORT/BIND_HOST > Default (127.0.0.1:9001)
Sets the host address to bind to for HTTP-based transports when bind_address is not specified via CLI or config file.
BIND_HOST=0.0.0.0 wassette serve --streamable-httpDefault: 127.0.0.1 (localhost only)
Note: In Docker containers, use BIND_HOST=0.0.0.0 to allow external connections.
Precedence: CLI (--bind-address) > Config file (bind_address) > PORT/BIND_HOST > Default (127.0.0.1:9001)
Path to custom configuration file.
WASSETTE_CONFIG_FILE=/path/to/config.toml wassette serveDefault: $XDG_CONFIG_HOME/wassette/config.toml
export OPENWEATHER_API_KEY="your_key"
wassette serve --stdio
wassette permission grant environment-variable weather-tool OPENWEATHER_API_KEYUse wassette secret set to securely pass environment variables to components:
wassette secret set weather-tool API_KEY "your_secret_key"This stores the secret securely and makes it available to the component when granted permission.
wassette permission grant environment-variable weather-tool API_KEYOr in policy file:
version: "1.0"
permissions:
environment:
allow:
- key: "API_KEY"- Permissions - Permission system details
- Configuration Files - Complete config.toml reference
- Docker Deployment - Docker configuration