Skip to main content
Glama
India Market MCP

India Market MCP

by kcodweb

India Market MCP

CI Python License: MIT

An MCP server that gives Claude and other AI assistants live Indian market data: NSE quotes and indices, option chains with positioning analytics, company financials, shareholding, corporate actions, exchange filings and mutual fund performance. No API keys needed.

Ask things like:

  • "How did the market do today, and which sectors led?"

  • "Compare HDFC Bank and ICICI Bank on valuation, growth and promoter holding."

  • "What is NIFTY's option chain saying for this week's expiry? Where are the OI walls and max pain?"

  • "Show Parag Parikh Flexi Cap's 3, 5 and 10-year returns and its worst drawdown."

  • "What did Reliance announce to the exchange this month?"

Tools

Tool

What it returns

get_market_overview

Market status, major indices and India VIX with 1w/1m/1y moves, NIFTY 50 P/E and P/B, sectors ranked by move, NIFTY 500 breadth, NIFTY 50 top movers, FII/DII net flows, USD/INR, upcoming holidays

search_securities

NSE symbols (stocks, ETFs, SME) and indices matching a company or index name

get_quote

Price, day range, VWAP, volume, delivery %, 52-week range, market cap, P/E vs sector P/E, sector, index membership. Index names return the index level, returns, P/E, P/B and breadth

get_price_history

OHLCV bars plus total return, CAGR, annualised volatility, max drawdown, 20/50/200-day averages, RSI, dividends and splits. Stocks, NSE indices and SENSEX

get_index

An index's level, returns, valuation and breadth, with every constituent's move, distance from its 52-week high and approximate weight

get_option_chain

Strikes around the money with LTP, OI, change in OI, volume, IV, bid/ask and delta, plus put-call ratio, max pain, OI support and resistance, biggest OI build-ups, ATM IV, straddle-implied move and ATM Greeks

price_option

Black-Scholes price and Greeks, or implied volatility from a market price (works offline)

get_financials

Annual or quarterly revenue, EBITDA, profit, EPS, margins, YoY growth, balance sheet, cash flow, ROE, debt/equity, current ratio, interest cover (₹ crore)

get_shareholding

Promoter and public holding by quarter, with the promoter stake's QoQ and YoY change

get_corporate_actions

Dividends (with amount per share), bonuses, splits, rights, buybacks, upcoming ex-dates, trailing 12-month dividend and yield

get_announcements

Exchange filings with a summary and PDF link, filterable by keyword

search_mutual_funds

Scheme codes by name, filtered to direct/regular and growth/IDCW

get_mutual_fund

Latest NAV, trailing returns (1 week to 10 years and since inception), calendar-year returns, 3-year volatility, max drawdowns

The server also provides three prompts: research_stock, market_brief and options_positioning.

Related MCP server: nse-mcp

Set up

You need uv. It fetches the right Python and runs the server without a separate install step.

Claude Code

claude mcp add -s user india-market -- uvx --from git+https://github.com/kcodweb/india-market-mcp india-market-mcp

Claude Desktop, Cursor, Windsurf and other clients. Add this to the client's MCP config (for Claude Desktop: Settings → Developer → Edit Config):

{
  "mcpServers": {
    "india-market": {
      "command": "uvx",
      "args": ["--from", "git+https://github.com/kcodweb/india-market-mcp", "india-market-mcp"]
    }
  }
}

Restart the client and ask about the market.

From a clone

git clone https://github.com/kcodweb/india-market-mcp
cd india-market-mcp
uv sync
uv run india-market-mcp            # stdio, for local clients
uv run india-market-mcp --transport streamable-http --port 8000   # HTTP at http://127.0.0.1:8000/mcp

Data sources

Data

Source

Freshness

Quotes, indices, option chains, FII/DII, filings, shareholding, corporate actions

NSE website APIs

A few minutes delayed; cached 20 s

Price history

Yahoo Finance

End of day, adjusted for splits and bonuses

Financial statements

Yahoo Finance (from company filings)

Updated after results; the tool warns when the latest period looks stale

