tasty-agent

tasty-agent

Model Context Protocol server for TastyTrade portfolio monitoring and trading.

47
Stars
17
Forks
47
Watchers
0
Issues
tasty-agent is a Model Context Protocol (MCP) server designed to enable LLMs to interface with TastyTrade brokerage accounts. It provides functionality for monitoring portfolios, analyzing market positions, and executing trades through a standardized API. The tool offers automated implied volatility (IV) analysis, supports real-time market data streaming, and features robust rate limiting and error handling to ensure reliability. Authentication is handled via OAuth, and the tool is easily configurable for MCP clients.

Key Features

Account balances and buying power retrieval
Portfolio and position monitoring
Real-time quotes and Greeks via streaming
Automated IV rank analysis prompts
Order placement and management with multi-leg strategy support
Transaction and order history retrieval
Watchlist creation and management
OAuth-based authentication
Built-in rate limiting (2 requests/second)
Comprehensive error handling and logging

Use Cases

Monitor and analyze current portfolio positions for a TastyTrade account
Execute and manage brokerage trades programmatically through LLMs
Retrieve historical account transactions and order activities
Generate real-time quotes and options Greeks for research or automation
Perform automated IV rank analysis to identify entry and exit opportunities
Manage watchlists across multiple symbols and trading strategies
Integrate TastyTrade financial workflows into contextual AI applications
Enable dry-run mode for testing order strategies without execution
Monitor market status and trading hours for various exchanges
Streamline authentication and secure access to trading accounts

README

tasty-agent: A TastyTrade MCP Server

Trust Score

A Model Context Protocol server for TastyTrade brokerage accounts. Enables LLMs to monitor portfolios, analyze positions, and execute trades. Features automated IV analysis prompts and built-in rate limiting (2 requests/second) to prevent API errors.

Authentication

OAuth Setup:

  1. Create an OAuth app at https://my.tastytrade.com/app.html#/manage/api-access/oauth-applications
  2. Check all scopes, save your client ID and client secret
  3. Create a "New Personal OAuth Grant" in your OAuth app settings (check all scopes)
  4. Copy the generated refresh token
  5. Configure the MCP server with your credentials (see Usage section below)

MCP Tools

Account & Portfolio

  • get_balances() - Account balances and buying power
  • get_positions() - All open positions with current values
  • get_net_liquidating_value_history(time_back='1y') - Portfolio value history ('1d', '1m', '3m', '6m', '1y', 'all')
  • get_transaction_history(days=90, underlying_symbol=None, transaction_type=None) - All transactions: trades + cash flows (default: last 90 days, transaction_type: 'Trade' or 'Money Movement')
  • get_order_history(days=7, underlying_symbol=None) - Order history including filled, canceled, and rejected orders (default: last 7 days)

Market Data & Research

  • get_quotes(instruments, timeout=10.0) - Real-time quotes for multiple stocks and/or options via DXLink streaming
  • get_greeks(options, timeout=10.0) - Greeks (delta, gamma, theta, vega, rho) for multiple options via DXLink streaming
  • get_market_metrics(symbols) - IV rank, percentile, beta, liquidity for multiple symbols
  • market_status(exchanges=['Equity']) - Market hours and status ('Equity', 'CME', 'CFE', 'Smalls')
  • search_symbols(symbol) - Search for symbols by name/ticker
  • get_current_time_nyc() - Current time in New York timezone (market time)

Order Management

  • get_live_orders() - Currently active orders
  • place_order(legs, price=None, time_in_force='Day', dry_run=False) - Place multi-leg orders with automatic price discovery from market quotes
    • Stock actions: 'Buy', 'Sell'
    • Option actions: 'Buy to Open', 'Buy to Close', 'Sell to Open', 'Sell to Close'
  • replace_order(order_id, price) - Modify existing order price (for complex changes, cancel and place new order)
  • delete_order(order_id) - Cancel orders by ID

Watchlist Management

  • get_watchlists(watchlist_type='private', name=None) - Get watchlists ('public'/'private', all if name=None)
  • manage_private_watchlist(action, symbols, name='main') - Add/remove multiple symbols from private watchlists
  • delete_private_watchlist(name) - Delete private watchlist

MCP Prompts

  • IV Rank Analysis - Automated prompt to analyze IV rank extremes across positions and watchlists for entry/exit opportunities

Key Features

Smart Order Placement

  • Automatic price calculation from real-time market quotes when no price specified
  • Multi-leg options strategies (spreads, strangles, etc.) with single function call
  • Dry-run mode for testing orders without execution

Rate Limiting & Reliability

  • Built-in rate limiting (2 requests/second) prevents API throttling
  • Comprehensive error handling and logging

MCP Client Configuration

Add to your MCP client configuration (e.g., claude_desktop_config.json):

json
{
  "mcpServers": {
    "tastytrade": {
      "command": "uvx",
      "args": ["tasty-agent"],
      "env": {
        "TASTYTRADE_CLIENT_SECRET": "your_client_secret",
        "TASTYTRADE_REFRESH_TOKEN": "your_refresh_token",
        "TASTYTRADE_ACCOUNT_ID": "your_account_id"
      }
    }
  }
}

Examples

"Get my account balances and current positions"
"Get real-time quotes for SPY and AAPL"
"Get quotes for TQQQ C option with strike 100 expiring 2026-01-16"
"Get Greeks for AAPL P option with strike 150 expiring 2024-12-20"
"Buy 100 AAPL shares" (auto-pricing)
"Buy 100 AAPL at $150"
"Buy to open 17 TQQQ calls, strike 100, exp 2026-01-16"
"Place a call spread: buy to open AAPL 150C and sell to open AAPL 155C, both exp 2024-12-20"
"Close my AAPL position: sell to close 10 AAPL calls"
"Modify order 12345 to price $10.05"
"Cancel order 12345"
"Get my trading history from January"
"Get my private watchlists"
"Add TSLA and NVDA to my tech watchlist"
"Remove AAPL from my tech watchlist"

