Schwab MCPのロゴ

Schwab MCP

コミュニティ
jkoelker

Chat with your portfolio.

公開者jkoelker
リポジトリschwab-mcp
言語Python
フォーク
19
スター
60
利用可能なツール
0
通信方式stdio
カテゴリ
ライセンスMIT
リンク
  • ツールをAIワークフローに接続

    Schwab MCPは、対応するAIクライアントやAIエージェントから利用できるMCP機能を提供します。

  • 0個の利用可能なツール

    呼び出し可能なアクションを以下で確認できます。サーバーから提供されている場合は、名前や説明も表示されます。

  • コピーして使える設定

    セットアップ用の設定例を使って、お好みのMCPクライアントにこのサーバーを設定できます。

  • オープンソースの注目度

    リンク先のリポジトリには60件のスターと19件のフォークがあります。

Schwab Model Context Protocol Server

The Schwab Model Context Protocol (MCP) Server connects your Schwab account to LLM-based applications (like Claude Desktop or other MCP clients), allowing them to retrieve market data, check account status, and (optionally) place orders under your supervision.

Features

  • Market Data: Real-time quotes, price history, option chains, and market movers.
  • Account Management: View balances, positions, and transactions.
  • Trading: comprehensive support for equities and options, including complex strategies (OCO, Bracket).
  • Safety First: Critical actions (like trading) are gated behind a Discord approval workflow by default.
  • LLM Integration: Designed specifically for Agentic AI workflows.

Quick Start

Prerequisites

Installation

For most users, installing via uv tool or pip is easiest:

bash
# Using uv (recommended for isolation)
uv tool install git+https://github.com/jkoelker/schwab-mcp.git

# Using pip
pip install git+https://github.com/jkoelker/schwab-mcp.git

Authentication

Before running the server, you must authenticate with Schwab to generate a token file.

bash
# If installed via uv tool
schwab-mcp auth --client-id YOUR_KEY --client-secret YOUR_SECRET --callback-url https://127.0.0.1:8182

# If running from source
uv run schwab-mcp auth --client-id YOUR_KEY --client-secret YOUR_SECRET --callback-url https://127.0.0.1:8182

This will open a browser window for you to log in to Schwab. Once complete, a token will be saved to ~/.local/share/schwab-mcp/token.yaml.

Running the Server

Start the MCP server to expose the tools to your MCP client.

bash
# Basic Read-Only Mode (Safest)
schwab-mcp server --client-id YOUR_KEY --client-secret YOUR_SECRET

# Streamable HTTP (for reverse proxies / remote MCP connectors)
schwab-mcp server --client-id YOUR_KEY --client-secret YOUR_SECRET \
  --http --host 127.0.0.1 --port 8000

# With Trading Enabled (Requires Discord Approval)
schwab-mcp server \
  --client-id YOUR_KEY \
  --client-secret YOUR_SECRET \
  --discord-token BOT_TOKEN \
  --discord-channel-id CHANNEL_ID \
  --discord-approver YOUR_USER_ID

Default transport is stdio (Claude Desktop and most local MCP clients). Use --http for FastMCP streamable-http when fronting the server with a gateway or remote connector (MCP endpoint is /mcp on the bound host:port).

Note: For trading capabilities, you must set up a Discord bot for approvals. See Discord Setup Guide.

Configuration

You can configure the server using CLI flags or Environment Variables.