Mutual fund NAVs

AMFI via mfapi.in

Daily

How it works

  • NSE access. NSE's JSON endpoints sit behind bot protection. The server loads a normal page first to collect session cookies, sends browser-like headers, refreshes the session once if NSE answers 401/403, spaces its requests at least 350 ms apart and caches responses. It uses the endpoints NSE's current website calls, several of which replaced the older /api/quote-equity family that NSE now blocks.

  • Compact output. Results are small JSON documents: nulls dropped, money in ₹ crore, long lists capped with a note on how to see more. That keeps an assistant's context free for reasoning.

  • Errors the model can act on. A mistyped symbol returns suggestions (RELIANC → "Did you mean: RELIANCE (Reliance Industries Limited)…"), an unknown expiry lists the live ones, and a blocked request says why.

  • Analytics in plain Python. Black-Scholes, Greeks, the implied-volatility solver, max pain, CAGR, drawdown, RSI and the rest have no NumPy or SciPy dependency, and all are unit-tested.

Limitations

  • These are unofficial website endpoints, not a licensed data feed. NSE changes them from time to time, and it blocks many cloud and non-Indian networks. Run the server on your own machine; a server in a US data centre will likely be refused.

  • Shareholding covers promoter and public totals only; NSE's summary does not break out FII, DII or mutual fund holdings.

  • Yahoo's statements for banks and financial companies are less complete than for other companies.

  • This is market data for research and education, not investment advice. Check the terms of use of NSE, Yahoo and AMFI before building anything commercial on it. Not affiliated with NSE, BSE, AMFI or Yahoo.

Development

uv sync                  # installs the dev tools too
uv run pytest            # 118 offline tests, about a second
uv run pytest -m live    # checks the real endpoints (run from an Indian connection)
uv run ruff check src tests && uv run ruff format --check src tests

The offline suite replays real responses recorded in tests/fixtures/, through a real MCP client, so it is deterministic and never calls NSE from CI. To refresh the recordings, run python tests/record_fixtures.py from a network NSE allows, update RECORDED_AT in tests/scenarios.py, and fix any assertions that depend on the data.

src/india_market_mcp/
  server.py        tool and prompt definitions, CLI
  features/        one module per area: market, history, derivatives, company, funds
  sources/         HTTP clients for NSE, Yahoo Finance and mfapi.in
  analytics/       option pricing and return statistics (pure functions)

License

MIT

Available Tools

13 tools
get_announcementsCompany announcementsB
Read-onlyIdempotent

Exchange filings from NSE (results, board meetings, acquisitions, credit ratings, investor meets...) with a short summary and a link to each PDF.

Inputs: symbol (required), days, limit, keyword.

get_corporate_actionsDividends, bonuses and splitsA
Read-onlyIdempotent

Corporate actions (dividends with amount per share, bonus issues, splits, rights, buybacks) with ex and record dates, upcoming ones flagged, plus dividends paid in the last 12 months and the trailing yield.

Inputs: symbol (required), limit.

get_financialsCompany financial statementsA
Read-onlyIdempotent

Reported revenue, EBITDA, operating profit, net profit and EPS with margins and year-on-year growth, plus balance sheet (assets, equity, debt, cash), cash flow (operating, capex, free cash flow) and ROE, debt/equity, current ratio and interest cover. Amounts in ₹ crore.

Inputs: symbol (required), count, period.

get_indexIndex details and constituentsB
Read-onlyIdempotent

An NSE index's level, returns, valuation (P/E, P/B, dividend yield) and breadth, with every constituent's price, day/30-day/1-year change, distance from its 52-week high and approximate weight.

Inputs: index (required), limit, sort_by.

get_market_overviewMarket overviewA
Read-onlyIdempotent

Today's Indian market in one call: market open/closed, major indices and India VIX with 1-week, 1-month and 1-year changes, NIFTY 50 P/E and P/B, sector indices ranked by move, NIFTY 500 breadth, NIFTY 50 top gainers and losers, FII/DII net buying (₹ crore), USD/INR and upcoming market holidays.

