Core client variables
| Variable | Used by | Description |
|---|---|---|
WEBCOMPUTE_API_KEY | SDK, CLI, MCP | Webcompute API key. Overrides stored CLI config for CLI/MCP. Required by the SDK unless passed as new Web({ apiKey }). |
WEBCOMPUTE_SERVER_URL | SDK, CLI, MCP | Gateway URL. Defaults to https://api.webcompute.dev. http is accepted only for localhost or loopback. |
WEBCOMPUTE_TIMEOUT | TypeScript SDK | Default SDK request timeout in milliseconds. Defaults to 120000. Non-integer values fall back to the default. |
WEBCOMPUTE_DEBUG | SDK, CLI, MCP | Set to true for debug logging and more verbose diagnostics. |
MCP variables
| Variable | Description |
|---|---|
WEBCOMPUTE_MCP_SURFACE | MCP surface: runtime, agent, or all. Defaults to runtime. |
WEBCOMPUTE_MCP_DEFAULT_BROWSER_POLICY | JSON object used as the default browser policy for MCP-created browsers. Must parse to an object. |
MCP_TRANSPORT | MCP transport: stdio or http. Defaults to stdio. |
MCP_HOST | HTTP bind host. HTTP transport must bind to a loopback host. |
MCP_PORT | HTTP port. |
PORT | Fallback HTTP port when MCP_PORT is not set. Defaults to 8932. |
Agent model variables
These variables configure MCPrun_web_agent when it is enabled on the agent or all surface. SDK web.agent() still requires explicit model config.
| Variable | Description |
|---|---|
WEBCOMPUTE_MODEL_PROFILE | Saved model profile name for MCP run_web_agent model selection. |
WEBCOMPUTE_AGENT_MODEL | Direct model ID for MCP run_web_agent. |
WEBCOMPUTE_AGENT_MODEL_ROUTE | Model route: openai, openrouter, openai-compatible, anthropic, or google. |
WEBCOMPUTE_AGENT_MODEL_API_KEY_ENV | Name of the environment variable containing the model-provider API key. |
WEBCOMPUTE_AGENT_MODEL_BASE_URL | Base URL for openai-compatible or compatible gateway routes. |
WEBCOMPUTE_AGENT_MODEL_API | Provider API family: chat-completions or responses. |
| Variable | Typical use |
|---|---|
OPENAI_API_KEY | OpenAI route. |
OPENROUTER_API_KEY | OpenRouter route. |
ANTHROPIC_API_KEY | Anthropic route. |
GEMINI_API_KEY | Google Gemini route. |
GOOGLE_API_KEY | Google credential alternative. |
CLI local-runtime variables
| Variable | Description |
|---|---|
XDG_CONFIG_HOME | Overrides config-file base directory. |
XDG_DATA_HOME | Overrides data-file base directory. |
XDG_STATE_HOME | Overrides state-file base directory. |
XDG_CACHE_HOME | Overrides cache-file base directory. |
OPENCODE_CONFIG | OpenCode config path used by local plugin detection/configuration. |
OPENCODE_CONFIG_DIR | OpenCode config directory used by local plugin detection/configuration. |
SHELL | Used by install/setup flows that reason about shell profile updates. |
PATH | Used by install/setup flows and local runtime detection. |
WC_NO_UNICODE | Disable Unicode UI symbols when set by the environment. |
WEBCOMPUTE_NO_UPDATE_NOTIFIER | Set to 1 or true to suppress CLI update hints and the background update-manifest check. |
WEBCOMPUTE_PACKAGES_BASE_URL | Override package download base URL for managed local installs. |
WEBCOMPUTE_INSTALL_BASE_URL | Override installer base URL for managed local installs. |
Local browser-development variables
These are for repo-local browser-server development, not public SDK usage.| Variable | Description |
|---|---|
DISPLAY | X display for local browser server development. In containerized dev, use DISPLAY=:1. |
LIBGL_ALWAYS_SOFTWARE | Force software GL rendering in containers. Use LIBGL_ALWAYS_SOFTWARE=1 when Chrome crashes due to GL. |
Release/runtime variables
| Variable | Description |
|---|---|
WEBCOMPUTE_BROWSER_RUNTIME_MATRIX_ID | Matrix ID for a promoted browser runtime snapshot. Preserve it with deployment records so rollbacks restore the matching snapshot/runtime tuple. |