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
- 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-agent 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: Base64-encoded PNG image of the generated plot
-
get_account_balances- Get current account balances
- Returns: Formatted string with cash balance, buying power, net liquidating value, and maintenance excess
- 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 table showing Symbol, Position Type, Quantity, and Current Value
-
get_transaction_history- Get transaction history
- Input:
start_date(string, optional): Start date in YYYY-MM-DD format
- Returns: Formatted table showing Transaction Date, Transaction Type, Description, and Value
Trade Management
-
schedule_trade- Schedule a trade for execution
- Inputs:
action(string): "Buy to Open" or "Sell to Close"quantity(integer): Number of shares/contractsunderlying_symbol(string): The underlying stock symbol (e.g., "SPY", "AAPL")strike(float, optional): For options only - strike priceoption_type(string, optional): For options only - "C" for calls, "P" for putsexpiration_date(string, optional): For options only - expiration date in YYYY-MM-DD formatexecution_type(string): "immediate", "once", or "daily" (default: "immediate")run_time(string, optional): Time to execute in HH:MM format (24-hour), required for "once" and "daily"dry_run(boolean): Simulate without executing (default: False)
- Returns: Task ID and confirmation message
- Notes:
- Immediate trades during market hours execute right away
- Immediate trades during market closure are scheduled for next market open
- Daily trades repeat every market day at the specified time
- One-time trades execute once at the specified time
-
list_scheduled_trades- List all scheduled trades
- Returns: Formatted table showing Task ID, Time, Type, and Description
-
remove_scheduled_trade- Remove a scheduled trade
- Input:
task_id(string): ID of task to remove
- Returns: Confirmation message
Market Analysis
-
get_metrics- Get market metrics for specified symbols
- Input:
symbols(string[]): List of stock symbols
- Returns: Formatted table showing IV Rank, IV Percentile, Beta, Liquidity Rating, and Next Earnings Date
-
get_prices- Get current bid and ask prices
- Input:
symbol(string): Stock or option symbol
- Returns: Current bid and ask prices
Usage with Claude Desktop
Add this to your claude_desktop_config.json:
{
"mcpServers": {
"tastytrade": {
"command": "uvx",
"args": ["tasty-agent"]
}
}
}
Important: The tasty-agent server runs as a background process managed by Claude Desktop. Scheduled trades will only execute while Claude Desktop is running. When Claude Desktop is closed, the server gracefully saves all scheduled tasks and resumes them when Claude Desktop is reopened. Tasks are stored securely in ~/.tasty_agent/scheduled_tasks.json.
Debugging
You can use the MCP inspector to debug the server:
npx @modelcontextprotocol/inspector uvx tasty-agent
For logs, check:
- macOS:
~/Library/Logs/Claude/mcp*.log - Windows:
%APPDATA%\Claude\logs\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
- Monitor scheduled tasks regularly
- Keep your Claude Desktop installation up to date
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.3.tar.gz.
File metadata
- Download URL: tasty_agent-0.1.3.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f839e1bec3a277ca0f6c6e5701b7e571a6ee557a40f280d00f5e582343f720b2
|
|
| MD5 |
002c6977913f1744b15ed5f01410c89a
|
|
| BLAKE2b-256 |
76f15ebca48a425c815d519a24d0b864a6efd90ae5451e023787c07cd05b047b
|
File details
Details for the file tasty_agent-0.1.3-py3-none-any.whl.
File metadata
- Download URL: tasty_agent-0.1.3-py3-none-any.whl
- Upload date:
- Size: 20.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: uv/0.5.18
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8e52c06efa78a0c13185acd0f8394b41c372c1db905f9cb50b56cccb7ecb0cf6
|
|
| MD5 |
3ea3d14257bd25144564a55b1bc24c3c
|
|
| BLAKE2b-256 |
d7e89f5e936773850cdd676cd52233eb74f39e48a44edf94b5de6185ce867e5b
|