References GitHub repositories for dependencies including schwab-py and the MCP python-sdk.
Integrated with pytest for testing the server functionality and API interactions.
Built using Python and integrates with Python SDK for the Model Context Protocol.
Used for code formatting and linting during development of the server.
Supports token storage in YAML format (default), allowing credentials and authentication data to be saved and retrieved in YAML files.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Schwab Model Context Protocol Servershow me my current portfolio positions"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
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.
Related MCP server: ShipBob API MCP Server
Quick Start
Prerequisites
Python 3.10 or higher
uv (recommended) or
pipA Schwab Developer App Key and Secret (from the Schwab Developer Portal)
Installation
For most users, installing via uv tool or pip is easiest:
Authentication
Before running the server, you must authenticate with Schwab to generate a token file.
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.
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.
Flag | Env Variable | Description |
|
| Required. Schwab App Key. |
|
| Required. Schwab App Secret. |
|
| Redirect URL (default: |
| N/A | Path to save/load token (default: |
| N/A | DANGER. Bypasses Discord approval for trades. |
| N/A | Disables technical analysis tools (SMA, RSI, etc.). |
| N/A | Returns raw JSON instead of formatted text (useful for some agents). |
Container Usage
A Docker/Podman image is available at ghcr.io/jkoelker/schwab-mcp.
Available Tools
The server provides a rich set of tools for LLMs.
📊 Market Data
Tool | Description |
| Real-time quotes for symbols. |
| Market open/close times. |
| Top gainers/losers for an index. |
| Standard option chain data. |
| Historical candles (minute, day, week). |
💼 Account Info
Tool | Description |
| List linked accounts. |
| Detailed positions and balances. |
| History of trades and transfers. |
| Status of open and filled orders. |
💸 Trading (Requires Approval)
Tool | Description |
| Buy/Sell stocks and ETFs. |
| Buy/Sell option contracts. |
| Entry + Take Profit + Stop Loss. |
| Cancel an open order. |
(See full tool list in
Development
To contribute to this project:
License
MIT License.