A comprehensive Model Context Protocol (MCP) server that provides advanced financial market data through Polygon.io's API, featuring sophisticated options analytics, Greeks calculation, and real-time market data.
- Click:
- Connect your GitHub account
- Set environment variable:
POLYGON_API_KEY=your_api_key_here
- Deploy! Your URL:
https://your-app.railway.app/sse
- Fork this repository
- Go to Render.com
- New β Web Service β Connect GitHub
- Build:
uv sync
| Start:uv run polygon_mcp_server_sse.py
- Set:
POLYGON_API_KEY=your_api_key_here
Once deployed, connect to Scira using:
- SSE Endpoint:
https://your-domain.com/sse
- Environment Variable:
API_KEY=your_polygon_api_key
- Real-time Stock Prices - Current prices, volume, and trade data
- Options Chain Data - Comprehensive options contracts with real-time quotes
- Market Status - Trading hours and exchange status
- Historical Data - Access to 15+ years of market history
- Greeks Calculation - Delta, Gamma, Theta, Vega, Rho using Black-Scholes
- Options Strategy Analysis - Iron condors, straddles, strangles, and more
- Unusual Activity Detection - High volume and large block trade identification
- Implied Volatility Analysis - IV rank, percentile, and skew analysis
- 6 Comprehensive Tools - Complete market analysis toolkit
- 3 Dynamic Resources - Real-time data access
- SSE Transport - Server-Sent Events for web compatibility
- Health Monitoring - Built-in health checks for cloud deployment
- Python 3.10+
- Polygon.io API Key (get yours at polygon.io)
- Cloud Platform (Railway, Render, Heroku, etc.)
Get current stock price and basic information
get_stock_price(symbol: "AAPL")
Get comprehensive options chain data
get_options_chain(symbol: "AAPL", expiration_date: "2024-12-20")
Calculate Options Greeks using Black-Scholes model
calculate_option_greeks(
symbol: "AAPL",
strike_price: 150.0,
expiration_date: "2024-12-20",
option_type: "call",
volatility: 0.25
)
Get current market status and trading hours
get_market_status()
market://status
- Current market statusoptions://chain/{symbol}
- Options chain for any symbolstock://price/{symbol}
- Stock price for any symbol
# Clone repository
git clone <your-repo-url>
cd polygon-mcp-server
# Install dependencies
uv sync
# Set environment variable
export POLYGON_API_KEY=your_api_key_here
# Run server
uv run polygon_mcp_server_sse.py
POLYGON_API_KEY
- Your Polygon.io API keyPORT
- Server port (auto-set by most platforms)
- β
Dockerfile
- Docker deployment - β
Procfile
- Heroku deployment - β
railway.json
- Railway configuration - β
runtime.txt
- Python version specification - β
Health check endpoint at
/health
> "What's the current price of Apple stock?"
> "Show me the options chain for Tesla"
> "Calculate Greeks for AAPL $150 call expiring December 20th"
> "Analyze an iron condor strategy on SPY"
> "Is there any unusual options activity in NVDA?"
> "What's the current market status?"
curl https://your-domain.com/health
# Returns: {"status": "healthy", "service": "polygon-mcp-server"}
curl https://your-domain.com/sse
# Returns: MCP server connection info
- Black-Scholes Model - Industry-standard pricing model
- Real-time Data Integration - Uses current market prices
- Multiple Option Types - Calls, puts, and exotic options
- Time Decay Analysis - Theta calculations for time-sensitive strategies
- Volume Analysis - Unusual volume detection
- Block Trade Identification - Large institutional trades
- Volatility Monitoring - IV rank and percentile tracking
- Flow Analysis - Options flow direction and sentiment
- API Key Protection - Environment variables only
- Rate Limiting - Built-in request throttling
- Error Handling - Comprehensive error management
- Data Validation - Input sanitization and validation
/v2/aggs/ticker/{ticker}/prev
- Previous close data/v2/last/trade/{ticker}
- Last trade information/v3/reference/options/contracts
- Options contracts/v2/snapshot/options/{ticker}
- Options snapshots/v1/marketstatus/now
- Market status
- polygon-api-client - Official Polygon.io Python client
- mcp - Model Context Protocol implementation
- scipy - Scientific computing for Greeks calculation
- numpy - Numerical computations
- uvicorn - ASGI server for production deployment
- Fork the repository
- Create a feature branch
- Add tests for new functionality
- Submit a pull request
MIT License - see LICENSE file for details
This software is provided for educational and informational purposes only. The options analytics and market data should not be used as the sole basis for investment decisions. Always consult with qualified financial professionals and conduct your own research before making investment decisions.
- Issues: GitHub Issues
- Documentation: Polygon.io Docs
- MCP Protocol: MCP Specification
Built with β€οΈ using the Model Context Protocol and Polygon.io's comprehensive financial data APIs.
Ready for instant cloud deployment! π