Skip to main content
Glama
tastytrade-mcp

tastytrade-mcp

by bholzer

tastytrade-mcp

MCP server for the tastytrade brokerage API, built in TypeScript on the official @tastytrade/api SDK. Runs over stdio.

This is a rebuild of the earlier Python tastytrade_mcp server with a deliberately leaner surface: single-tenant, env-var auth, no database, and only tools backed by real API endpoints.

Setup

No clone, no build — npx installs straight from this repo and compiles automatically on first run. You need Node 20+ and SSH access to this GitHub repo (the same git@github.com key you use for pushing).

  1. Create an OAuth client and a personal-grant refresh token at my.tastytrade.com → Manage → API Access. You need the client secret and the refresh token (access tokens are generated and refreshed automatically).

  2. Put the secrets in your environment (shell profile, or a gitignored .env loaded by direnv — never in a file you commit):

    export TASTYTRADE_CLIENT_SECRET="..."
    export TASTYTRADE_REFRESH_TOKEN="..."
  3. Register with your MCP client.

    Project .mcp.json (Claude Code) — safe to commit. .mcp.json supports ${VAR} environment-variable expansion, so the file holds only references; values are read from the environment Claude Code was launched in. If a variable is missing, the config fails to load rather than silently sending an empty secret:

    {
      "mcpServers": {
        "tastytrade": {
          "command": "npx",
          "args": ["-y", "git+ssh://git@github.com/bholzer/tastytrade-mcp.git"],
          "env": {
            "TASTYTRADE_CLIENT_SECRET": "${TASTYTRADE_CLIENT_SECRET}",
            "TASTYTRADE_REFRESH_TOKEN": "${TASTYTRADE_REFRESH_TOKEN}",
            "TASTYTRADE_ENVIRONMENT": "${TASTYTRADE_ENVIRONMENT:-production}"
          }
        }
      }
    }

    ⚠️ Don't use claude mcp add --scope project --env TASTYTRADE_CLIENT_SECRET=... — that writes the literal secret value into .mcp.json, which is exactly the file that gets committed. Write the ${VAR} form by hand as above.

    One-liner (Claude Code, user scope). claude mcp add defaults to local/user config (~/.claude.json), which never leaves your machine, so passing values directly is acceptable there:

    claude mcp add tastytrade \
      --env TASTYTRADE_CLIENT_SECRET="$TASTYTRADE_CLIENT_SECRET" \
      --env TASTYTRADE_REFRESH_TOKEN="$TASTYTRADE_REFRESH_TOKEN" \
      -- npx -y git+ssh://git@github.com/bholzer/tastytrade-mcp.git

    Claude Desktop. claude_desktop_config.json does not support ${VAR} expansion — you have to paste the values in. That file is local-only (not committed), but be aware the secrets sit in plaintext on disk.

    The first launch takes ~30s while npm clones and compiles; after that it starts from cache. To pin a specific version, append a tag or commit: ...tastytrade-mcp.git#v1.0.0.

Updating

npx caches the install. To pick up new commits:

npx clear-npx-cache    # then the next launch re-installs from HEAD

(Or pin to tags and bump the tag in your config.)

Running from a local checkout (development)

claude mcp add tastytrade \
  --env TASTYTRADE_CLIENT_SECRET="$TASTYTRADE_CLIENT_SECRET" \
  --env TASTYTRADE_REFRESH_TOKEN="$TASTYTRADE_REFRESH_TOKEN" \
  -- node /path/to/tastytrade-mcp/dist/index.js

Environment variables

Variable

Required

Description

TASTYTRADE_CLIENT_SECRET

yes

OAuth client secret

TASTYTRADE_REFRESH_TOKEN

yes

OAuth personal-grant refresh token

TASTYTRADE_ENVIRONMENT

no

production (default) or sandbox (cert environment)

TASTYTRADE_SCOPES

no

OAuth scopes, default read trade

Related MCP server: ib-async-mcp

Tools (18)

System

  • health_check — verify credentials, report environment and customer.

Accounts & portfolio

  • get_accounts — list accounts.

  • get_balances — cash, net liq, buying power, margin usage.

  • get_positions — open positions, filterable by symbol/underlying, optional marks.

  • get_transactions — transaction history with date/symbol/type filters and paging.

  • get_net_liq_history — historical net liquidating value (1d–all).

  • get_margin_requirements — margin/buying-power requirements report.

Market data

  • search_symbols — symbol search.

  • get_instrument — full instrument definition (tick size, streamer symbol, …) for equities, options, futures, future options, crypto.

  • get_market_metrics — IV rank/percentile, liquidity, beta, earnings/dividend dates.

  • get_option_chain — nested option chain with expiration/DTE/strike/type filters; returns an expiration summary when unfiltered to keep responses small.

  • get_quotes — live bid/ask, last trade, OHLC summary, and Greeks (for options) via the dxLink websocket streamer. Accepts equity, OCC option, futures, and future-option symbols.

Trading

  • create_order — 1–4 leg orders for any instrument type. Dry-run by default: returns the preview (buying-power effect, fees, warnings) without placing anything; requires explicit dry_run: false to submit.

  • list_orders — order history or live working orders.

  • get_order — single order status.

  • cancel_order — cancel one order.

  • replace_order — modify price/type/TIF of a working order.

  • cancel_all_orders — cancel every working order in an account (optionally one underlying).