Background Trading Bot

Run automated trading strategies:

bash
# Run once with instructions
uv run background.py "Check my portfolio and rebalance if needed"

# Run every hour
uv run background.py "Monitor SPY and alert on significant moves" --hourly

# Run every day
uv run background.py "Generate daily portfolio summary" --daily

# Custom period (seconds)
uv run background.py "Scan for covered call opportunities" --period 1800  # every 30 minutes

# Schedule start time (NYC timezone)
uv run background.py "Execute morning trading strategy" --schedule "9:30am" --hourly

# Market open shorthand (9:30am)
uv run background.py "Buy the dip strategy" --market-open --hourly

Development

Testing with chat.py

For interactive testing during development:

bash
# Set up environment variables in .env file:
# TASTYTRADE_CLIENT_SECRET=your_secret
# TASTYTRADE_REFRESH_TOKEN=your_token
# TASTYTRADE_ACCOUNT_ID=your_account_id (defaults to the first account)
# OPENAI_API_KEY=your_openai_key (you can provide alternative provider of your choice as supported by pydantic-ai)
# MODEL_IDENTIFIER=model_provider:model_name (defaults to openai:gpt-5-mini)


# Run the interactive client
uv run chat.py

The client provides a chat interface to test MCP tools directly. Example commands:

  • "Get my account balances"
  • "Get quote for SPY"
  • "Place dry-run order: buy 100 AAPL at $150"

Debug with MCP inspector

bash
npx @modelcontextprotocol/inspector uvx tasty-agent

License

MIT

Star History

Star History Chart

Repository Owner

Repository Details

Language Python
Default Branch main
Size 422 KB
Contributors 2
License MIT License
MCP Verified Nov 12, 2025

Programming Languages

Python
100%

Tags

Topics

finance investing options stocks tastytrade trading

Join Our Newsletter

Stay updated with the latest AI tools, news, and offers by subscribing to our weekly newsletter.

We respect your privacy. Unsubscribe at any time.

Related MCPs

Discover similar Model Context Protocol servers

  • Alpaca Trading MCP Server

    Alpaca Trading MCP Server

    MCP server interface for real-time stock and crypto trading via Alpaca.

    Alpaca Trading MCP Server provides a Model Context Protocol (MCP) compliant server that acts as an interface to the Alpaca trading API. It enables users to manage portfolios, place trades, access real-time and historical market data, and handle account information programmatically. The server exposes standardized resources and tools for account management, trading, asset information, and market analytics, offering integration with MCP clients such as Claude Desktop.

    • 33
    • MCP
    • laukikk/alpaca-mcp
  • Freqtrade-MCP

    Freqtrade-MCP

    MCP server bridge for Freqtrade automated crypto trading bots

    Freqtrade-MCP acts as a Model Context Protocol (MCP) server that connects AI agents to the Freqtrade cryptocurrency trading bot via its REST API. It exposes Freqtrade operations as standardized MCP tools, enabling automated trading workflows through programmatic access. The system ensures AI agents can manage market data, trigger trades, and monitor performance in a uniform context protocol environment. It supports secure and configurable deployment with support for relevant API endpoints.

    • 92
    • MCP
    • kukapay/freqtrade-mcp
  • TickTick MCP Server

    TickTick MCP Server

    Enable powerful AI-driven task management for TickTick via the Model Context Protocol.

    TickTick MCP Server provides comprehensive programmatic access to TickTick task management features using the Model Context Protocol. Built on the ticktick-py library, it enables AI assistants and MCP-compatible applications to create, update, retrieve, and filter tasks with improved precision and flexibility. The server supports advanced filtering, project and tag management, subtask handling, and robust context management for seamless AI integration.

    • 35
    • MCP
    • jen6/ticktick-mcp
  • FinData MCP Server

    FinData MCP Server

    Open-source MCP server for LLM access to professional financial data.

    FinData MCP Server offers standardized financial data access to large language models by implementing the Model Context Protocol. It supports multiple data providers such as Tushare and Wind, and enables retrieval of both market and macroeconomic data via Stdio or SSE transports. The server is configurable and integrates into AI systems, providing tools for market, fundamental, and financial data queries.

    • 45
    • MCP
    • zlinzzzz/finData-mcp-server
  • Binance Alpha MCP

    Binance Alpha MCP

    Real-time Binance Alpha trade monitoring and analytics for AI agents

    Binance Alpha MCP is an MCP server designed to track Binance Alpha trades and assist AI agents in accumulating alpha points more effectively. It monitors buy-side activity on Binance Alpha tokens, calculates USD-based metrics using real-time price feeds, and provides data persistence with automatic cleanup. The server exposes standardized MCP tools for fetching top tokens by trading volume and trade statistics, facilitating seamless integration with model context client platforms.

    • 8
    • MCP
    • kukapay/binance-alpha-mcp
  • Crypto Indicators MCP Server

    Crypto Indicators MCP Server

    Technical analysis indicators and strategies for AI trading via the Model Context Protocol.

    Crypto Indicators MCP Server provides over 50 cryptocurrency technical analysis indicators and quantitative trading strategies through an MCP-compliant server interface. The tool is designed for AI trading agents and can integrate seamlessly with platforms like Claude Desktop. It offers support for multiple exchanges via CCXT, modular design for easy maintenance, and outputs actionable trading signals based on market trends.

    • 91
    • MCP
    • kukapay/crypto-indicators-mcp
  • Didn't find tool you were looking for?

    Be as detailed as possible for better results