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.
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
-
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"
-
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"
-
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
-
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/contractsaction(string): "Buy to Open" or "Sell to Close"execution_group(integer, optional): Group number for batch executiondry_run(boolean, optional): Test order without execution
- Returns: Order confirmation message
-
review_queue_tool- Review all currently queued orders
- Returns: Formatted string showing all queued orders
-
execute_orders_tool- Execute all queued orders
- Input:
force(boolean, optional): Execute even when market is closed
- Returns: Execution status message
-
cancel_orders_tool- Cancel queued orders based on filters
- Inputs:
execution_group(integer, optional): Group number to cancelsymbol(string, optional): Symbol to cancel
- Returns: Cancellation confirmation message
Market Analysis
-
get_metrics- Get market metrics for specified symbols
- Input:
symbols(string[]): List of stock symbols
- Returns: Formatted string showing IV rank, liquidity, beta, etc.
-
get_prices- Get current bid and ask prices
- Input:
symbol(string): Stock or option symbol
- Returns: Formatted string showing bid and ask prices
-
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:
- Use the MCP inspector (see Debugging)
- 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
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-0.1.0.tar.gz.
File metadata
- Download URL: tasty_agent-0.1.0.tar.gz
- Upload date:
- Size: 54.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d84d3595f042bdd36f40646d4950661a8f53aa39ae89277fbf92033e58c6543e
|
|
| MD5 |
71788e6662626f232bc18e6656001da5
|
|
| BLAKE2b-256 |
a948a2f0fadf597e7c2fb91b82e444b043838441e83faa1c24b2b8c8816646ea
|
File details
Details for the file tasty_agent-0.1.0-py3-none-any.whl.
File metadata
- Download URL: tasty_agent-0.1.0-py3-none-any.whl
- Upload date:
- Size: 73.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c1ab838b20ad89bae512cfbe68e408cec091e4383fa1c030e880736be8135e7
|
|
| MD5 |
b52d01ab9b47d8bf047af423faeaff8c
|
|
| BLAKE2b-256 |
aba8748976d881fbe6637c081574288ee7e1ca7d702dfe0e2ef9fafc4fbc730c
|