Skip to main content
Glama
mcp-tastytrade-server

mcp-tastytrade-server

by morsingnet

mcp-tastytrade-server

An MCP server that exposes the TastyTrade brokerage API as tools for Claude and other MCP-compatible clients.

Features

Tool

Description

get_accounts

List all accounts

get_positions

Open positions for an account

get_balances

Balances and buying power

get_orders

Orders (filterable by status)

dry_run_order

Validate an order — fees, BP impact, warnings

place_order

Place a live order

cancel_order

Cancel a live order

get_option_chain

Option chain (nested by expiry or compact flat list)

get_market_metrics

IV rank, IV percentile, 30-day IV, liquidity

get_transactions

Transaction history

search_equities

Search equity instruments by symbol

get_watchlists

Customer watchlists

Related MCP server: TastyTrade MCP Server

Setup

1. Install dependencies

pip install -e .
# or with uv:
uv pip install -e .

2. OAuth2 setup

This server authenticates with OAuth2 — a scoped, revocable refresh token — instead of your TastyTrade account password. Your actual login credentials are never entered anywhere in this project.

  1. Go to my.tastytrade.com → Manage → My Profile → API → OAuth Applications.

  2. Click + New OAuth Client, give it any name, and set a redirect URI (e.g. http://localhost) — it's required but unused by the personal-grant flow below.

  3. Save the app, then note the Client Secret shown (it's only displayed once).

  4. Click Manage on the new app → Create Grant to issue yourself a Personal Grant. Copy the Refresh Token shown (also only displayed once).

  5. Copy the env template and fill in those two values:

cp .env.example .env

Variable

Required

Description

TASTYTRADE_CLIENT_SECRET

Yes

Client secret from the OAuth application

TASTYTRADE_REFRESH_TOKEN

Yes

Refresh token from the personal grant

TASTYTRADE_SANDBOX

No

Set to true to use the certification environment (default: false)

The refresh token doesn't expire on its own — if you ever want to cut off access, revoke the grant at my.tastytrade.com and generate a new one, no password change required.

3. Test the connection

python scripts/smoke_test.py

This runs every read-only tool (get_accounts, get_balances, get_positions, get_orders, search_equities, get_market_metrics, get_option_chain, get_watchlists) through the same list_tools()/call_tool() interface a real MCP client uses, and prints PASS/FAIL for each. It never places or cancels orders. Requires .env to be filled in (step 2).

4. Configure Claude Desktop

Add the following to your Claude Desktop config (~/Library/Application Support/Claude/claude_desktop_config.json on macOS):

{
  "mcpServers": {
    "tastytrade": {
      "command": "mcp-tastytrade",
      "env": {
        "TASTYTRADE_CLIENT_SECRET": "your_client_secret",
        "TASTYTRADE_REFRESH_TOKEN": "your_refresh_token"
      }
    }
  }
}

Or using uv run without installing:

{
  "mcpServers": {
    "tastytrade": {
      "command": "uv",
      "args": ["run", "--directory", "/absolute/path/to/mcp-tastytrade-server", "mcp-tastytrade"],
      "env": {
        "TASTYTRADE_CLIENT_SECRET": "your_client_secret",
        "TASTYTRADE_REFRESH_TOKEN": "your_refresh_token"
      }
    }
  }
}

Option symbol format

Options use the OCC 21-character format: SYMBOL YYMMDDCPRICE

Examples:

  • AAPL 241220C00200000 — AAPL $200 call expiring 2024-12-20

  • SPY 241220P00580000 — SPY $580 put expiring 2024-12-20

The get_option_chain tool returns symbols already formatted correctly.

Development

# Run directly
python -m mcp_tastytrade.server

# Or via the installed script
mcp-tastytrade

Security

  • Authentication uses OAuth2 (client secret + refresh token) — your TastyTrade account password is never used or stored anywhere in this project.

  • Credentials are passed via environment variables only.

  • The .env file is in .gitignore and must never be committed.

  • Access tokens are short-lived (~15 minutes), held in memory only, and refreshed automatically.

  • To revoke access at any time, delete the grant at my.tastytrade.com — no password change needed.

  • Use TASTYTRADE_SANDBOX=true for testing — the certification environment uses separate accounts with no real money.

Available Tools

12 tools
cancel_orderC

Cancel a live order on a TastyTrade account.

Inputs: order_id (required), account_number (required).

dry_run_orderA

Validate an order without placing it. Returns buying power effect, fees, and any warnings.

Inputs: legs (required), order_type (required), price_effect (required), time_in_force (required), +2 more.

get_accountsA

List all TastyTrade accounts for the authenticated customer.

Inputs: no named parameters.

get_balancesC

Get current balances and buying power for a TastyTrade account.

Inputs: account_number (required).

get_market_metricsB

Get market metrics for one or more symbols: IV rank, IV percentile, 30-day IV, liquidity rating, and more.

Inputs: symbols (required).

get_option_chainA

Get the option chain for an underlying symbol. Use format='nested' (default) for expirations grouped by date, or format='compact' for a flat list.

Inputs: symbol (required), format.

get_ordersC

Get orders for a TastyTrade account, optionally filtered by status.

Inputs: account_number (required), status.

get_positionsB

Get current open positions for a TastyTrade account.

Inputs: account_number (required).

get_transactionsC

Get transaction history for a TastyTrade account.

Inputs: account_number (required), end_date, per_page, start_date.

get_watchlistsA

Get all watchlists for the authenticated customer.

Inputs: no named parameters.

place_orderB

Place a new order on a TastyTrade account. Use dry_run_order first to validate the order and check buying power impact.

Inputs: legs (required), order_type (required), price_effect (required), time_in_force (required), +2 more.

search_equitiesC

Search for equity instruments by symbol.

Inputs: symbol (required), lendability.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.5/5.0

    Scored across 12 tools

    Disambiguation5/5

    Each tool has a distinct purpose clearly described. get_positions and get_balances are separate, place_order and dry_run_order are complementary but distinct, no overlapping functionality.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern with underscores (e.g., get_accounts, cancel_order, dry_run_order). The verbs vary but are appropriate and predictable.

    Tool Count5/5

    12 tools cover the essential operations for a trading platform without being excessive. Each tool serves a clear need, and the count is within the ideal range.

    Completeness4/5

    Core workflows like account information, order management, and market data are covered. Minor gaps exist, such as no modify order or create watchlist, but agents can work around these with the available tools.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables natural language trading operations for stocks, options, crypto, and portfolio management via Alpaca's Trading API through AI assistants.
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      Connects your TastyTrade trading account to AI assistants like Claude Desktop and ChatGPT for conversational trading and portfolio management.
      5
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables natural-language paper trading with real-time market data, FinBERT sentiment analysis, conditional orders, and price alerts.
      -