Differences from the Python server

  • OAuth only (the v7 JS SDK no longer supports session login as a client config). Sandbox use requires a cert-environment OAuth client instead of sandbox username/password.

  • Dropped: multi-user database mode, encrypted token storage, shortcuts, and tools that had stub/fake implementations (fake streaming endpoints, correlation analysis, opportunity scanning). The persistent "emergency state" machinery is replaced by the real cancel_all_orders action.

  • set_stop_loss / set_take_profit are expressible through create_order (order_type: "Stop" / "Limit" with closing legs).

Development

npm run watch   # incremental compile
npm start       # run the built server

Available Tools

18 tools
cancel_all_ordersCancel all ordersA

Emergency: cancel ALL working orders for an account, optionally limited to one underlying symbol. Fetches live orders and cancels every cancellable one.

Inputs: account_number (required), underlying_symbol.

cancel_orderCancel orderB

Cancel a single working order by id.

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

create_orderCreate orderA

Create an order with 1-4 legs (equity, options, futures, crypto). By default this is a DRY RUN that returns the order preview with buying-power effect, fees, and warnings WITHOUT placing it. Set dry_run=false to actually submit the order. Always dry-run first and confirm with the user before submitting a live order.

Inputs: account_number (required), legs (required), order_type, time_in_force, +7 more.

get_accountsGet accountsA

List all tastytrade accounts for the authenticated customer.

Inputs: no named parameters.

get_balancesGet account balancesA

Get current balances for an account: cash, net liquidating value, buying power, margin usage, etc.

Inputs: account_number (required).

get_instrumentGet instrument detailsA

Get full instrument definition (tick size, streamer symbol, expiration, multiplier, etc.) for a symbol. Equity option symbols use OCC format, e.g. 'AAPL 240621C00190000'. Futures start with '/', future options with './'.

Inputs: symbol (required), instrument_type (required).

get_margin_requirementsGet margin requirementsA

Get the current margin/buying-power requirements report for an account.

Inputs: account_number (required).

get_market_metricsGet market metricsA

Get volatility metrics for symbols: IV rank, IV percentile, implied volatility, liquidity rating, beta, earnings dates, dividend info.

Inputs: symbols (required).

get_net_liq_historyGet net liquidating value historyB

Get historical net liquidating value for an account over a time period.

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

get_option_chainGet option chainA

Get the option chain for an underlying symbol. With no filters, returns a summary of available expirations only. Provide expiration or a DTE range to get strikes. Strike filters narrow the result further. Returned option symbols can be used as order legs and quote symbols.

Inputs: symbol (required), expiration, dte_min, dte_max, +3 more.

get_orderGet orderA

Get the current state of a single order by id.

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

get_positionsGet positionsB

List all open positions for an account, optionally filtered by symbol or underlying.

Inputs: account_number (required), underlying_symbol, symbol, include_marks.

get_quotesGet live quotesA

Get a live market data snapshot for one or more symbols via the dxLink streamer: bid/ask (Quote), last trade price and volume (Trade), OHLC and prior close (Summary), and Greeks for options. Accepts equity tickers (AAPL), OCC option symbols (AAPL 240621C00190000), futures (/ESM4), future options (./ESM4 EW3M4 240621C5300), and dxfeed streamer symbols directly.

Inputs: symbols (required), timeout_seconds.

get_transactionsGet transaction historyB

Get transaction history for an account (trades, money movements, fees).

Inputs: account_number (required), start_date, end_date, underlying_symbol, +3 more.

health_checkHealth checkA

Verify the server's tastytrade API credentials and report which environment is in use.

Inputs: no named parameters.

list_ordersList ordersA

List orders for an account. Use live_only for today's working orders.

Inputs: account_number (required), live_only, status, underlying_symbol, +3 more.

replace_orderReplace orderA

Modify a working order's price, type, or time in force. Only the provided fields change; legs cannot be modified (cancel and re-create instead).

Inputs: account_number (required), order_id (required), price, price_effect, +3 more.

search_symbolsSearch symbolsA

Search for tradeable symbols by ticker or partial ticker, e.g. 'AAP' matches AAPL.

Inputs: query (required).

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    A4/5.0

    Scored across 18 tools

    Disambiguation5/5

    All tools target distinct areas: account management, orders, positions, instruments, market data, and health. No overlap; each has a clear and unique purpose.

    Naming Consistency5/5

    All tool names follow a consistent verb_noun pattern in lowercase snake_case (e.g., get_accounts, create_order, cancel_all_orders). Only health_check is slightly different but still follows a common pattern.

    Tool Count5/5

    18 tools is well-scoped for a trading platform, covering account info, order lifecycle, positions, instruments, market data, and health. Each tool earns its place without excess.

    Completeness5/5

    Provides full lifecycle for orders (create, cancel, replace, list, get) plus account balances, positions, instruments, market metrics, and transactions. No obvious gaps for typical trading workflows.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      C
      quality
      D
      maintenance
      An MCP server that provides an interface for the Interactive Brokers API via the ib_async library. It enables users to manage accounts, access real-time and historical market data, and execute or monitor trades through TWS or IB Gateway.
      33
      1
      -
    • A
      license
      B
      quality
      D
      maintenance
      MCP server for Interactive Brokers API, enabling account management, trading, market data, options, scanners, and news via natural language.
      33
      3
      MIT
    • A
      license
      Not graded
      quality
      D
      maintenance
      An MCP server for Interactive Brokers, enabling account management, trading operations, and market data queries.
      8
      MIT