indian-option-mcp
Provides optional integration with Zerodha Kite API for faster data access, including full option chains, tick-level data, and order book depth.
🆓 Free Alternative to Sensibull & Opstra
Feature | Sensibull (₹1500/mo) | Opstra (₹999/mo) | Indian Option MCP (Free) |
Option Chain | ✅ | ✅ | ✅ Live from NSE |
Strategy Builder | ✅ (20+) | ✅ (15+) | ✅ 34 strategies |
Greeks Calculator | ✅ | ✅ | ✅ Black-Scholes |
Max Pain | ✅ | ✅ | ✅ |
OI Analysis | ✅ | ✅ | ✅ |
IV Smile/Skew | ❌ | ✅ | ✅ |
Position Sizing | ❌ | ❌ | ✅ |
Margin Estimation | ❌ | ❌ | ✅ |
Probability of Profit | ❌ | ❌ | ✅ |
AI-Powered Analysis | ❌ | ❌ | ✅ Claude AI |
Natural Language | ❌ | ❌ | ✅ "Build me an Iron Condor" |
API/Programmatic | ❌ | ❌ | ✅ MCP Protocol |
Price | ₹1500/month | ₹999/month | 🆓 Forever Free |
Related MCP server: optionslab
✨ Why Indian Option MCP?
Pain Point | Old Way | With This MCP |
Checking option chains | Open Sensibull/NSE website, scroll, compare | "Show me NIFTY option chain" |
Building strategies | Manually pick strikes, calculate P&L | "Build an iron condor on BANKNIFTY" |
Greeks analysis | Open Black-Scholes calculator, enter values | "What are the Greeks for NIFTY 24000 CE?" |
Finding support/resistance from OI | Stare at OI columns, do mental math | "Where is the highest OI in NIFTY?" |
Position sizing | Spreadsheet + guesswork | "Size a position for ₹5L capital, 2% risk" |
🕐 24/7 Availability — Works Even After Market Hours
Most NSE tools and scrapers break after 3:30 PM IST because NSE takes down the option chain API. This MCP server uses a dual-endpoint fallback architecture:
Time | Data Source | What You Get |
9:15 AM – 3:30 PM (Market Open) | Primary NSE API | Full chain with IV, Greeks, change-in-OI, bid/ask |
After 3:30 PM (Market Closed) | Fallback derivatives API | Closing snapshot with OI, LTP, volume, strike prices |
No configuration needed. The fallback is automatic. You always get data, any time of day.
🚀 Features
📊 Option Chain Tools
Tool | Description |
| Full option chain with strikes, LTP, OI, IV, volume, bid/ask for calls & puts |
| All available expiry dates for any F&O symbol |
| Current spot/underlying price of any stock or index |
🔢 Greeks & Pricing
Tool | Description |
| All Greeks — Delta, Gamma, Theta, Vega, Rho — via Black-Scholes |
| Implied Volatility from market price (Newton-Raphson method) |
| Theoretical option price using Black-Scholes model |
| Scenario analysis — how Greeks change under hypothetical conditions |
🏗️ Strategy Builder — 34 Pre-Built Strategies
Tool | Description |
| Build any of 34 strategies with real market prices, payoff & breakevens |
| Build custom multi-leg strategies with specific strikes |
| Get strategy suggestions based on outlook & risk preference |
| Browse all available strategies by category |
| Payoff/P&L table at expiry across price scenarios |
📈 Open Interest Analysis
Tool | Description |
| Max Pain strike — where option buyers lose the most |
| Put-Call Ratio (OI, Volume, and Change based) with interpretation |
| OI-based support & resistance levels |
| Change in OI patterns — emerging support/resistance |
📉 IV Analytics
Tool | Description |
| IV Smile curve + IV Skew across strikes |
| Expected price range by expiry (1σ, 1.645σ, 1.96σ) |
🌍 Market Data
Tool | Description |
| NIFTY & BANKNIFTY snapshot — spot, ATM IV, PCR, lot size |
| Is the NSE market currently open or closed? |
| Lot size for any F&O instrument |
| Next weekly/monthly expiry date |
🛡️ Risk Management
Tool | Description |
| SPAN + Exposure margin estimate for option strategies |
| POP calculation using log-normal distribution |
| Optimal lot count based on capital & risk tolerance |
🔍 Scanners
Tool | Description |
| Find strikes with highest institutional OI buildup |
| Detect abnormally high volume/OI ratio |
💬 MCP Prompts
Prompt | Description |
| Full strategy recommendation workflow — chains, PCR, max pain, expected move, build & size |
| Comprehensive analysis — OI, PCR, IV smile, max pain, expected move synthesized |
⚡ Quick Start
Option 1: npx (Recommended — Zero Install)
Add this to your Claude Desktop config:
{
"mcpServers": {
"indian-options": {
"command": "npx",
"args": ["-y", "indian-option-mcp"]
}
}
}Restart Claude Desktop. Done. 🎉
Option 2: Clone & Build
# Clone the repository
git clone https://github.com/devag7/Indian-Option-MCP.git
cd Indian-Option-MCP
# Install dependencies & build
pnpm install
pnpm run buildConfigure Claude Desktop
Add this to your Claude Desktop config file:
OS | Path |
macOS |
|
Windows |
|
Linux |
|
{
"mcpServers": {
"indian-options": {
"command": "node",
"args": ["/absolute/path/to/Indian-Option-MCP/dist/bundle.mjs"],
"env": {
"DATA_PROVIDER": "nse"
}
}
}
}That's it. Restart Claude Desktop and start asking about Indian options! 🎉
💬 Example Conversations
Once configured, just talk naturally to Claude:
You: Show me the NIFTY option chain for the nearest expiry
You: Build an iron condor on BANKNIFTY with 3 strikes OTM
You: What's the max pain for NIFTY? Where is OI-based support?
You: I'm bullish on RELIANCE. Suggest a strategy with low risk.
You: Calculate Greeks for NIFTY 24500 CE, 10 days to expiry, 14% IV
You: Show the expected move for NIFTY at 95% confidence
You: Size a short straddle on BANKNIFTY for ₹10L capital, max 2% risk🏗️ Strategy Library
All 34 pre-built strategies, ready to deploy with live market prices:
📈 Bullish
Strategy | Legs |
| 1 |
| 2 |
| 2 |
| 2 |
| 2 |
| 2 |
| 3 |
| 2 |
| 3 |
📉 Bearish
Strategy | Legs |
| 1 |
| 2 |
| 2 |
| 2 |
| 2 |
| 2 |
| 2 |
| 2 |
⚖️ Neutral
Strategy | Legs |
| 2 |
| 2 |
| 4 |
| 4 |
| 3 |
| 2 |
| 4 |
🌊 Volatility
Strategy | Legs |
| 2 |
| 2 |
| 2 |
| 2 |
| 2 |
| 2 |
| 1 |
| 1 |
| 3 |
| 3 |
💡 Tip: Use
list_strategiesto browse by category, orsuggest_strategyto get recommendations based on your market view.
🔌 Data Providers
Provider | API Key | Features | Speed |
NSE India (default) | ❌ Not needed | Full option chains, OI, IV, volume, spot prices | ⚡ Fast |
Zerodha Kite (optional) | ✅ Required | Full option chains, tick-level data, order book depth | ⚡⚡ Faster |
NSE (Default — Zero Config)
Works out of the box. The server fetches data directly from NSE India's public endpoints.
# No configuration needed — just build and run
DATA_PROVIDER=nse # this is the defaultZerodha Kite (Optional)
For traders with a Zerodha account who want faster data and deeper order book:
DATA_PROVIDER=zerodha
KITE_API_KEY=your_api_key
KITE_API_SECRET=your_api_secret
KITE_ACCESS_TOKEN=your_access_token # refreshed dailyGet credentials from developers.kite.trade
⚙️ Environment Variables
Copy .env.example to .env and configure as needed:
cp .env.example .envVariable | Default | Description |
|
| Data source — |
| — | Zerodha Kite API key (only if |
| — | Zerodha Kite API secret (only if |
| — | Zerodha session token, refreshed daily (only if |
|
| Real-time data cache lifetime in seconds |
|
| Instrument master cache lifetime in hours |
|
| Annual risk-free rate for Black-Scholes (7% = Indian 10Y bond) |
|
| Logging verbosity — |
🏛️ Architecture
indian-option-mcp/
├── src/
│ ├── index.ts # Entry point — stdio transport
│ ├── server.ts # MCP server — all 35+ tools registered here
│ ├── config.ts # Zod-validated env configuration
│ │
│ ├── data/
│ │ ├── providers/
│ │ │ ├── base.provider.ts # Abstract data provider interface
│ │ │ ├── nse.provider.ts # NSE India scraper (default)
│ │ │ └── zerodha.provider.ts # Kite Connect API client
│ │ ├── provider-factory.ts # Provider factory pattern
│ │ ├── cache/
│ │ │ ├── memory-cache.ts # TTL-based in-memory cache
│ │ │ └── instrument-cache.ts # Long-lived instrument master cache
│ │ ├── constants/
│ │ │ ├── lot-sizes.ts # F&O lot sizes (NIFTY=75, BANKNIFTY=30, etc.)
│ │ │ ├── expiry-calendar.ts # Expiry date calculations
│ │ │ └── indices.ts # Index metadata & strike intervals
│ │ └── models/
│ │ ├── option-chain.ts # Option chain data models
│ │ ├── instrument.ts # Instrument definitions
│ │ ├── quote.ts # Quote/tick models
│ │ ├── strategy.ts # Strategy type definitions
│ │ └── index.ts # Model barrel exports
│ │
│ ├── engine/
│ │ ├── black-scholes.ts # Option pricing & Greeks (Δ, Γ, Θ, ν, ρ)
│ │ ├── implied-volatility.ts # IV solver (Newton-Raphson)
│ │ ├── iv-surface.ts # IV Smile, Skew, Rank, Percentile, HV
│ │ ├── strategy-builder.ts # 34 strategy templates + builder
│ │ ├── payoff.ts # Payoff/P&L at expiry engine
│ │ ├── max-pain.ts # Max Pain calculator
│ │ ├── pcr.ts # Put-Call Ratio analyzer
│ │ ├── oi-analysis.ts # OI distribution & activity detection
│ │ ├── margin-calculator.ts # SPAN margin estimator
│ │ └── risk-metrics.ts # POP, Kelly, position sizing
│ │
│ └── utils/
│ ├── date.ts # Market hours, DTE, expiry helpers
│ ├── format.ts # Currency, number, OI formatting
│ ├── math.ts # Normal CDF, statistical functions
│ └── logger.ts # Stderr-only logger (MCP-safe)
│
├── dist/ # Compiled output
├── package.json
├── tsconfig.json
└── .env.exampleDesign Principles
Zero external trading dependencies — only
@modelcontextprotocol/sdkandzodProvider pattern — swap between NSE and Zerodha with one env variable
Pure computation engine — all pricing, Greeks, and analytics are self-contained
MCP-safe logging — all output goes to
stderr, neverstdout(protects stdio transport)Startup validation — Zod schemas validate all config at boot, not at runtime
🛠️ Development
# Watch mode (recompile on save)
pnpm run dev
# Type-check without emitting
pnpm run lint
# Run tests
npm test
# Inspect with MCP Inspector
pnpm run inspect
# Clean build artifacts
pnpm run clean🤝 Contributing
Contributions are welcome! Here's how to get started:
Fork the repository
Create a feature branch —
git checkout -b feat/my-featureCommit your changes —
git commit -m "feat: add my feature"Push to your branch —
git push origin feat/my-featureOpen a Pull Request
Areas for Contribution
🆕 New strategies (e.g., seagull, condor variations)
🌐 Additional data providers (Upstox, Angel One, etc.)
📊 Enhanced analytics (IV term structure, correlation analysis)
🧪 Test coverage for engine modules
📚 Documentation improvements
📄 License
This project is licensed under the MIT License — see the LICENSE file for details.
Available Tools
27 toolsbuild_strategyB
Build a pre-defined options strategy (Iron Condor, Bull Call Spread, Straddle, etc.) with real market prices for an Indian F&O symbol.
Inputs: symbol (required), strategy_name (required), expiry, otm_offset.
calculate_greeksB
Calculate all Option Greeks (Delta, Gamma, Theta, Vega, Rho) for a given option using Black-Scholes model.
Inputs: iv (required), spot (required), type (required), strike (required), +2 more.
calculate_ivB
Calculate Implied Volatility from the market price of an option using Newton-Raphson method.
Inputs: spot (required), type (required), strike (required), expiry_days (required), +2 more.
calculate_max_painC
Calculate the Max Pain strike price — the price at which option buyers lose the most money.
Inputs: symbol (required), expiry.
calculate_option_priceC
Calculate theoretical option price using Black-Scholes model.
Inputs: iv (required), spot (required), type (required), strike (required), +2 more.
calculate_payoffC
Calculate the payoff/P&L at expiry for given option legs at various underlying prices.
Inputs: legs (required), lot_size (required), spot_price (required).
custom_strategyB
Build a custom multi-leg options strategy with specific strikes and actions.
Inputs: legs (required), symbol (required), expiry.
estimate_marginC
Estimate the margin required for an options strategy (SPAN + Exposure margin).
Inputs: legs (required), symbol (required).
expected_moveC
Calculate the Expected Move — the price range the market expects the underlying to stay within by expiry.
Inputs: symbol (required), expiry, confidence.
get_expiry_datesA
Get all available F&O expiry dates for an Indian stock or index. Use to find weekly/monthly expiries before building strategies. Returns a numbered list of expiry dates sorted chronologically.
Inputs: symbol (required).
get_option_chainB
Get the complete option chain for an Indian F&O symbol (NIFTY, BANKNIFTY, RELIANCE, etc.) with strike prices, LTP, Open Interest, IV, volume, bid/ask for both calls and puts.
Inputs: symbol (required), expiry, strike_range.
get_pcrC
Calculate Put-Call Ratio (PCR) based on Open Interest, Volume, and OI Change.
Inputs: symbol (required), expiry.
get_spot_priceA
Get the current spot/underlying price of an Indian stock or index from NSE. Use this to check the latest price before calculating Greeks or building strategies. Returns spot price with timestamp.
Inputs: symbol (required).
highest_oi_strikesB
Find strikes with highest Open Interest — these act as support (Put OI) and resistance (Call OI) levels.
Inputs: symbol (required), top_n, expiry.
iv_smileC
Get the IV Smile — Implied Volatility across different strike prices for a single expiry.
Inputs: symbol (required), expiry.
list_strategiesA
List all available pre-built options strategies, optionally filtered by category.
Inputs: category.
lot_sizeA
Get the F&O lot size (number of shares per contract) for any NSE stock or index. Essential for calculating strategy costs, margin, and position sizing. Returns the current lot size as defined by NSE.
Inputs: symbol (required).
market_overviewB
Get a comprehensive overview of Indian market indices — NIFTY, BANKNIFTY with current values and key options data.
Inputs: no named parameters.
market_statusA
Check if the Indian stock market (NSE) is currently open or closed. Returns market status with trading hours info. Use before placing trades or to explain why data may be stale. Accounts for weekends and Indian market holidays.
Inputs: no named parameters.
next_expiryA
Get the next upcoming F&O expiry date for an Indian stock or index. Supports both weekly (index) and monthly expiries. Use to determine time-to-expiry for Greeks calculations or strategy timing.
Inputs: symbol (required), weekly.
oi_change_analysisC
Analyze Change in Open Interest across strikes to identify emerging support/resistance and market sentiment.
Inputs: symbol (required), expiry.
position_sizingC
Calculate optimal position size based on capital and risk tolerance.
Inputs: capital (required), lot_size (required), risk_percent (required), max_loss_per_lot (required).
probability_of_profitB
Calculate the Probability of Profit (POP) for an options strategy using log-normal distribution.
Inputs: iv (required), breakevens (required), spot_price (required), strategy_type (required), +1 more.
scan_high_oiC
Find strikes with the highest Open Interest buildup — indicates significant institutional positioning.
Inputs: symbol (required), expiry, min_oi.
suggest_strategyC
Get AI-friendly strategy suggestions based on your market outlook, risk preference, and capital.
Inputs: outlook (required), risk_level.
unusual_activityB
Detect unusual options activity — strikes with abnormally high volume relative to open interest.
Inputs: symbol (required), expiry, threshold.
what_if_greeksB
What-if scenario: Show how Greeks change under hypothetical spot price, IV, or time conditions.
Inputs: iv (required), spot (required), type (required), strike (required), +1 more.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 27 tools
Most tools have distinct purposes, but highest_oi_strikes and scan_high_oi both target high-OI strikes, and get_expiry_dates versus next_expiry overlap. Descriptions help, but an agent can still hesitate between these paired tools.
All names use snake_case, but the convention mixes verb_noun patterns such as get_option_chain and calculate_greeks with noun phrases such as market_overview, iv_smile, and unusual_activity. The names are readable, but there is no single predictable naming pattern.
With 27 tools, the surface exceeds the 25-tool threshold and feels heavy for reliable agent selection. Several analytics tools could likely be consolidated without losing much capability.
The set covers market data, Greeks/IV pricing, strategy construction, payoff analysis, OI analytics, margin, and position sizing well. Minor gaps include historical/backtesting data and multi-expiry comparison, but there are no major dead ends for an options analytics server.
Maintenance
Related MCP Connectors
Hosted MCP server for Indian market quotes, option-chain Greeks and multi-broker telemetry.
Research-only MCP server: your AI as a quant research desk. 90 tools, no trades, no brokers.
Official Intrinio MCP server. US stock prices, options and fundamentals for AI agents.
Financial data MCP server for Claude, ChatGPT, Cursor and Codex. Real-time stock quotes, financial statements, options flow, SEC filings, insider trades, 13F holdings, macro data and market news from gloom.sh, the open-source Bloomberg Terminal alternative.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceReal-time Indian stock market assistant with virtual trading, technical analysis, options chain, and portfolio management, using free APIs and integrated with Claude Desktop via MCP.-
- AlicenseNot gradedqualityCmaintenanceOptions analytics MCP server providing 40+ tools for options chain data, position valuation, Greeks, charts, and volatility analysis.MIT
- FlicenseNot gradedqualityDmaintenanceA real-time Indian stock market assistant providing live prices, trading signals, options data, sentiment analysis, and portfolio tracking via MCP integration with Claude Desktop.-
- AlicenseBqualityCmaintenanceComprehensive MCP server for Indian stock market with 60 tools covering NSE/BSE, derivatives, mutual funds, technicals, and more, requiring no API keys. Enables users to access live market data, analyze indicators, and manage investments through natural language.4601MIT