Supported Variables
ANTHROPIC_API_KEY / CRAFT_ANTHROPIC_API_KEY
Provide an Anthropic API key without storing it locally. Both names are supported;CRAFT_ANTHROPIC_API_KEY takes precedence if both are set.
CRAFT_CLAUDE_OAUTH_TOKEN
Provide a Claude OAuth token (for Claude Pro/Max subscriptions) without storing it locally.ANTHROPIC_BASE_URL
Override the API endpoint URL. This is set automatically by Craft Agents when you configure a non-Anthropic provider (OpenRouter, Vercel AI Gateway, Ollama, or custom endpoint) via the UI.This variable is typically managed by Craft Agents based on your API Provider configuration. You only need to set it manually for automation or CI scenarios.
AWS Credentials (Bedrock)
When using AWS Bedrock withauthType: "environment", the subprocess inherits standard AWS environment variables from your shell:
~/.aws/credentials, SSO sessions, IAM roles, and instance profiles all work.
With
authType: "iam_credentials", credentials are entered in the UI and injected into the subprocess automatically. You do not need to set these env vars in that case.CRAFT_CONFIG_DIR
Override the default configuration directory. By default, Craft Agents stores configuration in~/.craft-agent/.
config.jsonpreferences.jsoncredentials.enc- Workspace configurations
CRAFT_LOCAL_MCP_ENABLED
Enable or disable local MCP server support (stdio subprocess servers).| Value | Behavior |
|---|---|
"true" | Enable local MCP servers (default when not set) |
| Any other value | Disable local MCP servers |
This variable requires the exact lowercase string
"true" to enable. Values like "True", "TRUE", "yes", or "1" will be treated as disabled.CRAFT_DEBUG
Enable debug logging for troubleshooting. When set, additional diagnostic information is written to the log file.Server Mode Variables
These configure the remote server when running in standalone or embedded mode.CRAFT_SERVER_TOKEN
Bearer token for server authentication. Required for both server and client.CRAFT_SERVER_URL
Server URL for client connections. Set this on the client side to connect to a remote server.CRAFT_RPC_HOST
Bind address for the server. Defaults to127.0.0.1 (localhost only). Set to 0.0.0.0 to accept remote connections.
CRAFT_RPC_PORT
Server port. Defaults to9100.
CRAFT_RPC_TLS_CERT / CRAFT_RPC_TLS_KEY
PEM certificate and private key files for TLS. Required for remote connections (wss://). Can be omitted for localhost development.
CRAFT_RPC_TLS_CA
Optional PEM CA chain file for custom certificate authorities.Development Variables
These variables are primarily used for development and multi-instance scenarios.CRAFT_VITE_PORT
Override the Vite dev server port. Automatically set when running from numbered instance folders.CRAFT_APP_NAME
Override the application display name. Useful for distinguishing multiple instances.CRAFT_INSTANCE_NUMBER
Instance identifier for multi-instance support. When set, adds a badge to the dock icon.CRAFT_DEEPLINK_SCHEME
Custom deep link URL scheme. Default iscraftagents.
VITE_DEV_SERVER_URL
URL of the Vite development server. Used internally during development.Precedence
For API credentials, the lookup order is:CRAFT_ANTHROPIC_API_KEYorANTHROPIC_API_KEYenvironment variableCRAFT_CLAUDE_OAUTH_TOKENenvironment variable (for OAuth)- Stored credential in
~/.craft-agent/credentials.enc - Interactive prompt (if running interactively)
ANTHROPIC_BASE_URLenvironment variable- Connection base URL (configured in LLM connections)
- Default (
https://api.anthropic.com)
- LLM connection default model (if set)
- App-level model defaults (per provider)
- System default (Claude Sonnet)
CRAFT_CONFIG_DIRenvironment variable- Default
~/.craft-agent/