home / mcp / schwab mcp server
Provides access to Schwab portfolio data, quotes, options, price history, and account information via a read-only MCP interface.
Configuration
View docs{
"mcpServers": {
"acidsolution-schwab-mcp-server": {
"command": "python",
"args": [
"-m",
"schwab_mcp.server"
],
"env": {
"LOG_LEVEL": "INFO",
"PYTHONPATH": "/path/to/schwab-mcp-server/src",
"SCHWAB_CLIENT_ID": "your_app_key_here",
"SCHWAB_TOKEN_PATH": "/path/to/.schwab-mcp/token.json",
"SCHWAB_CALLBACK_URL": "https://127.0.0.1:8182/callback",
"SCHWAB_CLIENT_SECRET": "your_app_secret_here"
}
}
}
}You can access Schwab account data and market information through a read-only MCP server that exposes endpoints for portfolio data, real-time quotes, options data, price history, and account information. This enables AI assistants to securely retrieve your Schwab data for analysis and insights without performing any trades or modifications.
You connect your MCP client to the Schwab MCP server using a local subprocess that runs the server Python module. Start the server with the provided command, then ask your AI assistant questions like “What are my current positions?” or “Show me the real-time quote for AAPL.” You can request detailed data such as cost basis, market value, and options Greeks, or historical price history for technical analysis.
Prerequisites: Python 3.10 or higher. A Schwab Developer account with a client key, secret, a valid refresh token, and a configured callback URL.
1. Create a Python virtual environment and activate it. 2. Install the MCP server package in editable mode.
Store credentials and tokens in a token file and reference them via environment variables when starting the server. The server is strictly read-only, ensuring no trading or account modification operations are possible.
Test the server locally to verify authentication and data access. Exercise can include loading the token from the configured path and requesting basic data like account info or quotes.
Use MCP Inspector to verify the server is reachable and responding. You can also perform a manual check by loading the token from the configured path and ensuring the token can be refreshed as needed.
If token refresh fails, ensure the refresh token is valid and the client ID/secret are correct. If the server won’t start, confirm Python 3.10+ is installed and dependencies are installed. If no data is returned, check permissions on your Schwab account and that markets are open.
Environment variables carry sensitive values. Do not hardcode credentials in code. Use the provided token file to load client_id, client_secret, and refresh_token, and override via environment variables if necessary.
The server provides the following capabilities:
Retrieve account information including type and balances.
Get all positions with cost basis and market value.
Get a real-time quote for a single symbol.
Get real-time quotes for multiple symbols.
Get options chain data with Greeks for a symbol.
Retrieve historical OHLCV price data for analysis.