Charles Schwab MCP server

Access Charles Schwab accounts, trading data, and real-time market information.
Back to servers
Provider
Daniel Yeoman
Release date
Jun 02, 2025

The Schwab MCP Server is a bridge that allows AI assistants like Claude to securely interact with Charles Schwab accounts and market data through the official Schwab API. It enables you to check balances, get real-time quotes, view market movers, access options chains, retrieve transaction history, and more.

Installation

Prerequisites

Before setting up the Schwab MCP Server, you'll need:

  1. A Schwab Developer Account from the Schwab Developer Portal
  2. A Cloudflare Account with a paid plan (required for Durable Objects)
  3. Node.js version 22.x or higher
  4. Wrangler CLI (included in dev dependencies)

Quick Setup

git clone <repository-url>
cd schwab-mcp
npm install

# Authenticate with Cloudflare (first time only)
npx wrangler login

# Create KV namespace for OAuth token storage
npx wrangler kv:namespace create "OAUTH_KV"
# Note the ID from the output - you'll need it for configuration

# Set up your personal configuration
cp wrangler.example.jsonc wrangler.jsonc
# Edit wrangler.jsonc to:
# 1. Replace YOUR_KV_NAMESPACE_ID_HERE with the ID from above
# 2. Change the name to something unique (e.g., "schwab-mcp-yourname")

# Set your secrets
npx wrangler secret put SCHWAB_CLIENT_ID      # Your Schwab App Key
npx wrangler secret put SCHWAB_CLIENT_SECRET  # Your Schwab App Secret
npx wrangler secret put SCHWAB_REDIRECT_URI   # https://your-worker-name.workers.dev/callback
npx wrangler secret put COOKIE_ENCRYPTION_KEY # Generate with: openssl rand -hex 32

# Deploy
npm run deploy

Detailed Setup

1. Create a Schwab App

  1. Log in to the Schwab Developer Portal
  2. Create a new app with:
    • App Name: Your MCP server name
    • Callback URL: https://schwab-mcp.<your-subdomain>.workers.dev/callback
    • App Type: Personal or third-party based on your use case
  3. Note your App Key (Client ID) and generate an App Secret

2. Set Environment Variables

Use the same secrets from Quick Setup (see above).

Testing Your Deployment

You can test your deployment using the MCP Inspector:

npx @modelcontextprotocol/inspector@latest

Enter https://schwab-mcp.<your-subdomain>.workers.dev/sse and connect. You'll be prompted to authenticate with Schwab.

Usage

Connecting with Claude Desktop

Option 1: Using Claude Integrations

  1. Open Claude Desktop settings
  2. Go to the "Integrations" tab
  3. Click on "Add Custom Integration"
  4. Enter "Schwab" as the integration name
  5. Set the MCP Server URL: https://schwab-mcp.<your-subdomain>.workers.dev/sse
  6. Click "Add" and then "Connect" to start the Schwab Authentication flow

Option 2: Add to Claude Desktop Configuration

Add the following to your Claude Desktop configuration file:

{
	"mcpServers": {
		"schwab": {
			"command": "npx",
			"args": [
				"mcp-remote",
				"https://schwab-mcp.<your-subdomain>.workers.dev/sse"
			]
		}
	}
}

Restart Claude Desktop. When you first use a Schwab tool, a browser window will open for authentication.

Example Commands

Once connected, you can ask Claude to:

  • "Show me my Schwab account balances"
  • "Get a quote for AAPL"
  • "What are today's market movers in the $SPX?"
  • "Show me the options chain for TSLA"
  • "Get my recent transactions from the last week"
  • "Search for ETFs related to technology"
  • "Check if the markets are open"

Available Features

Trading Tools

  • Account Management
    • Get accounts with positions and balances
    • Retrieve account identifiers
  • Order Management
    • View order details
    • Fetch orders with filtering
    • Cancel, place, or replace orders (experimental)
  • Market Quotes
    • Get real-time quotes for multiple symbols
    • Get detailed quotes for individual symbols
  • Transaction History
    • View transaction history with date filtering
  • User Preferences
    • Access trading preferences and settings

Market Data Tools

  • Instrument Search
    • Search securities by symbol
  • Price History
    • Get historical price data with customizable parameters
  • Market Hours
    • Check market operating hours
  • Market Movers
    • Find top market movers by index
  • Options Chains
    • Access full options chain data with Greeks
    • Get option expiration dates

Troubleshooting

Common Issues

  1. "KV namespace not found" error

    • Ensure you created the KV namespace and updated wrangler.jsonc
    • Verify with npx wrangler kv:namespace list
  2. Authentication failures

    • Verify your redirect URI matches exactly in Schwab app settings
    • Check that all secrets are set correctly with npx wrangler secret list
    • Enable debug logging to see detailed OAuth flow
  3. "Durable Objects not available" error

    • Ensure you have a paid Cloudflare Workers plan
    • Durable Objects are not available on the free tier
  4. Token refresh issues

    • The server automatically refreshes tokens 5 minutes before expiration
    • Check KV namespace for stored tokens with: npx wrangler kv:key list --namespace-id=<your-id>

Local Development

For local development, create a .dev.vars file:

SCHWAB_CLIENT_ID=your_development_app_key
SCHWAB_CLIENT_SECRET=your_development_app_secret
SCHWAB_REDIRECT_URI=http://localhost:8788/callback
COOKIE_ENCRYPTION_KEY=your_random_key_here
LOG_LEVEL=DEBUG  # Optional: Enable debug logging

Then run:

npm run dev

The server will be available at http://localhost:8788. Connect to http://localhost:8788/sse using the MCP Inspector for testing.

How to add this MCP server to 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 > MCP and click "Add new global MCP server".

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

{
    "mcpServers": {
        "cursor-rules-mcp": {
            "command": "npx",
            "args": [
                "-y",
                "cursor-rules-mcp"
            ]
        }
    }
}

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 explictly ask the agent to use the tool by mentioning the tool name and describing what the function does.

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