IndiaQuant MCP Server

Local setup required. This server has to be cloned and prepared on your machine before you register it in Claude Code.
1

Set the server up locally

Run this once to clone and prepare the server before adding it to Claude Code.

Run in terminal
git clone https://github.com/Shirshak-dugtal/mcp
cd mcp

Then follow the repository README for any remaining dependency or build steps before continuing.

2

Register it in Claude Code

After the local setup is done, run this command to point Claude Code at the built server.

Run in terminal
claude mcp add indiaquant-mcp -- python "<FULL_PATH_TO_MCP>/dist/index.js"

Replace <FULL_PATH_TO_MCP>/dist/index.js with the actual folder you prepared in step 1.

README.md

Real-time Indian stock market analysis, technical indicators, and options Greeks.

IndiaQuant MCP Server

A Model Context Protocol (MCP) server for Indian stock market analysis providing real-time market data, technical analysis, options analytics, and portfolio management using 100% free APIs.

Overview

IndiaQuant MCP provides 11 tools for NSE/BSE market analysis:

  • Live market data (prices, volume, percentage changes)
  • Technical analysis (RSI, MACD, Bollinger Bands)
  • Options analytics (Black-Scholes Greeks calculated from scratch)
  • Sentiment analysis (news-based scoring with NewsAPI + TextBlob)
  • Market scanning (NIFTY 50 overbought/oversold detection)
  • Portfolio management (virtual trading with P&L tracking)
  • Sector analysis (IT, Banking, Auto, Pharma, FMCG heatmaps)

Architecture

Module Structure

IndiaQuant/
├── server.py                    # MCP server entry point (stdio transport)
├── market_data/
│   └── fetcher.py              # Live NSE/BSE price fetching (yfinance)
├── trading_signals/
│   └── signal_generator.py     # RSI, MACD, Bollinger Bands (pandas-ta)
├── options_analysis/
│   ├── options_analyzer.py     # Options chain data (yfinance)
│   ├── greeks.py               # Black-Scholes Greeks implementation
│   └── unusual_activity.py     # Volume/OI spike detection
├── utils/
│   ├── sentiment.py            # News sentiment analysis
│   └── market_scanner.py       # NIFTY 50 scanner, sector heatmap
├── portfolio_management/
│   └── portfolio_manager.py    # Virtual portfolio with SQLite
└── database/
    └── portfolio.db            # SQLite database

Design Decisions

1. Modular Architecture

  • Each module handles a specific domain (market data, signals, options, etc.)
  • Clean separation of concerns for maintainability
  • Easy to extend with new tools

2. 100% Free API Stack

  • yfinance: Live NSE/BSE prices, historical data (unlimited, free)
  • NewsAPI: News headlines for sentiment (100 requests/day free tier)
  • pandas-ta: Technical indicators (open source)
  • TextBlob: Sentiment scoring (open source)
  • Custom Black-Scholes: Greeks calculation from scratch

3. MCP Protocol Implementation

  • Stdio transport for maximum compatibility
  • Proper tool registration with JSON schemas
  • Type-safe parameter validation
  • Structured error handling

Trade-offs & Limitations

What Works:

  • Live NSE/BSE stock prices for all securities
  • Technical indicators (RSI, MACD, Bollinger Bands)
  • Greeks calculation for any stock option
  • News sentiment analysis
  • Portfolio tracking with real-time P&L
  • Sector performance analysis

Known Limitations:

  • NSE Options Chain Data: yfinance has limited support for NSE options chains. Works reliably for US stocks but inconsistent for Indian stocks due to Yahoo Finance's data coverage. For production, would use NSE Official API or broker APIs (Zerodha, Angel One).
  • NewsAPI Rate Limits: Free tier allows 100 requests/day
  • Index Options: NIFTY/BANKNIFTY index options not supported via yfinance

