NSE MCP Server Wrapper

Python Wrapper Around NSE’s Own Official MCP Server

NSE runs its own official, free, no-auth-required MCP (Model Context Protocol) server at mcp.nseindia.in — announced by NSE itself at nseindia.com/nse-mcp. It serves historical OHLCV data, corporate actions, index valuation ratios, moving averages, 52-week highs/lows, live quotes, market movers and more — 36 tools in total, across two separate endpoints.

This matters because it’s a second, independent data path: it isn’t the scrape-based nseindia.com website this library normally talks to via nsefetch(), so it is not subject to the Akamai Bot Manager issues documented throughout the rest of this site. No session warm-up, no TLS fingerprint dance, no API key — just a plain HTTP call to NSE’s own server. Treat it as the more reliable option whenever the data you need happens to be covered by one of its 36 tools.

TIP

Every function here is prefixed nse_mcp_ so you can tell at a glance which data path a line of code is using. Get it the same way as everything else in this library — pip install --upgrade nsepython (or nsepythonserver).

Function Naming

Each of the 36 tools below gets its own nse_mcp_-prefixed function, named after the tool itself — e.g. the get_stock_history tool is called as nse_mcp_get_stock_history(...), and the cm_get_stock_quote tool is called as nse_mcp_cm_get_stock_quote(...). Arguments match the tool’s own parameter names shown below (symbol, date, months, etc).

Two extra helper functions sit on top of the 36:

  • nse_mcp_list_tools() — discovery. Returns the live tool list (name, description, input schema) straight from both endpoints, so you can check exact parameter names without leaving Python.
  • nse_mcp_call(tool_name, **kwargs) — the generic escape hatch. Calls any of the 36 tools by its exact name, including ones that don’t have a dedicated wrapper function yet. Useful if NSE adds a 37th tool before this library catches up.

All 36 Tools

Grouped the same way NSE itself splits them — two separate streamable-HTTP endpoints under mcp.nseindia.in.

Historical & Analytics — 21 tools (/bhavcopy/cm/mcp)

  • get_stock_history — Daily OHLCV history for a stock, up to 3 months per call (chainable for longer spans via next_end_date).
  • get_index_history — Daily OHLC + turnover + P/E/P/B/dividend-yield history for an index, up to 12 months per call.
  • get_index_snapshot — End-of-day values (OHLC, turnover, P/E, P/B, dividend yield) for all ~170 NSE indices on one date.
  • get_index_performance — An index’s 1-day change plus 1W/1M/3M/6M/1Y/2Y returns, and its 52-week high/low.
  • get_index_valuation — An index’s P/E, P/B and dividend yield, plus where today’s value sits within its own recent range (min/max/median/percentile).
  • get_index_movers — Top gaining and top losing indices for a day or a period (1D/1W/1M/3M/6M/1Y) — sector/theme rotation.
  • compare_indices — Return, annualised volatility, max drawdown and valuation for 2–10 indices side by side.
  • get_corporate_actions — Splits, bonuses, dividends and other corporate actions for a stock, with exact ex-dates and an adjustment factor for each.
  • get_stock_vs_index — A stock’s return vs. a benchmark index — outperformance, beta and correlation, already corporate-action adjusted.
  • compare_stocks — Side-by-side % return and max drawdown for up to 10 stocks over a period.
  • get_52_week_high_low — 52-week high/low for a stock, with dates and % distance from the current price.
  • moving_average — Simple moving average (SMA) of close price over the last N trading days.
  • get_volume_analysis — Volume trend analysis for a stock — average, max/min, spike days (>2× average), recent 5-day trend.
  • get_top_by_volume — Top N most actively traded stocks on a date, sorted by volume or by turnover value.
  • get_top_movers — Top N gaining or losing stocks on a date, with full OHLCV detail.
  • get_market_mood — India VIX level/direction plus index and stock advance/decline breadth for a day — a factual read, not a signal.
  • get_market_breadth — Advances/declines/unchanged counts, A/D ratio and total volume for the whole market on a date.
  • get_ltp_by_date — Last traded (close) price for one symbol on a specific date.
  • get_bulk_quote — Latest price snapshot (OHLC, prev close, % change, volume) for up to 50 symbols in one call.
  • search_symbols — Search NSE symbols by company name or partial keyword, with latest close price and % change.
  • nse_lookup_symbol — Look up the exact NSE ticker for a partial name/keyword — tickers only, no price data, faster than search_symbols.

Live Market Data — 15 tools (/cmmkt/mcp)

