Schwab MCP logo

Schwab MCP

Community
jkoelker

Chat with your portfolio.

Publisherjkoelker
Repositoryschwab-mcp
LanguagePython
Forks
19
Stars
60
Available tools
0
Transport typestdio
Categories
LicenseMIT
Links
  • Connect tools to AI workflows

    Schwab MCP exposes MCP capabilities that can be used by compatible AI clients and agents.

  • 0 available tools

    Browse the callable actions below, including names and descriptions when provided by the server.

  • Ready-to-copy setup

    Use the installation snippets to configure this server in your preferred MCP client.

  • Open source signals

    60 stars and 19 forks from the linked repository.

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.

Use Schwab MCP MCP with multiple AI models

TypingMind connects MCP tools at the workspace level, so once Schwab MCP is connected, you can use it with different AI models in TypingMind instead of setting it up separately for each model. This MCP runs locally through the TypingMind MCP connector on your device.

Setup guide to use the local connector

Use this when the MCP server needs access to local files, apps, or private resources on your computer.

1

Open the MCP settings

In TypingMind, go to Settings, Advanced Settings, then Model Context Protocol and choose Setup Connector.

  1. Open TypingMind in your browser.
  2. Click the Settings icon.
  3. Go to Advanced Settings.
  4. Open the Model Context Protocol section.
  5. Click Setup Connector and choose This Device.
TypingMind MCP connector setup screen with This Device selected
2

Run the connector command

Choose This Device, copy the command from TypingMind, and run it in Terminal. Keep the process running while you use MCP.

  1. Copy the setup command shown by TypingMind.
  2. Open Terminal on macOS or Windows Terminal on Windows.
  3. Paste and run the command.
  4. Approve the package install if Terminal asks you to proceed.
  5. Keep the Terminal window running while using MCP tools.
3

Add Schwab MCP as a server

When the connector status is Ready, click Edit Servers and paste the MCP server configuration.

  1. Wait until the connector status shows Ready.
  2. Click Edit Servers.
  3. Paste the Schwab MCP MCP server configuration.
  4. Save the server list.
  5. Refresh if you want to confirm the connector is still ready.
TypingMind MCP settings showing active server and Edit Servers button
{
  "mcpServers": {
    "schwab-mcp": {
      "command": "npx",
      "args": [
        "-y",
        "<mcp-server-package>"
      ]
    }
  }
}
4

Use it across models

Save the server list, open Plugins, enable the Schwab MCP MCP tools, then select any supported AI model in TypingMind and use the tools in chat or assign them to an AI agent.

  1. Open the Plugins page in TypingMind.
  2. Enable the Schwab MCP MCP tools.
  3. Start a chat and choose the AI model you want to use.
  4. Use the MCP tools in chat or assign them to an AI agent.
  5. Switch to another AI model whenever needed without reconnecting MCP.
TypingMind chat using enabled MCP tools with a selected AI model
Can you use Schwab MCP to help me with this task?
Schwab MCP
Sure. I read it.
Here is what I found using Schwab MCP.

Frequently asked questions

What is the Schwab MCP MCP server used for?

Schwab MCP is an MCP server that lets compatible AI clients connect to external tools and context. In TypingMind, you can add this MCP server once and make its tools available in your AI workspace.

Can I use Schwab MCP MCP with multiple AI models in TypingMind?

Yes. TypingMind connects MCP tools at the workspace level, so you can use Schwab MCP with different AI models such as Claude, ChatGPT, Gemini, or other models you have configured in TypingMind without setting up the MCP server separately for each model.

Why use Schwab MCP MCP with TypingMind?

TypingMind is one of the best frontends for LLM chat because it brings multiple AI models, prompts, plugins, AI agents, API keys, and MCP tools into one workspace. With Schwab MCP connected, you can use its MCP tools across your preferred models while keeping your chat workflow organized in TypingMind.

How do I connect Schwab MCP MCP to TypingMind?

Schwab MCP runs through the TypingMind local MCP connector. This is best when the MCP server needs access to local files, desktop apps, command-line tools, or private resources on your computer.

What tools does Schwab MCP MCP provide in TypingMind?

Schwab MCP exposes MCP capabilities that can be enabled from the TypingMind Plugins page and used in chat or assigned to AI agents.

Do I need to share my API keys with TypingMind to use Schwab MCP MCP?

No. TypingMind is local-first and lets you keep your model providers, API keys, prompts, and MCP configuration under your control. If Schwab MCP requires authentication, add the required headers, OAuth settings, or local configuration for that MCP server when you create the connection.

Related MCP Servers

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