Design Justification:

  • Chose yfinance for zero-cost, zero-setup advantage despite NSE options limitations
  • Prioritized breadth of features (11 tools) over depth
  • Greeks calculation works perfectly when stock price is provided
  • Assignment requires 100% free APIs - no paid alternatives allowed

MCP Tools (11 Total)

1. health_check

Check if server is running.

Parameters: None

Returns: {"status": "server running"}


2. get_live_price

Fetch live NSE stock price.

Parameters:

  • symbol (string): Stock symbol (e.g., 'RELIANCE', 'TCS')

Example Response:

{
  "symbol": "RELIANCE.NS",
  "current_price": 1408.40,
  "change_percent": 1.54,
  "volume": 5234567
}

3. generate_trading_signal

Generate BUY/SELL/HOLD signals using RSI, MACD, Bollinger Bands.

Parameters:

  • symbol (string): Stock symbol
  • period (string, optional): '1d', '5d', '1mo', '3mo', '1y' (default: '3mo')

Example Response:

{
  "symbol": "TCS",
  "signal": "BUY",
  "confidence": 75,
  "reasoning": "RSI oversold (28.5), MACD bullish crossover"
}

4. get_options_chain

Fetch options chain with calls, puts, OI, PCR.

Parameters:

  • symbol (string): Stock symbol
  • expiry (string, optional): Expiry date YYYY-MM-DD

Note: Limited data availability for NSE stocks (see Limitations section)


5. calculate_greeks

Calculate Black-Scholes Greeks from scratch.

Parameters:

  • symbol (string): Stock symbol
  • strike_price (number): Strike price
  • expiry_date (string): YYYY-MM-DD
  • option_type (string): 'call' or 'put'
  • volatility (number, optional): IV (default: 0.25)
  • risk_free_rate (number, optional): Rate (default: 0.065)

Example Response:

{
  "greeks": {
    "delta": 0.575,
    "gamma": 0.0057,
    "theta": -1.107,
    "vega": 1.075,
    "rho": 0.295
  }
}

Implementation: Pure mathematical Black-Scholes using scipy.stats


6. detect_unusual_activity

Detect volume/OI spikes in optio

Tools (5)

health_checkCheck if server is running.
get_live_priceFetch live NSE stock price.
generate_trading_signalGenerate BUY/SELL/HOLD signals using RSI, MACD, Bollinger Bands.
get_options_chainFetch options chain with calls, puts, OI, PCR.
calculate_greeksCalculate Black-Scholes Greeks from scratch.

Configuration

claude_desktop_config.json
{"mcpServers": {"indiaquant": {"command": "python", "args": ["path/to/server.py"]}}}

Try it

What is the current live price for RELIANCE?
Generate a trading signal for TCS based on the last 3 months of data.
Calculate the Black-Scholes Greeks for a call option on INFY with a strike price of 1500 expiring on 2024-12-26.
Fetch the options chain for HDFCBANK.

Frequently Asked Questions

What are the key features of IndiaQuant MCP Server?

Live NSE/BSE market data fetching. Technical analysis using RSI, MACD, and Bollinger Bands. Black-Scholes Greeks calculation for options. News-based sentiment analysis. Virtual portfolio management with P&L tracking.

What can I use IndiaQuant MCP Server for?

Analyzing real-time price movements for NIFTY 50 stocks. Generating automated buy/sell signals for technical trading. Calculating risk metrics for options positions. Tracking virtual portfolio performance for Indian equities.

How do I install IndiaQuant MCP Server?

Install IndiaQuant MCP Server by running: python server.py

What MCP clients work with IndiaQuant MCP Server?

IndiaQuant MCP Server works with any MCP-compatible client including Claude Desktop, Claude Code, Cursor, and other editors with MCP support.

Turn this server into reusable context

Keep IndiaQuant MCP Server docs, env vars, and workflow notes in Conare so your agent carries them across sessions.

Need the old visual installer? Open Conare IDE.
Open Conare