Skip to main content

MCP server for the Tastytrade Open API

Project description

new-tasty-trade-mcp

An MCP server exposing the Tastytrade Open API to an LLM host (Claude Code, Claude Desktop, Cursor, …). Read-only account & market-data tools plus guarded live-trading tools (two-phase orders, size caps, audit log).

Published on PyPI — run it anywhere with uvx; no clone or local venv required. (The Python import name is tastytrade_mcp.)

Requirements

  • Python 3.10+
  • A Tastytrade OAuth app with a refresh token and client secret. Create it at my.tastytrade.com → Manage → My Profile → API → OAuth Applications, and select the read and trade scopes when creating the client/grant (without them the API returns 403 insufficient scopes).

Register with Claude Code

uvx fetches the package on demand, so there's nothing to install up front:

claude mcp add tastytrade \
  -e TASTY_ACCOUNT_NUMBER=... \
  -e TASTY_CLIENT_ID=... \
  -e TASTY_CLIENT_SECRET=... \
  -e TASTY_REFRESH_TOKEN=... \
  -- uvx new-tasty-trade-mcp

Restart Claude Code and the tools appear.

Other MCP clients (Claude Desktop, Cursor, Cline, …)

Add this to your mcpServers config (same shape across clients):

{
  "mcpServers": {
    "tastytrade": {
      "command": "uvx",
      "args": ["new-tasty-trade-mcp"],
      "env": {
        "TASTY_ACCOUNT_NUMBER": "...",
        "TASTY_CLIENT_ID": "...",
        "TASTY_CLIENT_SECRET": "...",
        "TASTY_REFRESH_TOKEN": "..."
      }
    }
  }
}

Optional env overrides:

  • TASTY_MAX_ORDER_NOTIONAL_USD — reject orders above this notional (Limit orders only).
  • TASTY_MAX_QUANTITY — reject orders above this total leg quantity.
  • TASTY_LOG_FILE — audit-log path (default tastytrade-mcp-trades.log in the working directory). Set an absolute path to place it elsewhere.

Tools

Account (read): get_accounts, get_account, get_balances, get_positions, get_orders, get_order, get_transactions, get_trading_status, get_nlv_history.

Market (read): get_quote, get_option_chain, get_market_metrics, search_symbols, get_equity.

Trading (guarded): dry_run_order, place_order (two-phase: execute=false previews, execute=true submits after the size-cap check), modify_order, cancel_order.

Trading guardrails

  • Two-phase: place_order always dry-runs first; it submits only when execute=true.
  • Size caps: TASTY_MAX_QUANTITY and TASTY_MAX_ORDER_NOTIONAL_USD; orders over a cap are rejected before submission. Leave unset for no cap.
  • Audit log: every place/modify/cancel (success or failure) and every dry-run appends a JSON line to TASTY_LOG_FILE.

Run directly (stdio)

uvx new-tasty-trade-mcp          # from anywhere
# or, installed in a venv:
python -m tastytrade_mcp

Development

Editable install from a clone (includes pytest, build, twine):

venv/bin/pip install -e 'mcp/tastytrade[dev]'

Common tasks via the Makefile (run from mcp/tastytrade/, or make -C mcp/tastytrade … from the repo root):

make test       # run the suite (httpx.MockTransport — no network, no live account)
make build      # clean -> test -> build wheel + sdist into dist/
make publish    # build -> twine upload (uses ~/.pypirc)
make install    # editable install with dev extras
make clean      # remove build/ and dist/

Re-publishing: bump version in pyproject.toml, then make publish (PyPI won't accept the same version twice).

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

new_tasty_trade_mcp-0.1.2.tar.gz (13.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

new_tasty_trade_mcp-0.1.2-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

Details for the file new_tasty_trade_mcp-0.1.2.tar.gz.

File metadata

  • Download URL: new_tasty_trade_mcp-0.1.2.tar.gz
  • Upload date:
  • Size: 13.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.10.14

File hashes

Hashes for new_tasty_trade_mcp-0.1.2.tar.gz
Algorithm Hash digest
SHA256 da03ebe40b16385a53f867fe8ab2d9b0a2c2b05b1a608c958271fe650ee46ff6
MD5 ba6d16636fb72eb8684ab35ea358761d
BLAKE2b-256 6063cff8d50f9de9633ff84dfaf7a955fc6e91c1ee96deccb31ce9b3c8c1cc0b

See more details on using hashes here.

File details

Details for the file new_tasty_trade_mcp-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for new_tasty_trade_mcp-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 d0f0244ab7a38e1d13eb593a6ce67d5e3b5800c157de31114cda1091313bef4c
MD5 f98c972c031cd55d69846ebb3cf7e12e
BLAKE2b-256 a8fc37c6ddf8ca29884ef67e1039ec573fb5555cc0993c18cad171a7a545029d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page