Repository navigation
Expand file tree
/
Copy path.env.example
More file actions
189 lines (155 loc) · 8.55 KB
/
Copy path.env.example
File metadata and controls
189 lines (155 loc) · 8.55 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
# Schwab Rust SDK — environment configuration
# Copy this file to `.env` and fill in the values Schwab gave you.
#
# All variables below are read by `SchwabConfig::from_env()` (called
# from the MCP binary and the `examples/*`). Defaults are noted in
# comments; only the two `SCHWAB_APP_*` secrets are strictly required.
# =====================================================================
# REQUIRED — credentials from https://developer.schwab.com
# =====================================================================
# 32- or 48-character client ID.
SCHWAB_APP_KEY=your_app_key_here
# 16- or 64-character client secret.
SCHWAB_APP_SECRET=your_app_secret_here
# =====================================================================
# OAuth callback (HTTPS required, no trailing slash)
# =====================================================================
# Default, and the recommended value for almost every use case. The
# SDK's built-in callback server listens here and captures the
# redirect automatically. Without a certificate below, it makes a
# self-signed one and your browser warns at each sign-in.
#
# Register this exact string as a Callback URL in the Schwab Developer
# Portal — Schwab matches it character-for-character.
SCHWAB_OAUTH_CALLBACK_URL=https://127.0.0.1:8080
# A certificate the browser trusts, so the sign-in completes without a
# warning. Make one with mkcert (docs/SETUP_GUIDE.md, route A):
# mkcert -install
# mkcert -cert-file ~/.config/schwab/callback.pem \
# -key-file ~/.config/schwab/callback-key.pem 127.0.0.1 localhost
# Set both or neither; use absolute paths.
#SCHWAB_CALLBACK_CERT_FILE=/Users/you/.config/schwab/callback.pem
#SCHWAB_CALLBACK_KEY_FILE=/Users/you/.config/schwab/callback-key.pem
# Let `AuthManager::authorize` run the built-in callback server and
# finish the code exchange itself (requires the `callback-server`
# feature). Off = authorize returns the URL and you pass the code to
# `exchange_code` yourself.
#SCHWAB_CAPTURE_CALLBACK=false
# =====================================================================
# Token storage
# =====================================================================
# Where refresh tokens are persisted between runs. Default:
# `schwab_tokens.json` in the current working directory. For anything
# but casual dev, use an absolute path under your config dir, e.g.
# ~/.config/schwab/tokens.json
#SCHWAB_TOKENS_FILE=~/.config/schwab/tokens.json
# Token storage backend. Leave unset to use the platform-appropriate
# secure default (Keychain on macOS, EncryptedFile elsewhere).
# Override values: `keychain` | `encrypted` | `file`.
#SCHWAB_TOKEN_STORE=
# =====================================================================
# Optional — token lifecycle tuning
# =====================================================================
# Refresh the access token this many seconds before it expires.
# Schwabdev and our default both use 61. Don't drop below 30.
#SCHWAB_REFRESH_BUFFER=61
# Run the background refresh loop. Leave enabled unless you're
# managing tokens externally.
#SCHWAB_AUTO_REFRESH=true
# PKCE (S256). Schwab does NOT use PKCE in its reference client; only
# enable this if you've confirmed your app accepts code_challenge.
#SCHWAB_PKCE_ENABLED=false
# =====================================================================
# Optional — API endpoints (defaults shown; normally leave unset)
# =====================================================================
#SCHWAB_CLIENT_BASE_URL=https://api.schwabapi.com
#SCHWAB_OAUTH_AUTH_URL=https://api.schwabapi.com/v1/oauth/authorize
#SCHWAB_OAUTH_TOKEN_URL=https://api.schwabapi.com/v1/oauth/token
#SCHWAB_WEBSOCKET_URL=wss://streamer-api.schwab.com/ws
# Streaming is on by default. Flip to false to skip the stream config.
#SCHWAB_STREAMING_ENABLED=true
# =====================================================================
# MCP server (rustyschwab-mcp)
# =====================================================================
# Transport: `stdio` (default — Claude Desktop, mcp-inspector), `http`,
# or `websocket`.
#SCHWAB_MCP_TRANSPORT=stdio
# Bind address for `http` / `websocket` transports.
#SCHWAB_MCP_BIND=127.0.0.1:8765
# Network transports require a bearer token and per-principal policy.
# Non-loopback binds additionally require this opt-in and a TLS proxy.
#SCHWAB_MCP_ALLOW_REMOTE=0
# Place/replace gate, additional to principal permissions and risk policy.
# Default: off. Cancellation can be enabled independently below.
#SCHWAB_MCP_ALLOW_TRADING=0
#SCHWAB_MCP_ALLOW_CANCEL=1
# Paper mode: run the server over the local paper venue (docs/PAPER_TRADING.md)
# instead of Schwab. Both are required together; no Schwab credential is read
# unless SCHWAB_APP_KEY is also set, which adds a read-only market-data
# client (price history, chains, movers, instruments, hours, the stream).
# Orders never reach Schwab in this mode. The trading switches and principal
# policy still apply; the venue's own per-account limits stand in for
# SCHWAB_RISK_POLICY_FILE.
#SCHWAB_MCP_PAPER_CONFIG=ops/paper/config.json
#SCHWAB_MCP_PAPER_STATE=/absolute/private/paper.sqlite3
# Required for any network transport or write-enabled stdio. See
# docs/OPERATIONS.md for the policy schema and approval flow.
#SCHWAB_MCP_POLICY_FILE=/absolute/path/principals.json
# Required to select a principal when policy is used with stdio.
#SCHWAB_MCP_PRINCIPAL=desk
# Account-number masking in MCP tool responses (masked to last four). On
# by default — set to 0 / false / no to reveal full numbers for local
# debugging. NOTE: streamer credentials and user-identity fields are
# ALWAYS dropped and cannot be re-enabled by this switch.
#SCHWAB_MCP_REDACT_PII=1
# Bytes of rows per page of the projection tools (get_candles,
# get_option_contracts, get_positions). A page that stops here reports
# truncated=true and a nextCursor. Default 65536; clamped to 4096..1 MiB.
#SCHWAB_MCP_RESPONSE_BUDGET_BYTES=65536
# =====================================================================
# Optional — observability
# =====================================================================
# Expose a Prometheus scrape endpoint at http://<bind>/metrics. Unset
# = no listener, no port bound. Typical value: 127.0.0.1:9090.
#SCHWAB_METRICS_BIND=127.0.0.1:9090
# =====================================================================
# Advanced — public HTTPS tunnels (ngrok / cloudflared / reverse proxy)
# =====================================================================
# Allow the built-in callback server to bind to 0.0.0.0 instead of
# 127.0.0.1. Needed only if you're using an external HTTPS tunnel or
# reverse proxy to terminate TLS in front of this process. Leave off
# unless you know you need it.
#SCHWAB_ALLOW_EXTERNAL_CALLBACK=false
# Enterprise operations (0.2): see docs/OPERATIONS.md.
# Static network principals require token_expires_at in their policy.
# Alternatively, verify short-lived RS256 issuer tokens:
#SCHWAB_MCP_IDENTITY_FILE=/absolute/private/identity.json
# Required for MCP trading: account-keyed portfolio caps and recovery scope.
#SCHWAB_RISK_POLICY_FILE=/absolute/private/risk.json
#SCHWAB_RECOVERY_ACCOUNTS=first_account_hash,second_account_hash
# How often each recovery account is reconciled (1000-60000 ms). A pass
# costs about two requests per account, so 2 s per account is half of a
# 2 req/s budget; startup warns past half. Account activity on the stream
# triggers an extra pass.
#SCHWAB_RECOVERY_INTERVAL_MS=2000
# Oldest baseline /readyz and get_server_status accept (1-60000 ms). Match
# the risk file's max_snapshot_age_ms and keep it above the interval.
#SCHWAB_BASELINE_MAX_AGE_MS=5000
# Optional loopback-only liveness/readiness listener.
#SCHWAB_HEALTH_BIND=127.0.0.1:9091
# MCP server: POST a notice to this URL when an order waits for an
# operator's approval (https, or http on loopback; see docs/MCP_LLM_INTEGRATION.md).
#SCHWAB_MCP_APPROVAL_WEBHOOK=https://hooks.example.com/rustyschwab
# Dashboard (rustyschwab-dash), which reads the servers' state files.
# The operator it audits actions under; defaults to the login user.
#SCHWAB_OPERATOR=your-name
# Symbols whose quotes the dashboard shows, comma-separated.
#SCHWAB_DASH_WATCHLIST=AAPL,MSFT
# `0` stops the dashboard's live quote reads (they cost Schwab requests).
#SCHWAB_DASH_QUOTES=1
# Development only: run the read-only live conformance sweep
# (crates/rustyschwab/tests/live_conformance.rs) against the real API.
# `1` checks shapes against the recorded fixtures, `record` refreshes them.
# The JSON report defaults to target/live-conformance.json.
#SCHWAB_LIVE_CONFORMANCE=1
#SCHWAB_LIVE_CONFORMANCE_REPORT=target/live-conformance.json