schwab-mcp
Server Configuration
Describes the environment variables required to run the server.
| Name | Required | Description | Default |
|---|---|---|---|
| MCP_PUBLIC_URL | No | Public HTTPS base URL for the remote Streamable HTTP server, e.g. https://schwab-mcp.your-domain.com. | |
| SCHWAB_APP_KEY | No | Charles Schwab Developer App Key. | |
| SCHWAB_DRY_RUN | No | When true, routes orders to Schwab previewOrder instead of live submission; cannot be overridden by AI tool parameters. | true |
| SCHWAB_READ_ONLY | No | When true, blocks all live order placements, replacements, and cancellations. | |
| MCP_PUBLIC_DOMAIN | No | Public domain used for Docker/Caddy deployment, e.g. schwab-mcp.your-domain.com. | |
| SCHWAB_APP_SECRET | No | Charles Schwab Developer App Secret. | |
| SCHWAB_CALLBACK_URL | No | OAuth callback URL registered with Schwab. For local stdio mode, e.g. https://127.0.0.1:8182. For remote mode, defaults to <MCP_PUBLIC_URL>/schwab/callback. | |
| SCHWAB_TLS_KEY_PATH | No | Optional path to the TLS private key for the local HTTPS callback listener. | |
| SCHWAB_MAX_ORDER_USD | No | Per-order USD notional cap; default is $5,000. | 5000 |
| SCHWAB_TLS_CERT_PATH | No | Optional path to a TLS certificate for the local HTTPS callback listener, e.g. generated with mkcert. | |
| SCHWAB_ALLOWED_SYMBOLS | No | Comma-separated allowlist of symbols permitted for trading. | |
| SCHWAB_BLOCKED_SYMBOLS | No | Comma-separated blocklist of symbols prohibited from trading. |
Instructions
Guidance the server publishes about itself, which clients place ahead of the tool catalog so the model reads it before choosing anything.
You have access to Charles Schwab real-time market data, account balances/positions, and guarded order execution tools. If any tool returns SchwabAuthError with auth_required=true, immediately call start_auth to guide the user through quick authentication (or ask them to reconnect via MCP OAuth). Before placing any live trade, always inspect get_risk_config, verify live quotes/Greeks, dry-run/preview the order first, and only pass confirm_live=True with explicit user approval.
Capabilities
Features and capabilities supported by this server
Protocol revision2025-11-25
| Capability | Details |
|---|---|
| tools | {
"listChanged": false
} |
| prompts | {
"listChanged": false
} |
| resources | {
"subscribe": false,
"listChanged": false
} |
Tools
Functions exposed to the LLM to take actions
| Name | Description |
|---|---|
| get_auth_statusA | Check Charles Schwab OAuth 2.0 token health and remaining TTL (30m access & 7d refresh). |
| start_authA | Start Charles Schwab OAuth 2.0 login directly from your AI agent (Mode 2 local flow). Supports MCP 2026-07-28 URL-mode elicitation (prompting the client UI natively for
out-of-band OAuth so credentials never touch the LLM context), plus automatic local
HTTPS loopback callback capture and manual URL-paste fallback via Args: open_browser: Automatically open the Schwab login URL in your desktop browser when client URL-mode elicitation is unavailable (default True). auto_capture: Start a temporary local HTTPS listener to capture the callback automatically (default True). wait_seconds: Optional seconds to wait for browser completion before returning (0-120, default 0). |
| complete_authA | Complete Charles Schwab OAuth 2.0 login by exchanging a callback URL or authorization code. Args: callback_url: The full redirected URL from your browser address bar (e.g. 'https://127.0.0.1:8182/?code=...&session=...') or the raw authorization code. |
| get_quotesA | Fetch real-time market quotes for one or multiple stocks, ETFs, indexes, or OCC options. Args: symbols: List of symbols (e.g. ['AAPL', 'NVDA', '$SPX']) or comma-separated string. fields: Schwab quote fields (default 'quote,reference,extended'). indicative: Include indicative quotes for eligible symbols. compact: Return concise AI-friendly quote fields (default True) or full Schwab payload. |
| get_price_historyA | Fetch historical OHLCV candlestick price bars for a stock, ETF, or index. Args: symbol: Ticker symbol (e.g. 'AAPL', 'SPY'). period_type: 'day', 'month', 'year', or 'ytd'. period: Number of periods (day: 1,2,3,4,5,10; month: 1,2,3,6; year: 1,2,3,5,10,15,20; ytd: 1). Omit (set None) if specifying start_date/end_date. frequency_type: 'minute' (for day), 'daily', 'weekly', or 'monthly'. frequency: Candle interval (minute: 1,5,10,15,30; daily/weekly/monthly: 1). start_date: Optional start date ('YYYY-MM-DD', ISO-8601 UTC, or epoch ms). end_date: Optional end date ('YYYY-MM-DD', ISO-8601 UTC, or epoch ms). need_extended_hours: Include pre-market and after-hours candles. need_previous_close: Include previous close metadata. limit: Maximum number of most-recent candles returned (default 120). |
| get_option_expirationsA | List available option expiration dates, DTE, and expiration types for an underlying symbol. |
| get_option_chainA | Fetch real-time option chain (calls/puts, strikes, bid/ask, IV, OI, Greeks). Args: symbol: Underlying ticker (e.g. 'NVDA', 'SPY'). contract_type: 'ALL', 'CALL', or 'PUT'. strike_count: Strikes above and below ATM (default 8). range_filter: 'ALL', 'ITM', 'NTM', 'OTM', 'SAK', 'SBK', 'SNK'. from_date: Filter expirations from YYYY-MM-DD. to_date: Filter expirations up to YYYY-MM-DD. strike: Optional single strike price filter. strategy: 'SINGLE', 'ANALYTICAL', 'COVERED', 'VERTICAL', 'CALENDAR', 'STRANGLE', 'STRADDLE', etc. include_underlying_quote: Include underlying spot quote. compact: Return clean contract summaries (default True) or full raw Schwab JSON. |
| get_market_moversB | Fetch top market movers for an index or market segment. Args: index: '$DJI', '$COMPX', '$SPX', 'NYSE', 'NASDAQ', 'OTCBB', 'INDEX_ALL', 'EQUITY_ALL', 'OPTION_ALL', 'OPTION_PUT', or 'OPTION_CALL'. sort: 'VOLUME', 'TRADES', 'PERCENT_CHANGE_UP', or 'PERCENT_CHANGE_DOWN'. frequency: Lookback minutes: 0, 1, 5, 10, 30, or 60. |
| get_market_hoursA | Check exchange trading hours and holiday status for specified markets. Args: markets: Comma-separated list from 'equity', 'option', 'bond', 'future', 'forex'. date: Optional YYYY-MM-DD date (defaults to today). |
| search_instrumentsB | Search instruments by ticker/description or retrieve fundamental company metrics. Args: symbol: Ticker or search keyword (e.g. 'AAPL', 'TSLA'). projection: 'fundamental', 'symbol-search', 'symbol-regex', 'desc-search', 'desc-regex', or 'search'. |
| list_accountsA | List all linked Schwab accounts with encrypted hashes, balances, buying power, and positions. |
| get_account_detailsA | Fetch balances, buying power, margin status, and positions for a specific Schwab account. Args: account: Account number, last 4 digits, or encrypted hashValue (optional if only 1 account or default set). include_positions: Include open positions. raw: Return full unmodified Schwab JSON payload. |
| get_positionsA | Fetch all open equity and option positions for an account with PnL and market values. |
| get_ordersA | Query orders for a specific account or across all accounts (pass account='ALL'). Args: account: Account number, last 4 digits, hashValue, 'ALL', or None for default account. days_back: Lookback window in days when from_time is omitted (default 7, Schwab max 60). from_time: Optional ISO-8601 start timestamp (e.g. '2026-11-15T00:00:00Z'). to_time: Optional ISO-8601 end timestamp. status: Optional filter: 'WORKING', 'FILLED', 'CANCELED', 'EXPIRED', 'PENDING_ACTIVATION', 'REJECTED', etc. max_results: Maximum orders to return (default 50). |
| get_orderB | Fetch full details and execution status of a single order by order_id. |
| get_transactionsB | Fetch account transaction history (trades, dividends, option assignments, cash transfers). Args: account: Account number, last 4 digits, or hashValue. days_back: Lookback window in days when start_date is omitted (default 30). start_date: Optional start date ('YYYY-MM-DD' or ISO-8601). end_date: Optional end date ('YYYY-MM-DD' or ISO-8601). types: Schwab transaction type: 'TRADE', 'RECEIVE_AND_DELIVER', 'DIVIDEND_OR_INTEREST', 'ACH_RECEIPT', 'ACH_DISBURSEMENT', 'CASH_RECEIPT', 'CASH_DISBURSEMENT', 'ELECTRONIC_FUND', 'WIRE_OUT', 'WIRE_IN', 'JOURNAL', 'MEMORANDUM', 'MARGIN_CALL', 'MONEY_MARKET', 'SMA_ADJUSTMENT'. symbol: Optional ticker symbol filter. |
| get_user_preferencesA | Fetch Schwab user preferences (account nicknames and streamer connection metadata). |
| get_risk_configA | Inspect active trading risk guardrails (dry_run, read_only, max_order_usd, symbol rules). |
| build_option_symbolA | Build a 21-character OCC option symbol required by Charles Schwab. Args: underlying: Underlying ticker (e.g. 'AAPL', 'SPY'). expiration: Expiration date in 'YYYY-MM-DD' or 'YYMMDD' format. contract_type: 'CALL' (or 'C') or 'PUT' (or 'P'). strike: Option strike price (e.g. 200.0 or 182.5). |
| place_equity_orderA | Place (or dry-run preview) a stock/ETF order with built-in risk checks. Args: symbol: Equity or ETF ticker (e.g. 'AAPL', 'SPY'). instruction: 'BUY', 'SELL', 'SELL_SHORT', or 'BUY_TO_COVER'. quantity: Number of shares (> 0). order_type: 'MARKET', 'LIMIT', 'STOP', 'STOP_LIMIT', 'MARKET_ON_CLOSE', or 'LIMIT_ON_CLOSE'. price: Limit price (required for LIMIT, STOP_LIMIT, and LIMIT_ON_CLOSE). stop_price: Stop trigger price (required for STOP and STOP_LIMIT). duration: 'DAY', 'GOOD_TILL_CANCEL', 'FILL_OR_KILL', or 'IMMEDIATE_OR_CANCEL'. session: 'NORMAL', 'AM' (pre-market), 'PM' (after-hours), or 'SEAMLESS' (extended hours require LIMIT+DAY). account: Optional account number, last 4 digits, or hashValue. dry_run: Force dry-run/preview mode (note: global SCHWAB_DRY_RUN=true cannot be overridden). confirm_live: Must be True to submit a real order when SCHWAB_DRY_RUN=false. |
| place_option_orderB | Place (or dry-run preview) a single-leg option order with built-in risk checks. Provide EITHER |
| place_option_spread_orderB | Place (or dry-run preview) a multi-leg option spread or covered strategy order (2-4 legs). |
| place_trailing_stop_orderB | Place (or dry-run preview) a TRAILING_STOP or TRAILING_STOP_LIMIT order for equity or option. |
| place_oco_orderB | Place (or dry-run preview) an OCO (One-Cancels-Other) order for Take-Profit + Stop-Loss. |
| place_bracket_orderC | Place (or dry-run preview) a Bracket order (entry triggers OCO Take-Profit + Stop-Loss). |
| place_trigger_orderC | Place (or dry-run preview) a 1st-Triggers-2nd (TRIGGER) conditional order. |
| place_raw_orderC | Place (or dry-run preview) any custom Schwab Trader API v1 order JSON payload. |
| preview_raw_orderB | Call Schwab's official previewOrder endpoint directly without submitting a live order. |
| replace_orderC | Replace/modify an existing open order with a new Schwab order payload. |
| cancel_orderB | Cancel an existing open order by order_id (respects SCHWAB_READ_ONLY and SCHWAB_DRY_RUN). |
Prompts
Interactive templates invoked by user choice
| Name | Description |
|---|---|
| safe_order_checklist | Step-by-step verification workflow before submitting any live Schwab order. |
| analyze_position | Review an existing holding's PnL, live market context, and exit options. |
| option_chain_review | Inspect expirations, IV, liquidity, and Greeks before selecting an option contract. |
Resources
Contextual data attached and managed by the client
| Name | Description |
|---|---|
| auth-status | Current OAuth 2.0 token health, access TTL, and 7-day refresh TTL. |
| risk-config | Active dry-run, read-only, max order notional USD, and symbol rules. |
| accounts | Summary of linked Schwab accounts, buying power, and balances. |
TDQS
Scored across 30 tools
Most tools target a clearly distinct resource+action (quotes vs. price history vs. option chain vs. transactions), and the nine place_* order tools each map to a well-defined order type. Minor overlap exists between preview_raw_order and place_raw_order (which itself supports dry-run preview), and between the generic raw order tool and the typed equity/option order tools, which could cause occasional misselection.
Nearly every tool follows a strict snake_case verb_noun pattern (get_quotes, place_equity_order, cancel_order, build_option_symbol), with a predictable cluster of place_*/get_*/list_* variants. The auth trio (start_auth, complete_auth, get_auth_status) uses a consistent noun-first sub-convention that stays readable.
At 30 tools the surface is heavy, and the bulk comes from nine order-placement variants plus three auth tools. Each does earn a place given the breadth of the Schwab trading domain, but the set is larger than the typical well-scoped range and borders on overload for an agent choosing among order types.
Core lifecycle is well covered: account/position reads, market data, option chains, order preview/place/replace/cancel, transactions, risk config, and OAuth management. Gaps are modest — no watchlist management and no streaming/real-time subscription tools, which agents must work around with quote polling.