tasty-agent
tasty-agent: An MCP server connecting AI models to TastyTrade for automated trading and portfolio management.

tasty-agent Solution Overview
tasty-agent is an MCP server designed to connect AI models to TastyTrade brokerage accounts, enabling automated portfolio management and trading strategies. It empowers AI to monitor account balances, analyze open positions, and access transaction history. Key features include the ability to schedule and manage trades, retrieve real-time market metrics, and fetch current bid/ask prices.
This server allows seamless interaction with AI models, providing them with the necessary tools to make informed trading decisions. By using tasty-agent, developers can create AI-driven applications that automate trading tasks, freeing up time for strategic decision-making. It integrates using standard MCP client-server architecture, leveraging Python and secure credential storage for safe access to TastyTrade accounts. This unlocks the potential for AI-powered trading and portfolio optimization.
tasty-agent Key Capabilities
实时投资组合监控
tasty-agent 允许 AI 模型实时监控 TastyTrade 经纪账户的投资组合表现。通过 get_account_balances
和 get_open_positions
等工具,AI 可以获取账户余额、购买力、净清算价值以及当前持仓的详细信息,包括股票代码、仓位类型、数量、市场价格和当前价值。此外,plot_nlv_history
工具能够生成账户净清算价值历史的图表,帮助 AI 模型分析投资组合的长期趋势。
例如,AI 模型可以利用这些数据,在检测到投资组合价值大幅下跌时,立即向用户发出警报,或者根据预设的风险参数自动调整仓位。技术上,这些功能通过 TastyTrade API 实现,并以格式化的字符串或图像形式返回给 AI 模型,方便其进行解析和处理。
自动化交易执行
tasty-agent 提供了自动化交易执行的能力,允许 AI 模型根据预定义的策略自动进行交易。schedule_trade
工具允许 AI 模型提交买入或卖出指令,包括股票代码、数量、期权类型、行权价和到期日等参数。该工具支持模拟运行(dry_run
),方便在实际交易前进行策略验证。此外,list_scheduled_trades
和 remove_scheduled_trade
工具允许 AI 模型管理待执行的交易指令。
例如,AI 模型可以根据市场分析结果,自动执行止损或获利订单,或者根据预设的资产配置比例,定期调整投资组合。需要注意的是,交易指令的执行依赖于 Claude Desktop 的运行状态,关闭 Claude Desktop 会导致交易服务器停止运行,从而影响交易执行。
市场数据驱动分析
tasty-agent 集成了市场数据分析功能,使 AI 模型能够获取关键的市场指标和价格信息。get_metrics
工具允许 AI 模型获取指定股票代码的 IV Rank、IV Percentile、Beta、流动性评级以及下一次财报发布日期等信息。get_prices
工具则提供股票或期权的当前买入价和卖出价。
例如,AI 模型可以利用这些数据,评估投资标的的风险和潜在回报,或者根据市场波动率调整交易策略。技术上,这些功能通过 TastyTrade API 获取实时市场数据,并将其格式化为 AI 模型易于理解的格式。这些数据驱动的分析能力增强了 AI 模型在投资决策中的智能化水平。