A Model Context Protocol server for interacting with TastyTrade brokerage accounts
Project description
tasty-agent: A TastyTrade MCP Server
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:
- Create an OAuth app at https://my.tastytrade.com/app.html#/manage/api-access/oauth-applications
- Check all scopes, save your client ID and client secret
- Create a "New Personal OAuth Grant" in your OAuth app settings (check all scopes)
- Copy the generated refresh token
- Configure the MCP server with your credentials (see Usage section below)
MCP Tools
Account & Portfolio
account_overview(include=["balances","positions"], time_back='1y')- Account balances, open positions, and/or portfolio value history in a single call. Setincludeto any combination of"balances","positions","net_liq_history".
Market Data & Research
get_quotes(instruments, timeout=10.0)- Real-time quotes for stocks, options, futures, and indices via DXLink streamingget_greeks(options, timeout=10.0)- Greeks (delta, gamma, theta, vega, rho) for options via DXLink streamingget_market_metrics(symbols)- IV rank, percentile, beta, liquidity for multiple symbolsmarket_status(exchanges=['Equity'])- Market hours, status, holidays, and current NYC time ('Equity', 'CME', 'CFE', 'Smalls')search_symbols(symbol)- Search for symbols by name/ticker
History
get_history(type, days=None, underlying_symbol=None, transaction_type=None)- Transaction history (type="transactions", default 90 days) or order history (type="orders", default 7 days). Filter transactions by"Trade"or"Money Movement".
Order Management
manage_order(action, ...)- Unified order management:action="list"- Get all live ordersaction="place"- Place multi-leg orders with automatic mid-price discovery. SupportsDay,GTC,GTD,Ext,Ext Overnight,GTC Ext,GTC Ext Overnight, andIOCtime-in-force.action="replace"- Modify existing order priceaction="cancel"- Cancel an order
Watchlist Management
watchlist(action, ...)- Unified watchlist management:action="list"- Get public or private watchlistsaction="add"- Add symbols to a watchlist (creates if doesn't exist)action="remove"- Remove symbols from a watchlistaction="delete"- Delete a 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):
{
"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 my portfolio value history for the last 3 months"
"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"
"Show my live orders"
"Get my trading history from January"
"Get my order history for SPY"
"Get my private watchlists"
"Add TSLA and NVDA to my tech watchlist"
"Remove AAPL from my tech watchlist"
Development
Testing with chat.py
For interactive testing during development:
# 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
npx @modelcontextprotocol/inspector uvx tasty-agent
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file tasty_agent-4.0.0.tar.gz.
File metadata
- Download URL: tasty_agent-4.0.0.tar.gz
- Upload date:
- Size: 160.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a60bb3845c821b643265be98e4e4850e27ca52e8a28b113825a0eee7a70a4592
|
|
| MD5 |
7b0279e8f8c00421371cff9670951e71
|
|
| BLAKE2b-256 |
2173728c22f3cd1a490ea0b2701793503bc8c24ef896a4b81e1f110f53b4162a
|
File details
Details for the file tasty_agent-4.0.0-py3-none-any.whl.
File metadata
- Download URL: tasty_agent-4.0.0-py3-none-any.whl
- Upload date:
- Size: 15.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
defed5f169cd67cfbdd000ba837136810d4854dd9e2bdc71beaad90e61c94151
|
|
| MD5 |
fd7e98bbf8ed9e8c3e5946900b39c968
|
|
| BLAKE2b-256 |
f1d73906edfa17991cd417f06cf0c1224d514f4c00e25e4702c60d8a4b88b32a
|