一个通过Yahoo Finance提供高级期权分析和策略评估的模型上下文协议(MCP)服务器。使大型语言模型能够分析期权链,计算希腊字母,并使用全面的风险指标评估基本期权策略。
# 安装依赖
pip install -r requirements.txt
# 克隆仓库
git clone https://github.com/twolven/mcp-optionsflow.git
cd mcp-optionsflow
在你的Claude配置中添加以下内容:
在你的claude-desktop-config.json文件中,在mcpServers部分添加以下内容:
{
"mcpServers": {
"optionsflow": {
"command": "python",
"args": ["path/to/optionsflow.py"]
}
}
}
将"path/to/optionsflow.py"替换为你保存optionsflow.py文件的实际路径。
analyze_basic_strategies{
"symbol": str, # 必填:股票代码
"strategy": str, # 必填:"ccs"、"pcs"、"csp"或"cc"
"expiration_date": str, # 必填:"YYYY-MM-DD"
"delta_target": float, # 可选:CSP/CC的目标Delta(默认值:0.3)
"width_pct": float # 可选:价差宽度(默认值:0.05)
}
{
"symbol": str,
"strategy": str,
"current_price": float,
"expiration": str,
"days_to_expiration": int,
"analysis": {
# 信用看涨期权价差 / 信用看跌期权价差
"strikes": {
"short_strike": float,
"long_strike": float
},
"metrics": {
"credit": float,
"max_loss": float,
"max_profit": float,
"probability_of_profit": float,
"risk_reward_ratio": float
},
"greeks": {
"net_delta": float,
"net_theta": float,
"net_gamma": float
}
# 现金担保看跌期权
"strike": float,
"metrics": {
"premium": float,
"max_loss": float,
"assigned_cost_basis": float,
"return_if_otm": float,
"downside_protection": float
},
"greeks": {
"delta": float,
"theta": float,
"gamma": float
}
# 覆盖看涨期权
"strike": float,
"metrics": {
"premium": float,
"max_profit": float,
"max_profit_percent": float,
"upside_cap": float,
"premium_yield": float
},
"greeks": {
"position_delta": float,
"theta": float,
"gamma": float
}
}
}
欢迎贡献!请随意提交Pull Request。
本项目根据MIT许可证发布 - 查看LICENSE文件以获取详细信息。
Todd Wolven - (https://github.com/twolven)