Skip to content

Configuration Reference

SimonTarara62 edited this page Nov 29, 2026 · 4 revisions

Configuration Reference

⚠️ Generated page — do not edit by hand. Run make wiki to regenerate.

Settings are read from environment variables (or a .env file / CAP_*_CMD secret-exec helpers). Names below are the env-var form.

Env var Type Default Description
CAP_ENV CapEnv 'demo' Environment: demo or live
CAP_API_KEY str (required) API Key from Capital.com
CAP_IDENTIFIER str (required) Login email
CAP_API_PASSWORD str (required) API Key custom password
CAP_ALLOW_TRADING bool False —
CAP_ALLOWED_EPICS str '' —
CAP_MAX_POSITION_SIZE float live 1.0, demo 100000.0 Default depends on CAP_ENV (live 1.0, demo 100000) when unset.
CAP_MAX_WORKING_ORDER_SIZE float live 1.0, demo 100000.0 Default depends on CAP_ENV (live 1.0, demo 100000) when unset.
CAP_MAX_OPEN_POSITIONS int live 3, demo 10 Default depends on CAP_ENV (live 3, demo 10) when unset.
CAP_MAX_ORDERS_PER_DAY int live 20, demo 200 Default depends on CAP_ENV (live 20, demo 200) when unset.
CAP_REQUIRE_EXPLICIT_CONFIRM bool True —
CAP_DRY_RUN bool False —
CAP_DEFAULT_ACCOUNT_ID str | None None Pins the account: the session always returns to it, and cap_session_login and cap_session_switch_account refuse any other account.
CAP_PERSIST_SESSION bool True Cache the short-lived session tokens in the state file (0600) so back-to-back invocations reuse them instead of re-logging in (avoids HTTP 429). Set false to disable.
CAP_HTTP_TIMEOUT_S float 15.0 —
CAP_LOG_LEVEL str 'WARNING' —
CAP_WS_ENABLED bool False —
CAP_PREVIEW_CACHE_TTL_S int 120 —
CAP_PREVIEW_REUSE PreviewReuse 'block' Re-executing an already-executed preview: block (default), allow, or ask. In this release ask behaves like block.
CAP_PING_INTERVAL_S int 480 Reserved; has no effect. The session is kept alive by logging in again when it expires, and the stream sends its own keep-alive.
CAP_ENV_FILE str — Path of the .env file to read credentials from; wins over ./.env, the init file and the SDK default file.
CAP_MCP_TRANSPORT str 'stdio' Transport for capitalcom-mcp run when --transport is not given: stdio or http.
CAP_MCP_HOST str '127.0.0.1' Address the HTTP transport binds to when --host is not given.
CAP_MCP_PORT int 8000 Port the HTTP transport listens on when --port is not given.
CAP_API_KEY_CMD str — Command whose output supplies CAP_API_KEY; used only when CAP_API_KEY is not set in the process environment, and wins over a file value.
CAP_IDENTIFIER_CMD str — Command whose output supplies CAP_IDENTIFIER; used only when CAP_IDENTIFIER is not set in the process environment, and wins over a file value.
CAP_API_PASSWORD_CMD str — Command whose output supplies CAP_API_PASSWORD; used only when CAP_API_PASSWORD is not set in the process environment, and wins over a file value.

Clone this wiki locally