Skip to content

Flags and environment

Generated from the flag definitions in cmd/. Go flags accept -name and --name, and -name=value or -name value. Secrets are read from the environment only, never from flags, so they stay out of process listings.

The gateway server.

Flag Type Default Meaning
--addr string 127.0.0.1:8080 listen address (keep it on loopback)
--admin-key-id string admin-1 key id the studio uses to sign manifest calls (secret: GAMEWARDEN_ADMIN_SECRET, must differ from the player key)
--admin-keys-file string none JSON file {“key-id”:“secret”} of admin keys, for rotation. Reloaded on SIGHUP. Added to –admin-key-id
--admin-keys-only bool false accept only the keys in –admin-keys-file; the key from –admin-key-id and GAMEWARDEN_ADMIN_SECRET is retired
--audit-batch-size int 500 most audit events in one batch write (with –audit-queue)
--audit-flush-interval duration 200ms longest an audit event waits for its batch (with –audit-queue)
--audit-overflow string drop when the audit queue is full: drop the event and count it, or block until the call’s deadline (with –audit-queue)
--audit-queue int 0 queue audit events and write them in batches (needs –postgres-url). The value is the queue size in events; 0 writes each event before the call returns. A crash can lose queued events
--audit-retention duration 720h how long audit events are kept for the activity feed (0 keeps them forever)
--backend-allow-private bool false let the gateway call a backend on a loopback or private address (compose and cluster networks). Off by default: the connector refuses those addresses
--backend-key-file string none JSON file {“id”:“…”,“secret”:“…”} with the key that signs calls to the backend. Reloaded on SIGHUP. Replaces –key-id and GAMEWARDEN_SIGNING_SECRET for backend calls
--backend-url string none base URL of the game backend
--client-grace duration 24h how long a new OAuth client counts against –max-clients without a grant. The hourly prune deletes older clients that have no active grant
--client-ip-header string none trusted header carrying the client address, for example X-Forwarded-For. Set it ONLY behind a proxy that overwrites it, or clients can evade rate limits
--dev-auth bool false DEV ONLY: trust the X-Dev-Player header and serve the dev HTTP API instead of requiring OAuth tokens
--key-id string dev-1 signing key id sent to the backend
--manifest string none path to the tool manifest (YAML for .yaml or .yml, JSON for anything else)
--manifest-poll duration 15s how often to pick up a manifest version activated elsewhere (0 disables)
--max-body int 1048576 largest request body in bytes. OAuth and studio endpoints keep their lower caps, manifest upload its own
--max-clients int 10000 most live OAuth clients: registration answers 503 at this many. Counted in the auth store, so replicas on one Postgres share it. A client is live while it has an active grant or is younger than –client-grace (negative disables)
--max-scope string from GAMEWARDEN_MAX_SCOPE the most any player may grant: coach (read only, recommended for a first pilot) or operator. Empty means operator
--oidc-algs string RS256,ES256 ID token signature algorithms accepted. Asymmetric only: none and the HS family are refused
--oidc-allow-insecure-http bool false DEV ONLY: allow an http issuer on a loopback address, for a local identity provider
--oidc-client-id string none OIDC client id registered at the identity provider, with the redirect URI <public-url>/authorize/oidc/callback
--oidc-issuer string none turn on sign in with your identity provider at the consent page: its OIDC issuer URL. Needs –oidc-client-id and the secrets GAMEWARDEN_OIDC_CLIENT_SECRET and GAMEWARDEN_OIDC_SESSION_SECRET (not with –dev-auth)
--oidc-player-claim string sub ID token claim that carries the player id your game uses. It must be stable for a person for ever: not an email address or a display name
--oidc-public-client bool false register at the identity provider as a public client: no client secret, PKCE only. GAMEWARDEN_OIDC_CLIENT_SECRET must then be unset
--oidc-scopes string openid scopes requested from the identity provider, space or comma separated (openid is always included)
--ops-addr string 127.0.0.1:9090 listen address for /healthz, /readyz and /metrics. Keep it off public networks (empty disables)
--otel bool false export traces with OTLP over HTTP (default endpoint http://localhost:4318). Also on when OTEL_EXPORTER_OTLP_ENDPOINT or OTEL_EXPORTER_OTLP_TRACES_ENDPOINT is set; OTEL_SDK_DISABLED=true or OTEL_TRACES_EXPORTER=none keep it off. The standard OTEL_* variables configure the rest (OTEL_SERVICE_NAME, OTEL_TRACES_SAMPLER and OTEL_TRACES_SAMPLER_ARG). Spans never hold arguments, results or secrets
--postgres-max-conns int 0 most Postgres connections the pool opens (0 keeps the driver default, the larger of 4 and the CPU count; a pool_max_conns in the URL is used when this is 0)
--postgres-min-conns int 0 Postgres connections kept open when idle (0 keeps the driver default of none; a pool_min_conns in the URL is used when this is 0)
--postgres-url string from GAMEWARDEN_POSTGRES_URL Postgres URL for player confirmations (default: in-memory, single process)
--public-url string http://127.0.0.1:8080 public base URL of this gateway: the OAuth issuer, and the MCP resource is <public-url>/mcp
--redis-addr string from GAMEWARDEN_REDIS_ADDR Redis address for the shared policy store (default: in-memory, single process)
--register-per-hour int 10 client registrations allowed per hour per client address (negative disables)
--relay-allowed-origins string from GAMEWARDEN_RELAY_ALLOWED_ORIGINS comma separated browser origins allowed to open the relay socket, for Unity WebGL games: hosts (game.example, *.game.example) or scheme://host[:port]. Native clients send no Origin and need none. Empty allows same origin only
--relay-max-frames-per-sec int 100 frames per second one game client may send before its socket is closed (burst is twice this)
--relay-max-in-flight int 8 calls that may wait on one player’s game client at once; more get the denied result client_busy
--relay-ticket-ttl duration 60s how long a relay ticket stays valid (secret: GAMEWARDEN_RELAY_SECRET; unset disables the relay)
--studio-key-id string dev-1 key id the studio backend uses to sign link ticket requests (secret: GAMEWARDEN_SIGNING_SECRET)
--studio-keys-file string none JSON file {“key-id”:“secret”} of extra studio keys, for rotation. Reloaded on SIGHUP. Added to –studio-key-id
--studio-keys-only bool false accept only the keys in –studio-keys-file; the key from –studio-key-id and GAMEWARDEN_SIGNING_SECRET is retired, so it can be rotated with SIGHUP and no restart
--tenant string dev tenant id for the dev server
--version bool false print the version and exit

Environment variables:

Variable Meaning
GAMEWARDEN_ADMIN_SECRET Secret of the admin key (--admin-key-id) that signs manifest and admin activity calls. Without it, and without --admin-keys-file, those endpoints are not mounted. Must differ from the signing secret.
GAMEWARDEN_MAX_SCOPE Default of --max-scope.
GAMEWARDEN_POSTGRES_URL Default of --postgres-url.
GAMEWARDEN_REDIS_ADDR Default of --redis-addr.
GAMEWARDEN_RELAY_ALLOWED_ORIGINS Default of --relay-allowed-origins.
GAMEWARDEN_RELAY_SECRET Secret that signs relay tickets. Without it the relay is off and relay tools answer client_offline.
GAMEWARDEN_SIGNING_SECRET Required. HMAC secret for signing calls to the backend (key id --key-id) and for verifying studio requests (key id --studio-key-id).

The stdio to streamable HTTP bridge for desktop MCP clients. It has no environment variables.

Flag Type Default Meaning
--header string (repeatable) none extra upstream request header “Name: value” (repeatable)
--timeout duration 30s timeout for each upstream HTTP request
--url string none upstream MCP endpoint, for example http://127.0.0.1:8080/mcp (required)
--version bool false print the version and exit

The developer CLI. It has subcommands and no flags.

Command Meaning
version Print the version.
validate gwctl validate <manifest>: check a manifest (JSON, or YAML by extension) and print the tool count. Exits 1 and lists every problem when it is invalid.
tools gwctl tools <manifest>: list tier and name of every tool.