Inputs: no named parameters.

get_mutual_fundMutual fund performanceB
Read-onlyIdempotent

A scheme's latest NAV, category and fund house, trailing returns (1 week to 10 years and since inception, annualised beyond a year), calendar-year returns, 3-year volatility and maximum drawdowns.

Inputs: scheme_code (required).

get_option_chainOption chain with analyticsA
Read-onlyIdempotent

NSE option chain around the money, with put-call ratio (OI and volume), max pain, the strikes with the most call and put open interest (resistance/support), biggest OI build-ups, ATM implied volatility, the ATM straddle's implied move and Greeks. Also lists the live expiries.

Inputs: symbol (required), expiry, rate_pct, strikes_each_side.

get_price_historyPrice history and statisticsA
Read-onlyIdempotent

Historical OHLCV bars plus total return, CAGR, annualised volatility, max drawdown, period high/low, moving averages (20/50/200-day), RSI and dividends/splits. Statistics use adjusted prices.

Inputs: symbol (required), period, max_bars, bar_interval.

get_quoteStock or index quoteA
Read-onlyIdempotent

Latest price and day range, 52-week range, volume, delivery %, market cap, P/E vs sector P/E, sector and index membership for an NSE stock. Index names return the index level, returns, P/E, P/B and breadth.

Inputs: symbol (required).

get_shareholdingShareholding patternB
Read-onlyIdempotent

Promoter and public shareholding by quarter from NSE filings, with the promoter stake's quarter-on-quarter and year-on-year change.

Inputs: symbol (required), quarters.

price_optionBlack-Scholes option calculatorA
Read-onlyIdempotent

Price a European option and its Greeks (delta, gamma, theta per day, vega, rho, probability of expiring in the money), or give market_price to back out implied volatility. Works offline.

Inputs: spot (required), strike (required), option_type (required), days_to_expiry (required), +4 more.

search_mutual_fundsSearch mutual fundsA
Read-onlyIdempotent

Find Indian mutual fund schemes and their AMFI scheme codes (needed for get_mutual_fund).

Inputs: query (required), plan, limit, option.

search_securitiesSearch NSE securitiesA
Read-onlyIdempotent

Find NSE symbols for a company, ETF or index by name. Use this whenever the exact symbol is unknown.

Inputs: query (required), limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.7/5.0

    Scored across 13 tools

    Disambiguation3/5

    Tools cover distinct resource types (securities, options, mutual funds, financials), but index-level data is available from three tools (get_quote, get_index, get_market_overview) and dividend/split data appears in both get_price_history and get_corporate_actions. Descriptions help scope each tool, but an agent may still misselect for broad index or corporate action queries.

    Naming Consistency5/5

    All names use snake_case with consistent verb_noun patterns: search_* for discovery, get_* for retrieval, and price_option as the only non-get verb. The single deviation is minor and still predictable.

    Tool Count5/5

    13 tools cover equities, indices, options, mutual funds, and financials without obvious redundancy. Each tool adds a distinct capability within the Indian market data scope.

    Completeness4/5

    The surface is broad, covering search, quotes, history, options, financials, shareholding, corporate actions, announcements, and mutual funds. Minor gaps exist (e.g., mutual fund NAV history, futures, or deeper option analytics), but core workflows are supported.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Indian stock market (NSE & BSE) MCP server with 55 tools: live quotes, financials, technicals, a 326-ratio screener, FII/DII flows, option chains with IV, parsed annual reports and concall transcripts, IPOs and portfolio tracking for ~8,200 stocks.
      55
      229 npm
      147
      MIT
    • F
      license
      C
      quality
      D
      maintenance
      Enables AI assistants to access National Stock Exchange of India (NSE) data, including live quotes, market status, indices, option chains, corporate actions, and historical data, through natural language.
      24
      1
      -
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI assistants to search, screen, and analyze 8,200+ NSE and BSE listed securities through 55 tools covering live quotes, financials, technical indicators, FII/DII flows, option chains, filings, IPOs, bulk deals, and portfolio P&L.
      -