# Copy to .env and fill in. Never commit the real .env. # --- Server auth (required: at least one token) --- # Admin-scoped bearer token every MCP client can send. The server fails closed # if NO token is set -- there is no unauthenticated mode. Generate one with: # python -c "import secrets; print(secrets.token_hex(32))" WPGUARD_MCP_TOKEN= # --- Scoped tokens (optional) --- # Least-privilege alternatives to the single admin token above. Each may hold # one or more comma-separated tokens. recon = Tier 1 read-only; mutate = Tier # 1+2 + packet lifecycle; admin = everything including Tier 3 wp_eval. WPGUARD_TOKEN_RECON= WPGUARD_TOKEN_MUTATE= WPGUARD_TOKEN_ADMIN= # --- Rate limits (optional, defaults shown) --- # Per-token calls/minute. Tier 3 (raw eval) has a tighter default cap. WPGUARD_RATE_LIMIT_PER_MIN=120 WPGUARD_RATE_LIMIT_TIER3_PER_MIN=10 # --- Per-target lock TTL (optional, default 3600s) --- # How long an open packet holds its site:target lock before it auto-expires. WPGUARD_LOCK_TTL_SECONDS=3600 # --- Vulnerability intelligence (optional) --- # WPScan API token and cache/policy controls. `warn` returns a packet warning; # `block` refuses plugin/theme packet approval unless the status is clean. WPGUARD_WPSCAN_API_TOKEN= WPGUARD_VULNERABILITY_CACHE_TTL_SECONDS=86400 WPGUARD_VULNERABILITY_POLICY=warn # --- Server networking (optional, defaults shown) --- WPGUARD_MCP_HOST=127.0.0.1 WPGUARD_MCP_PORT=8642 # --- Local state directory (optional, defaults to ./state) --- # Holds the packet ledger (state/packets/packets.jsonl), write snapshots # (state/packets/snapshots.jsonl), and the site registry # (state/config/sites.json). All gitignored. WPGUARD_STATE_DIR=state # --- Optional cloud-reporting hook (off unless set) --- # Push packet-lifecycle METADATA (site, target, summary, risk, status, # timestamps -- never full content, never credentials) to a control plane. # Best-effort; a failure never blocks the local operation. WPGUARD_CLOUD_REPORT_URL= WPGUARD_CLOUD_API_KEY= # --- Optional cloud pairing (experimental, distinct from the hook above) --- # `wpguard cloud pair --code ... --name ...` uses this once, at pairing time, # to reach WP MCP Cloud's pairing endpoint (default https://api.wpmcp.io if # unset). After a successful pair, the instance URL + token are persisted to # state/config/cloud.json and this var is not consulted again -- it does not # need to stay set for `wpguard cloud poll` to keep working. WPGUARD_CLOUD_URL= # --- Optional notification webhooks (off unless set) --- # Comma-separated Slack/Discord webhook URLs to ping on packet events. # WPGUARD_NOTIFY_EVENTS is a comma-separated allowlist; tier3_eval_fired # always notifies regardless. WPGUARD_NOTIFY_WEBHOOKS= WPGUARD_NOTIFY_EVENTS= # --- Guard bypass (optional, dangerous) --- # Set to 1 to let apply=True mutations run without an approved change packet. # Intended only for local development against a throwaway install. Do not # set this in any environment you'd call "production." WPGUARD_BYPASS_GUARD=0 # --- Per-site credentials --- # Sites are registered via the site_register tool, which stores connection # metadata (hosts, paths, URLs) in state/config/sites.json -- but never # secrets. Secrets live only in env vars, referenced by name from the site # registry entry. # # SSH-transport sites authenticate via your normal SSH key/agent -- no env # var needed unless your key is passphrase-protected and not in ssh-agent, # in which case wpguard-mcp expects ssh-agent to already have it loaded. # # companion_plugin-transport sites need one API key env var per site. Name # it whatever you like and point site_register's plugin_api_key_env at it, # e.g. for a site registered as "example-blog": WPGUARD_SITE_EXAMPLE_BLOG_KEY= # Preferred companion authentication uses a WordPress Application Password. # Point site_register's wp_app_password_env at this variable. WPGUARD_SITE_EXAMPLE_BLOG_APP_PASSWORD=