Skip to main content
Glama
Schwab Read-Only MCP

Schwab Read-Only MCP

Schwab Read-Only MCP

本地 stdio MCP:从 Charles Schwab 官方 API 读取美股行情与账户数据。没有下单、撤单、修改账户或其他写入工具。

已提供工具

  • get_quotes:美股报价及基本面字段

  • get_price_history:分钟、日、周或月线 OHLCV;支持 Schwab 允许范围内的完整 ISO 时间区间和盘前盘后

  • get_technical_indicators:本地基于 Schwab K 线计算 SMA20、EMA20、RSI14、MACD(12,26,9)、布林带(20,2)、ATR14 和分交易日 VWAP

  • get_fundamentals:Schwab 可用的发行人基本面字段

  • get_option_chain、get_market_hours、get_movers

  • get_accounts、get_account、get_transactions

报价是否属于实时数据取决于 Schwab 账户及交易所行情授权;MCP 不会把延时行情误标为实时。K 线的最长可获取范围和粒度由 Schwab API 限制;财务报表、逐季历史财务、预期和研报并不包含在 Schwab 基本面字段内。

Related MCP server: market-data-mcp

前置条件

  1. 在 Schwab Developer Portal 创建应用,并将回调地址完整填入该应用设置。

  2. Python 3.11+ 与 uv。

cd /Users/chensirui/Develop/Equity_research/schwab_readonly_mcp
uv sync
export SCHWAB_CLIENT_ID='你的 App Key'
export SCHWAB_CLIENT_SECRET='你的 App Secret'
export SCHWAB_REDIRECT_URI='与你在 Schwab 登记的一致的回调地址'
uv run schwab-readonly-mcp auth

授权命令会打开浏览器;授权后粘贴完整的回调 URL。令牌默认保存为 ~/.config/schwab-readonly-mcp/token.json,目录权限为 0700、文件权限为 0600。

连接 Codex

在本地 MCP 配置中添加:

{
  "mcpServers": {
    "schwab-readonly": {
      "command": "uv",
      "args": ["--directory", "/Users/chensirui/Develop/Equity_research/schwab_readonly_mcp", "run", "schwab-readonly-mcp", "server"],
      "env": {
        "SCHWAB_CLIENT_ID": "…",
        "SCHWAB_CLIENT_SECRET": "…",
        "SCHWAB_REDIRECT_URI": "…"
      }
    }
  }
}

不要把 App Secret 或 token 写进项目、提交到 Git,或提供给对话。

本地验证

uv run python -c "from schwab_readonly_mcp.server import create_server; print(create_server)"

Available Tools

10 tools
get_accountA

Read balances and optional positions for one account hash returned by get_accounts.

Inputs: account_hash (required), include_positions.

get_accountsA

List linked Schwab accounts and, optionally, their positions. This tool never changes accounts.

Inputs: include_positions.

get_fundamentalsB

Get Schwab's available issuer fundamentals for one symbol; it is not a replacement for full financial statements.

Inputs: symbol (required).

get_market_hoursB

Get market-session hours, optionally for an ISO date.

Inputs: markets (required), date.

get_moversB

Get top movers for $SPX, $COMPX, or $DJI.

Inputs: sort, index, frequency.

get_option_chainA

Get a read-only option chain with Schwab-provided Greeks where available.

Inputs: symbol (required), strike_count, contract_type.

get_price_historyB

Get every OHLCV candle Schwab allows for the requested period or ISO-8601 time range.

Inputs: symbol (required), period, frequency, period_type, +4 more.

get_quotesB

Get Schwab quotes for US equity symbols. Values may be delayed by exchange entitlement.

Inputs: symbols (required), fields.

get_technical_indicatorsC

Calculate SMA20, EMA20, RSI14, MACD(12,26,9), Bollinger(20,2), ATR14 and session VWAP from Schwab candles.

Inputs: symbol (required), period, frequency, period_type, +1 more.

get_transactionsA

Read transaction history in an inclusive ISO-date range; this never submits an order.

Inputs: end_date (required), start_date (required), account_hash (required), transaction_types.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool targets a distinct data type or action: quotes, transactions, price history, indicators, fundamentals, options, market hours, movers, and account details. While get_accounts and get_account overlap slightly, they are clearly list-vs-detail, and all price-related tools are differentiated by purpose (live snapshot vs historical vs derived). No two tools appear to do the same thing.

    Naming Consistency5/5

    All tool names follow a consistent 'get_' prefix followed by a noun, e.g., get_quotes, get_transactions, get_accounts. The pattern is uniform and predictable, making it easy for an agent to infer the function of each tool from its name.

    Tool Count5/5

    Ten tools is a well-scoped size for a read-only financial data server. Each tool covers a meaningful aspect of market or account data without excessive fragmentation or bloat, and the count is within the ideal range for an agent to manage.

    Completeness4/5

    The server covers the core read-only workflows: quotes, historical data, indicators, fundamentals, options, market hours, movers, transactions, and account balances. Minor gaps exist, such as lack of order-status retrieval or news, but these are not essential for a read-only market/account server and can be worked around.

    Maintenance

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      D
      maintenance
      A read-only MCP server that provides access to Charles Schwab account data and market information, including portfolio positions, real-time quotes, options chains, price history, and account balances through AI assistants.
      9
      MIT
    • -
      license
      Not graded
      quality
      Not graded
      maintenance
      Real-time financial market data MCP server. Stocks, crypto, technicals, sentiment, FDA calendar. No API keys required.
      -
    • A
      license
      C
      quality
      D
      maintenance
      An MCP server providing stock market data and trading capabilities through multiple broker APIs including Robinhood and Schwab.
      100
      70 PyPI
      11
      Apache 2.0
    • A
      license
      C
      quality
      C
      maintenance
      Read-only MCP server that exposes Futu OpenD's investment-research quote APIs (stocks, options, futures, financials, news, etc.) as MCP tools, leveraging an already-running OpenD gateway with no separate authentication.
      53
      9
      MIT