Schwab MCP server

Bridges Claude with Schwab API for accessing financial account information, stock quotes, and transaction history through OAuth authentication and nine specialized tools for retrieving financial data.
Back to servers
Setup instructions
Provider
Jason Kölker
Release date
Mar 21, 2025
Language
Python
Stats
10 stars

This server implements the Model Context Protocol (MCP) for the Schwab API, allowing you to access trading account information, market data, and transaction capabilities through a standardized interface. It's designed to integrate with Large Language Models (LLMs) while providing secure access to your Schwab trading account.

Installation

Install the MCP server and all dependencies:

# Install with all dependencies
uv add -e .

Authentication

Before using the server, you need to authenticate with the Schwab API:

# Authenticate and generate a token
uv run schwab-mcp auth --client-id YOUR_CLIENT_ID --client-secret YOUR_CLIENT_SECRET --callback-url YOUR_CALLBACK_URL

You can set these credentials through environment variables:

By default, the authentication token is saved to ~/.local/share/schwab-mcp/token.yaml. You can specify a different path:

uv run schwab-mcp auth --token-path /path/to/token.yaml

Both YAML and JSON token formats are supported and will be inferred from the file extension.

Running the Server

After authentication, start the MCP server:

# Run the server with default token path
uv run schwab-mcp server --client-id YOUR_CLIENT_ID --client-secret YOUR_CLIENT_SECRET --callback-url YOUR_CALLBACK_URL

# Run with a custom token path
uv run schwab-mcp server --token-path /path/to/token.json --client-id YOUR_CLIENT_ID --client-secret YOUR_CLIENT_SECRET --callback-url YOUR_CALLBACK_URL

Token age is validated - if older than 5 days, you will be prompted to re-authenticate.

Account Modification Capabilities

To enable account modification tools:

# Run with account modification tools enabled
uv run schwab-mcp server --jesus-take-the-wheel --client-id YOUR_CLIENT_ID --client-secret YOUR_CLIENT_SECRET --callback-url YOUR_CALLBACK_URL

WARNING: Using the --jesus-take-the-wheel flag enables tools that can modify your account state, allowing LLMs to cancel orders and potentially perform other actions that change account state. Use with caution.

Available Tools

The server exposes numerous MCP tools organized by category:

Date and Market Information

  • get_datetime: Get the current datetime in ISO format
  • get_market_hours: Get market hours for a specific market
  • get_movers: Get movers for a specific index
  • get_instruments: Search for instruments with a specific symbol

Account Information

  • get_account_numbers: Get mapping of account IDs to account hashes
  • get_accounts: Get information for all linked Schwab accounts
  • get_accounts_with_positions: Get accounts with position information
  • get_account: Get information for a specific account
  • get_account_with_positions: Get specific account with position information
  • get_user_preferences: Get user preferences for all accounts including nicknames

Orders

  • get_order: Get details for a specific order
  • get_orders: Get orders for a specific account

Quotes and Price History

  • get_quotes: Get quotes for specified symbols
  • get_price_history_every_minute: Get price history with minute frequency
  • get_price_history_every_five_minutes: Get price history with five minute frequency
  • get_price_history_every_day: Get price history with daily frequency
  • get_advanced_price_history: Get advanced price history for a specific symbol
  • Various other timeframe options are available (10m, 15m, 30m, weekly)

Options

  • get_option_chain: Get option chain for a specific symbol
  • get_advanced_option_chain: Get advanced option chain for a specific symbol
  • get_option_expiration_chain: Get option expiration information for a symbol

Transactions

  • get_transactions: Get transactions for a specific account
  • get_transaction: Get details for a specific transaction

Account Modification Tools (Requires --jesus-take-the-wheel flag)

  • cancel_order: Cancel a specific order

How to install this MCP server

For Claude Code

To add this MCP server to Claude Code, run this command in your terminal:

claude mcp add-json "schwab" '{"command":"uv","args":["run","schwab-mcp","server"]}'

See the official Claude Code MCP documentation for more details.

For Cursor

There are two ways to add an MCP server to Cursor. The most common way is to add the server globally in the ~/.cursor/mcp.json file so that it is available in all of your projects.

If you only need the server in a single project, you can add it to the project instead by creating or adding it to the .cursor/mcp.json file.

Adding an MCP server to Cursor globally

To add a global MCP server go to Cursor Settings > Tools & Integrations and click "New MCP Server".

When you click that button the ~/.cursor/mcp.json file will be opened and you can add your server like this:

{
    "mcpServers": {
        "schwab": {
            "command": "uv",
            "args": [
                "run",
                "schwab-mcp",
                "server"
            ]
        }
    }
}

Adding an MCP server to a project

To add an MCP server to a project you can create a new .cursor/mcp.json file or add it to the existing one. This will look exactly the same as the global MCP server example above.

How to use the MCP server

Once the server is installed, you might need to head back to Settings > MCP and click the refresh button.

The Cursor agent will then be able to see the available tools the added MCP server has available and will call them when it needs to.

You can also explicitly ask the agent to use the tool by mentioning the tool name and describing what the function does.

For Claude Desktop

To add this MCP server to Claude Desktop:

1. Find your configuration file:

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
  • Windows: %APPDATA%\Claude\claude_desktop_config.json
  • Linux: ~/.config/Claude/claude_desktop_config.json

2. Add this to your configuration file:

{
    "mcpServers": {
        "schwab": {
            "command": "uv",
            "args": [
                "run",
                "schwab-mcp",
                "server"
            ]
        }
    }
}

3. Restart Claude Desktop for the changes to take effect

Want to 10x your AI skills?

Get a free account and learn to code + market your apps using AI (with or without vibes!).

Nah, maybe later