mcp-optionsflow
by: twolven
An MCP server providing advanced options analysis through Yahoo Finance, supporting Greeks calculations, strategy evaluation (CCS/PCS/CSP/CC), and risk metrics. Built for MCP with Claude.ai.
📌Overview
Purpose: The OptionsFlow MCP Server is designed to provide advanced options analysis and strategy evaluation using data sourced from Yahoo Finance, enabling large language models (LLMs) to effectively analyze options chains and calculate associated metrics.
Overview: This framework facilitates comprehensive options analysis, strategy evaluation, and risk management for options trading. It integrates multiple analytical tools for assessing options performance, thus empowering traders with crucial insights about potential strategies and associated risks.
Key Features:
-
Options Analysis: Offers processing of complete options chain data, including Greeks calculations (delta, gamma, theta, vega, rho), implied volatility analysis, and risk/reward metrics to enhance options trading strategies.
-
Strategy Analysis: Supports various strategies such as Credit Call Spreads, Put Credit Spreads, Cash Secured Puts, and Covered Calls, along with detailed evaluation of position Greeks and liquidity to help assess strategy viability.
-
Risk Management: Provides tools for bid-ask spread analysis, volume and open interest validation, position sizing recommendations, and maximum loss calculations, enabling traders to manage and mitigate risks effectively.
OptionsFlow MCP Server
A Model Context Protocol (MCP) server providing advanced options analysis and strategy evaluation through Yahoo Finance.
Features
Options Analysis
- Complete options chain data processing
- Greeks calculation (delta, gamma, theta, vega, rho)
- Implied volatility analysis
- Probability calculations
- Risk/reward metrics
Strategy Analysis
- Credit Call Spreads (CCS)
- Put Credit Spreads (PCS)
- Cash Secured Puts (CSP)
- Covered Calls (CC)
- Position Greeks evaluation
- Liquidity analysis
- Risk metrics calculation
Risk Management
- Bid-ask spread analysis
- Volume and open interest validation
- Maximum loss calculations
- Probability of profit estimates
Installation
pip install -r requirements.txt
git clone https://github.com/twolven/mcp-optionsflow.git
cd mcp-optionsflow
Usage
Add to your Claude configuration by updating claude-desktop-config.json
:
{
"mcpServers": {
"optionsflow": {
"command": "python",
"args": ["path/to/optionsflow.py"]
}
}
}
Available Tools
analyze_basic_strategies
{
"symbol": str, # Required: Stock symbol
"strategy": str, # Required: "ccs", "pcs", "csp", or "cc"
"expiration_date": str, # Required: "YYYY-MM-DD"
"delta_target": float, # Optional: Target delta for CSP/CC (default: 0.3)
"width_pct": float # Optional: Width for spreads (default: 0.05)
}
Strategy Analysis Response Format
{
"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
}
}
}
Requirements
- Python 3.12+
- mcp
- yfinance
- pandas
- numpy
- scipy
Limitations
- Data sourced from Yahoo Finance may have delays.
- Options data availability depends on market hours.
- Rate limits based on Yahoo Finance API restrictions.
- Greeks calculations are theoretical based on Black-Scholes model.
- Early assignment risk is not factored into probability calculations.
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
License
This project is licensed under the MIT License.
Author
Todd Wolven