NSE MCP Explorer

NSE MCP — Research Findings

Research date: 6 October 2026 (IST). Everything marked ✅ was verified by sending real MCP/HTTP requests to the live servers from this machine; everything else is cited from the official page. Where the official page and the live servers disagree, the live servers win.

Primary sources:

Secondary sources (community projects, not used as authority): several unofficial “NSE MCP” servers on GitHub (e.g. manitgupta/NSE-MCP, GirishKumarDV/Live-NSE-BSE-MCP) scrape NSE’s website. They are unrelated to NSE’s official servers and were not used.


1. What is MCP?

The Model Context Protocol is an open standard that lets an application (typically an AI assistant) discover and call capabilities exposed by a server. Messages are JSON-RPC 2.0. A server can expose tools (callable functions with a JSON Schema for inputs), resources (readable data) and prompts (templates). A session is:

initialize  →  notifications/initialized  →  tools/list  →  tools/call …

2. How NSE implements MCP

Question Finding
Number of servers Two ✅ — cm-market-mcp 1.0.0 (live Capital Market) and nse-bhavcopy-redis-mcp 1.0.0 (end-of-day Bhavcopy)
Transport Streamable HTTP ✅ (POST JSON-RPC; responses are application/json for initialize, text/event-stream (one SSE message event) for other requests)
Protocol version 2025-06-18 ✅ (server echoes the client’s requested version)
Implementation Java, Spring WebFlux + the official MCP Java SDK ✅ (WebFluxStreamableServerTransportProvider appears in an error stack trace); Redis-backed caches; fronted by Akamai
Authentication None ✅ — no API key, no OAuth, no login. NSE’s own setup instructions say “Authentication: No Auth”.
Special headers Accept: application/json, text/event-stream is required ✅ (only application/json → HTTP 400). Content-Type: application/json.
Sessions Stateful ✅. initialize returns Mcp-Session-Id; later requests must send it. Unknown session id → HTTP 404 (with a Java stack trace in the body). Requests without a session id were also accepted for tools/list.
Session termination DELETE is not supported ✅ — Akamai answers “Unsupported Request”. Clients should not send it (Python SDK: terminate_on_close=False).
Server→client stream GET (SSE listen stream) is accepted but stays idle ✅; NSE never pushes messages.
Capabilities declared tools {listChanged:true}, prompts {listChanged:true}, resources {subscribe:false}, logging, completions ✅
Prompts / resources Declared, but empty lists ✅ — tools are the only real capability.
Server instructions Both servers send instructions describing data sources, freshness and a SEBI disclaimer ✅
CORS Access-Control-Allow-Origin lists only NSE’s own domains; a preflight from http://localhost:5173 gets HTTP 403 ✅. A browser page cannot call NSE MCP directly — you need a backend.
Rate limits None documented, no rate-limit headers. Observed ✅: after bursts of requests, Akamai sometimes tarpits a client (TCP+TLS succeed, the request then hangs until timeout) for roughly 1–3 minutes. The effect appeared to be keyed on client fingerprint (User-Agent): one UA would hang while another was answered. This project does not rotate User-Agents — doing so would be evading NSE’s controls. It sends one honest UA, limits concurrency, spaces requests and caches results.
Availability Observed ✅ periods of origin errors: 504 Gateway Time-out and 502 Bad Gateway from the CM Market server, and later full timeouts on both servers. Expect intermittent outages.
Usage restrictions From the official disclaimer: informational/educational use only, not for commercial purposes, no licence to train or fine-tune AI models on the data, no warranty; subject to NSE’s Terms of Use, Disclaimer and Privacy Policy. Tool descriptions carry a SEBI “not investment advice” disclaimer.

Official client setup (from the NSE page)

{
  "mcpServers": {
    "nse-bhavcopy": { "url": "https://mcp.nseindia.in/bhavcopy/cm/mcp", "transport": "streamable-http" },
    "cm-market":    { "url": "https://mcp.nseindia.in/cmmkt/mcp",       "transport": "streamable-http" }
  }
}

NSE documents setup for Claude Desktop (config file), Claude custom connectors (Settings → Connectors → Add custom connector) and ChatGPT developer mode (No Auth, Streamable HTTP).

3. Data provided

