All essays

Tech

The Source Built the Socket

NSE India now publishes its own MCP servers, so any AI assistant can query the exchange's data in plain English. A look at what it offers, how it works, and the limits it states up front.

18 November 20265 min read

mcpintegrationllmsystems-thinking

The National Stock Exchange of India has published its own Model Context Protocol servers. You add two URLs to Claude or ChatGPT, then ask questions about Indian equities in plain English. There's no account, no API key and no download.

That sounds like a small convenience. It's actually a change in who owns the integration.

What MCP is, briefly

Model Context Protocol is a standard way for AI assistants to reach outside data. NSE's own description is a plug and socket: the exchange provides the socket, and the assistant plugs in. Once connected, the assistant can call NSE's tools whenever a question needs real numbers.

So the model isn't guessing from training data or reading a cached web page. It calls a function the exchange exposes and gets back structured data from NSE's own records.

What NSE actually shipped

There are two servers.

  • nse-bhavcopy: end-of-day data for around 3,500 listed equities, going back five years. It's updated after market hours on every trading day with that day's final numbers.
  • cm-market: live cash-market data such as gainers, losers, stock quotes and live index values, delayed by one to three minutes.

Between them there are more than 35 tools, and each one answers one kind of question. get_ltp_by_date returns the close on a given date. get_market_breadth counts advances and declines. moving_average, get_52_week_high_low, compare_stocks, get_volume_analysis and get_stock_vs_index do what their names suggest. On the index side, get_index_performance, get_index_movers and get_index_valuation cover returns, contributors, and P/E and P/B ratios.

You don't choose the tool. You ask "did more stocks rise or fall in the last session?" and the assistant picks one. For 17 November 2026 that question came back as 1,749 advances, 1,895 declines and an A/D ratio of 0.92, from a single call.

Setting it up

In Claude you open Settings → Connectors, add a custom connector named nse-bhavcopy with the URL https://mcp.nseindia.in/bhavcopy/cm/mcp, then add a second one named cm-market with https://mcp.nseindia.in/cmmkt/mcp. Turn both on in a new chat, and that's it. ChatGPT's paid plans support the same thing. On team and enterprise plans, an admin adds the connectors first.

NSE suggests a first question to check the connection: "How did the market close today? Show the top 5 stocks by turnover." The assistant calls breadth and volume tools and replies with a short summary and a table.

Why it matters that the source built it

Anyone who has pulled data from a website without an official interface knows how fragile that is. A field gets renamed and the parser breaks quietly. A page gets redesigned and the scraper returns nothing, with no error. You end up depending on behaviour nobody promised you.

When the data owner publishes the interface, the contract moves to the people who understand the data. They decide what each tool means, what it returns and how it should be used. That's the real shift here. AI is just the first audience that speaks the protocol.

A good interface states its limits

The most useful part of NSE's page isn't the tool count. It's the notes.

Old prices aren't adjusted for splits or bonus issues. NSE tells you to add "check for splits or bonuses" to any long-range question. The get_corporate_actions tool goes further: its description tells the model to call it before reading price history, and it returns an adjustment factor, so a 1:1 bonus doesn't look like a 50% crash.

Holidays are handled. Ask for 2 October 2026, Gandhi Jayanti, and you get the close of 1 October. "Last trading session" works better than "yesterday".

History comes in pieces. Each history call returns up to three months, so for a year the assistant makes several calls on its own.

There's no tick data. End-of-day numbers are final, intraday numbers are a few minutes old, and there's no order book.

This kind of knowledge usually lives in someone's head, or in a comment nobody reads. Here it sits in the tool descriptions, where the model reads it on every call. What a model is told about the data shapes the answer as much as the model itself.

The boundaries are written down too

NSE is just as clear about use. The data is for information and learning. It isn't for real-time trading, commercial products, or training or fine-tuning AI models. Whatever an assistant says is the assistant's output, not NSE's view, and none of it is investment advice.

That's a sensible line to draw, and drawing it in public is the right way to do it. The expensive surprises in any integration come from boundaries nobody wrote down.

The pattern worth copying

NSE didn't ship an "AI feature". It shipped its data, described well enough that any capable client can use it correctly. That's a more durable thing to build, and I'd like to see more data owners, public and private, do the same.

The best integrations are built by whoever owns the data.