Skip to main content

A Model Context Protocol server for interacting with TastyTrade brokerage accounts

Project description

tasty-agent: A TastyTrade MCP Server

Overview

A Model Context Protocol server for interacting with TastyTrade brokerage accounts. This server enables Large Language Models to monitor portfolios, analyze positions, and execute trades through the TastyTrade platform.

Please note that tasty-agent is currently in early development. The functionality and available tools are subject to change and expansion as development continues.

Prerequisites

  • Python 3.12 or higher
  • uv package manager
  • A TastyTrade account

Installation

Install uv if you haven't already:

curl -LsSf https://astral.sh/uv/install.sh | sh

We will use uvx to directly run tasty-agent:

uvx tasty-agent

Authentication

The server requires TastyTrade credentials. For security, these are set up via command line and stored in your system's keyring (Keychain on macOS, Windows Credential Manager on Windows, or similar secure storage on other platforms):

tasty-setup

Tools

Portfolio Management

  1. plot_nlv_history

    • Plots account net liquidating value history over time
    • Input:
      • time_back (string): Time period to plot ('1d', '1m', '3m', '6m', '1y', 'all')
    • Returns: Displays a matplotlib plot of portfolio value history
    • Example response: "Generated plot showing NLV trend from $10,000 to $12,500 over the last 3 months"
  2. get_account_balances

    • Get current account balances
    • Returns: Formatted string with cash balance, buying power, and net liquidating value
    • Example response: "Cash: $5,000.00, Buying Power: $10,000.00, NLV: $15,000.00"
  3. get_open_positions

    • Get all currently open positions
    • Returns: Formatted string showing all open positions
    • Example response: "AAPL: 100 shares @ $150.00, TSLA 300P 2024-06-21: -2 contracts @ $5.00"

Order Management

  1. queue_order_tool

    • Queue a new order for later execution
    • Inputs:
      • symbol (string): Trading symbol (e.g., "AAPL" or "INTC 50C 2026-01-16")
      • quantity (integer): Number of shares/contracts
      • action (string): "Buy to Open" or "Sell to Close"
      • execution_group (integer, optional): Group number for batch execution
      • dry_run (boolean, optional): Test order without execution
    • Returns: Order confirmation message
  2. review_queue_tool

    • Review all currently queued orders
    • Returns: Formatted string showing all queued orders
  3. execute_orders_tool

    • Execute all queued orders
    • Input:
      • force (boolean, optional): Execute even when market is closed
    • Returns: Execution status message
  4. cancel_orders_tool

    • Cancel queued orders based on filters
    • Inputs:
      • execution_group (integer, optional): Group number to cancel
      • symbol (string, optional): Symbol to cancel
    • Returns: Cancellation confirmation message

Market Analysis

  1. get_metrics

    • Get market metrics for specified symbols
    • Input:
      • symbols (string[]): List of stock symbols
    • Returns: Formatted string showing IV rank, liquidity, beta, etc.
  2. get_prices

    • Get current bid and ask prices
    • Input:
      • symbol (string): Stock or option symbol
    • Returns: Formatted string showing bid and ask prices
  3. get_transaction_history

    • Get transaction history
    • Input:
      • start_date (string, optional): Start date in YYYY-MM-DD format
    • Returns: Formatted string showing transaction history

Usage with Claude Desktop

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "tastytrade": {
      "command": "uvx",
      "args": ["tasty-agent"]
    }
  }
}

Debugging

You can use the MCP inspector to debug the server:

npx @modelcontextprotocol/inspector uvx tasty-agent

For logs, run:

tail -n 20 -f ~/Library/Logs/Claude/mcp*.log

Development

For local development testing:

  1. Use the MCP inspector (see Debugging)
  2. Test using Claude Desktop with this configuration:
{
  "mcpServers": {
    "tastytrade": {
      "command": "uv",
      "args": [
        "--directory",
        "path/to/tasty-agent",
        "run",
        "tasty-agent"
      ]
    }
  }
}

Security Notice

This server handles sensitive financial information and can execute trades. Always:

  • Use secure credential storage
  • Review queued orders before execution
  • Use dry-run mode for testing

License

This MCP server is licensed under the MIT License. See the LICENSE file for details.

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

tasty_agent-0.1.2.tar.gz (18.2 kB view details)

Uploaded Source

Built Distribution

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

tasty_agent-0.1.2-py3-none-any.whl (41.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: tasty_agent-0.1.2.tar.gz
  • Upload date:
  • Size: 18.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.5.18

File hashes

Hashes for tasty_agent-0.1.2.tar.gz
Algorithm Hash digest
SHA256 7b0b37084e3ea97d6f0adb59d1141401301eb34229ab3455b2bcbab84c5fcff9
MD5 e50f478d8116e8693ad977e0c387b23a
BLAKE2b-256 675dc509c5dfcb31be2d41a824f7cf36d978fa030e806a680eaf98695c6312a1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for tasty_agent-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4ade50472b169273539f914242d142e52cff2135ef481a13149c57e1e50b6feb
MD5 f171edcb16ec4a5e99f736e7428c130c
BLAKE2b-256 8354ce2cc916c86d93ae8905eea851996fd71ccf6661f6b1c860a52e2237dad2

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