FlagEnv VariableDescription
--client-idSCHWAB_CLIENT_IDRequired. Schwab App Key.
--client-secretSCHWAB_CLIENT_SECRETRequired. Schwab App Secret.
--callback-urlSCHWAB_CALLBACK_URLRedirect URL (default: https://127.0.0.1:8182).
--token-pathN/APath to save/load token (default: ~/.local/share/...).
--httpN/AUse streamable-http transport instead of stdio.
--hostMCP_HOSTBind address when using --http (default: 127.0.0.1).
--portMCP_PORTBind port when using --http (default: 8000).
--jesus-take-the-wheelN/ADANGER. Bypasses Discord approval for trades.
--no-technical-toolsN/ADisables technical analysis tools (SMA, RSI, etc.).
--jsonN/AReturns JSON instead of formatted text (useful for some agents). Null/empty fields are stripped to reduce token usage.

Container Usage

A Docker/Podman image is available at ghcr.io/jkoelker/schwab-mcp.

bash
podman run --rm -it \
  --env SCHWAB_CLIENT_ID=... \
  --env SCHWAB_CLIENT_SECRET=... \
  -v ~/.local/share/schwab-mcp:/schwab-mcp \
  ghcr.io/jkoelker/schwab-mcp:latest server --token-path /schwab-mcp/token.yaml

Available Tools

The server provides a rich set of tools for LLMs.

📊 Market Data

ToolDescription
get_quotesReal-time quotes for symbols.
get_market_hoursMarket open/close times.
get_moversTop gainers/losers for an index.
get_option_chainStandard option chain data.
get_price_history_*Historical candles (minute, day, week).

💼 Account Info

ToolDescription
get_accountsList linked accounts (pass include_positions=True for holdings).
get_accountBalances for one account by hash (pass include_positions=True for holdings).
get_transactionsHistory of trades and transfers.
get_ordersStatus of open and filled orders.

💸 Trading (Requires Approval)

Placing an order is two steps: preview it, then place it by ID. Every preview_* tool builds the order and calls Schwab's preview API to return the projected order details plus a preview_id; place_previewed_order then submits that exact previewed order — no re-derivation from parameters, so the LLM can't hallucinate a different order than what was reviewed. Replacing an order uses the same safe flow: preview a complete single-leg equity, option, or equity trailing-stop description with preview_replacement_order, then call replace_previewed_order for the bound target order.

ToolDescription
preview_equity_orderPreview a stock/ETF buy or sell.
preview_option_orderPreview an option contract buy or sell.
preview_bracket_orderPreview an entry + take-profit + stop-loss order. Stop-loss exit type defaults to STOP; pass loss_type (STOP, STOP_LIMIT, or LIMIT) for a different exit, plus loss_limit_price when loss_type is STOP_LIMIT; the response's resolved_leg_types shows what was actually built.
preview_replacement_orderPreview a complete single-leg replacement for an existing order.
place_previewed_orderPlace the exact order returned by a preview_* call, by preview_id. Requires approval.
replace_previewed_orderReplace the exact order bound to a replacement preview. Requires approval.
cancel_orderCancel an open order.

(See full tool list in src/schwab_mcp/tools/)

Development

To contribute to this project:

bash
# Clone and install dependencies
git clone https://github.com/jkoelker/schwab-mcp.git
cd schwab-mcp
uv sync

# Run tests
uv run pytest

# Format and Lint
uv run ruff format . && uv run ruff check .

License

MIT License.

Schwab MCPのMCPを複数のAIモデルで活用

TypingMindはワークスペース単位でMCPツールに接続します。そのため、一度Schwab MCPに接続すれば、モデルごとに個別に設定することなく、TypingMind内のさまざまなAIモデルで利用できます。 このMCPは、デバイス上のTypingMind MCPコネクタを通じてローカルで動作します。

ローカルコネクタのセットアップガイド

MCPサーバーが、お使いのコンピューター上のローカルファイル、アプリ、非公開リソースにアクセスする必要がある場合は、この方法を使います。

1

MCP設定を開く

TypingMindで「設定」、「詳細設定」、「MCP」の順に進み、「コネクタを設定」を選択してください。

  1. ブラウザでTypingMindを開いてください。
  2. 設定アイコンをクリックしてください。
  3. 「詳細設定」に移動してください。
  4. 「MCP」セクションを開いてください。
  5. 「コネクタを設定」をクリックし、「このデバイス」を選択してください。
「このデバイス」が選択されたTypingMindのMCPコネクタ設定画面
2

コネクタのコマンドを実行

「このデバイス」を選択し、TypingMindからコマンドをコピーしてターミナルで実行してください。MCPの使用中は、プロセスを実行したままにしてください。

  1. TypingMindに表示されるセットアップコマンドをコピーしてください。
  2. macOSではターミナルを、WindowsではWindows Terminalを開いてください。
  3. コマンドを貼り付けて実行してください。
  4. ターミナルで続行の確認を求められた場合は、パッケージのインストールを承認してください。
  5. MCPツールの使用中は、ターミナルウィンドウを開いたまま、プロセスの実行を継続してください。
3

Schwab MCPをサーバーとして追加

コネクタのステータスが「準備完了」になったら、「サーバーを編集」をクリックし、MCPサーバーの設定を貼り付けてください。

  1. コネクタのステータスが「準備完了」になるまでお待ちください。
  2. 「サーバーを編集」をクリックしてください。
  3. Schwab MCPのMCPサーバー設定を貼り付けてください。
  4. サーバー一覧を保存してください。
  5. コネクタが引き続き使用可能か確認するには、更新してください。
稼働中のサーバーと「サーバーを編集」ボタンが表示されたTypingMindのMCP設定画面
{
  "mcpServers": {
    "schwab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

複数のモデルで同じ接続を使用

サーバー一覧を保存し、「プラグイン」を開いてSchwab MCPのMCPツールを有効にしてください。その後、TypingMindで対応するAIモデルを選択し、チャットでツールを使うか、AIエージェントに割り当ててください。

  1. TypingMindの「プラグイン」ページを開いてください。
  2. Schwab MCPのMCPツールを有効にしてください。
  3. チャットを開始し、使用するAIモデルを選択してください。
  4. MCPツールをチャットで使うか、AIエージェントに割り当ててください。
  5. MCPに再接続することなく、必要に応じて別のAIモデルに切り替えられます。
選択したAIモデルと有効なMCPツールを使用したTypingMindのチャット
Schwab MCPを使ってこのタスクを手伝ってもらえますか?
Schwab MCP
はい、読みました。
Schwab MCPで調べた結果をお伝えします。

よくある質問

Schwab MCP MCPサーバーは何に使いますか?

Schwab MCPは、対応するAIクライアントを外部ツールやコンテキストに接続するためのMCPサーバーです。TypingMindでは、このMCPサーバーを一度追加するだけで、AIワークスペース内でそのツールを利用できるようになります。

TypingMindでSchwab MCP MCPを複数のAIモデルと併用できますか?

はい。TypingMindはワークスペース単位でMCPツールに接続するため、モデルごとにMCPサーバーを設定する必要はありません。Claude、ChatGPT、Geminiや、TypingMindで設定したその他のAIモデルでSchwab MCPを利用できます。

TypingMindでSchwab MCP MCPを使うメリットは何ですか?

TypingMindは、複数のAIモデル、プロンプト、プラグイン、AIエージェント、APIキー、MCPツールを1つのワークスペースにまとめられる、LLMチャット向けの優れたフロントエンドです。Schwab MCPを接続すると、TypingMindでチャットのワークフローを整理しながら、お好みのモデルでそのMCPツールを利用できます。

Schwab MCP MCPをTypingMindに接続するにはどうすればよいですか?

Schwab MCPはTypingMindのローカルMCPコネクタ経由で動作します。MCPサーバーがコンピューター上のローカルファイル、デスクトップアプリ、コマンドラインツール、プライベートリソースにアクセスする必要がある場合に最適です。

TypingMindでSchwab MCP MCPのどのようなツールを利用できますか?

Schwab MCPはMCP機能を提供しています。TypingMindのプラグインページで有効にすると、チャットで使用したり、AIエージェントに割り当てたりできます。

Schwab MCP MCPを使うには、APIキーをTypingMindと共有する必要がありますか?

いいえ。TypingMindはローカルファーストの設計で、モデルプロバイダー、APIキー、プロンプト、MCP設定をご自身で管理できます。Schwab MCPで認証が必要な場合は、接続の作成時に、そのMCPサーバーに必要なヘッダー、OAuth設定、またはローカル設定を追加してください。

関連するMCPサーバー

すべて見る

今すぐ自分専用のAIワークスペースを作成

ニュースレターに登録すると、新機能や今後のプレゼント企画のお知らせが届きます👇