Refreshes every 1–5 minutes during market hours (09:15–15:30 IST, Mon–Fri); stale outside that window.

  • cm_get_stock_quote — Full live quote for one symbol, any segment (equity, SME, bond, call-auction).
  • cm_get_index_quote — Full live quote for one named index — value, change, day range, 52-week range, 1W/1M/1Y comparison.
  • cm_get_live_indices — Latest values for ~140 indices across six groups (derivatives, broad, sectoral, strategy, thematic, fixed-income).
  • cm_get_equity_stocks — Live data for all EQUITY-series stocks (EQ, BE, BL, BT, IL, IQ).
  • cm_get_sme_stocks — Live data for SME-segment stocks (SM, ST series).
  • cm_get_bond_stocks — Live data for NSE bonds / debt instruments.
  • cm_get_call_auction_stocks — Live data for Call Auction session stocks (CA, CB series).
  • nse_get_market_movers — The primary “top gainers/losers today” tool — both ranked lists in one call.
  • nse_get_gainers — Top N stocks by % gain, flattened across all indices and sorted descending.
  • nse_get_losers — Top N stocks by % loss, flattened across all indices and sorted ascending.
  • cm_get_live_gainers — Raw NSE gainers data grouped by index segment (NIFTY, BANKNIFTY, allSec, etc) — unsorted; use nse_get_gainers for a flat ranked list.
  • cm_get_live_losers — Raw NSE losers data grouped by index segment — unsorted; use nse_get_losers for a flat ranked list.
  • cm_get_live_market_data — Live gainers or losers for a specific segment, raw NSE response shape.
  • cm_get_data_status — Freshness check — when gainers/losers data was last crawled from NSE.
  • cm_get_allstocks_status — Freshness check for the all-stocks cache, with per-segment stock counts.

Example 1: Stock History

Input

				
					from nsepython import *
print(nse_mcp_get_stock_history("RELIANCE", months=1, end_date="2026-10-06"))
				
			

Output

				
					     symbol series     ltp    open    high     low   close  prevClose    volume  totalTradedValue  ch52WeekHigh  ch52WeekLow mktType  deliveryQty        date
0  RELIANCE     EQ  1309.5  1323.1  1324.2  1301.9  1309.5     1322.0  10210522       1.336388e+10           0.0          0.0       N            0  2026-09-07
1  RELIANCE     EQ  1294.9  1304.1  1306.8  1288.0  1294.9     1309.5   9799528       1.268232e+10           0.0          0.0       N            0  2026-09-08
...
19 RELIANCE     EQ  1218.0  1188.1  1219.1  1188.1  1218.0     1186.4  18003127       2.181205e+10           0.0          0.0       N            0  2026-10-06

[20 rows x 15 columns]
				
			

Real output, captured live against mcp.nseindia.in on 2026-10-08. Note this is a Pandas DataFrame, not the JSON shape this page used to show — nse_mcp_get_stock_history() (like every other nse_mcp_ wrapper in this library) parses the tool’s JSON response into a DataFrame for you rather than returning raw JSON. Also note the UNADJUSTED PRICES warning NSE bakes right into this tool’s own description — these are raw bhavcopy prices with no split/bonus adjustment. Cross-check against get_corporate_actions() before trusting a big single-day move.

Example 2: Live Quote

Input

				
					print(nse_mcp_cm_get_stock_quote("RELIANCE"))
				
			

Output

				
					{
  "updatedAt": "2026-10-07T15:58:26.947403554Z",
  "stock": {
    "type": "CM",
    "symbol": "RELIANCE",
    "series": "EQ",
    "openPrice": 1212.0,
    "highPrice": 1220.8,
    "lowPrice": 1203.5,
    "preClosePrice": 1218.0,
    "lastTradedPrice": 1207.7,
    "change": -10.3,
    "perChange": -0.85,
    "volume": 11880731,
    "fiftyTwoWeekHigh": 1611.8,
    "fiftyTwoWeekLow": 1160.8,
    "perChange30d": -7.77,
    "latestTimestamp": "2026-10-07 16:00:27"
  }
}
				
			

Again, real output captured live. This is the /cmmkt/mcp endpoint — only populated during/after market hours, same caveat as above.

Discovery & The Escape Hatch

				
					from nsepython import *

# nse_mcp_list_tools() with no args returns a dict keyed by server name
# ("bhavcopy" / "cmmkt"), each value a list of that server's tool dicts --
# so iterate per server, not the dict itself:
for server in ("bhavcopy", "cmmkt"):
    for tool in nse_mcp_list_tools(server=server):
        print(server, "->", tool["name"])

# Call any tool by name directly -- works even for the 36 above
# without waiting for a dedicated nse_mcp_<name> wrapper. Real signature is
# nse_mcp_call(server, tool_name, **kwargs) -- the server is required too:
print(nse_mcp_call("bhavcopy", "get_market_mood", date="today"))
				
			

Official Source

This wrapper just talks to NSE’s own server — it doesn’t scrape or reverse-engineer anything. For the authoritative tool definitions, disclaimers and any changes NSE makes on their end, see nseindia.com/nse-mcp directly.

WARNING

Every tool response carries NSE’s own SEBI disclaimer: this data is for educational/research purposes, not investment advice. A few tools (get_stock_history, get_top_movers, compare_stocks, get_52_week_high_low) explicitly warn that prices are unadjusted for splits/bonuses — call nse_mcp_get_corporate_actions() alongside them and cross-check before presenting a big move as real.

Join The Conversation?