Server Data Freshness (from server instructions / status tools)
CM Market Live Live CM snapshot: per-security quote (LTP, OHLC, change, volume, value, 52-week range, 30-day change), gainers/losers feeds by segment (NIFTY, BANKNIFTY, NIFTYNEXT50, F&O securities, >₹20, <₹20, all), segment listings (equity 3,100 · SME 554 · call auction 771 · bonds/other 2,448 · total 6,102 at research time) All-stocks cache crawled every 1 min; gainers/losers every 5 min; Redis TTL 15 min. NSE’s page: “1–3 minutes behind real-time”. Stale outside 09:15–15:30 IST.
NSE Bhavcopy Daily OHLCV for ~5,000 NSE equities over 5 years, breadth, movers, most-active, volume analysis, SMA, 52-week range, comparisons; corporate actions fetched from NSE and cached 24 h Updated daily with the previous trading day’s final Bhavcopy

4. Tool inventory (26 tools)

Discovered with tools/list on both servers ✅. Every input property is marked required in the schemas; descriptions explain defaults (0 or ""). No tool declares an outputSchema or annotations. Full matrix: NSE_MCP_CAPABILITIES.md.

CM Market Live (13): cm_get_data_status, cm_get_allstocks_status, cm_get_stock_quote, nse_get_market_movers, nse_get_gainers, nse_get_losers, cm_get_live_gainers, cm_get_live_losers, cm_get_live_market_data, cm_get_equity_stocks, cm_get_sme_stocks, cm_get_bond_stocks, cm_get_call_auction_stocks.

NSE Bhavcopy (13): nse_lookup_symbol, search_symbols, get_stock_history, get_ltp_by_date, get_bulk_quote, get_top_movers, get_top_by_volume, get_volume_analysis, get_market_breadth, moving_average, get_52_week_high_low, compare_stocks, get_corporate_actions.

5. Response structure

Every result is a CallToolResult with one text content block ✅:

Units observed: cm_get_stock_quote.value is ₹ crore; nse_get_market_movers.turnover is ₹ lakh; volumes are share counts; timestamps are UTC ISO-8601 (updatedAt, lastCrawled) or IST local strings (latestTimestamp).

6. Quirks and defects found during testing

# Finding Impact / handling
1 nse_get_gainers and nse_get_losers return {"error":"Failed to parse cached data: class java.util.ArrayList cannot be cast to class java.util.Map …"} Server-side bug. Use nse_get_market_movers. Flagged in the UI.
2 Invalid or out-of-window dates (e.g. 2019-01-01, 05-10-2026) are not rejected — breadth/movers silently answer for the latest trading day Compare the returned date with the requested date.
3 Integer arguments are clamped silently (get_volume_analysis.days=9999 → 252) Read days_analysed.
4 deliveryQty is present in history rows but always 0 Delivery analysis is not possible.
5 Prices are unadjusted for splits/bonuses (NSE’s own descriptions warn about this) Use get_corporate_actions and back-adjust (implemented in shared/analytics.ts).
6 get_stock_history’s description refers to a get_price_performance tool, and the NSE page lists “Price performance & returns” — no such tool is exposed Documented; returns are available via compare_stocks and get_stock_history.summary.
7 cm_get_live_market_data expects "loosers" (NSE’s spelling) Offered as a choice in the UI.
8 search_symbols returns delisted symbols with an old last_date Shown in the UI.
9 Unknown session id → HTTP 404 with a full Java stack trace in the body Client reconnects automatically.

7. What NSE MCP does not provide (despite expectations)

The NSE page’s marketing copy mentions derivatives, indices, “tick data, order book depth, trade feed”. The live servers expose none of these:

8. Implications for this project’s architecture

  1. A backend is mandatory for a web UI (CORS). The backend is the MCP client.
  2. TypeScript is the natural fit: the official MCP TypeScript SDK has a first-class Streamable HTTP client, the UI is TypeScript, and the same types can be shared.
  3. Pandas is unnecessary: responses are small (≤ ~40 KB), NSE already does the heavy aggregation server-side, and the missing analytics (adjustment, EMA, RSI, volatility, drawdown, relative volume) are a few dozen lines of pure functions.
  4. Politeness and resilience are features: concurrency limit, request spacing, short cache, timeouts, reconnect-on-session-loss, honest User-Agent, no UA rotation.
  5. Offline mode is essential for tests and demos because NSE availability varies — hence the fixture-replaying mock MCP server.