NSE-MCP
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@NSE-MCP get quote for RELIANCE"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
NSE MCP
An MCP (Model Context Protocol) server that exposes live Indian stock market data from the National Stock Exchange (NSE) to LLM clients like Claude Desktop, Cursor, VS Code, and any other MCP-compatible host.
Modelled after OpenInsider-MCP but built entirely around NSE India's public data APIs.
What it provides
17 tools across five categories:
Category | Tools |
Bulk / Block / Insider deals |
|
Institutional flows |
|
Market data |
|
Corporate events |
|
Short data |
|
All tools return typed JSON. No scoring, no recommendations — pure data layer.
Related MCP server: Tapetide - Indian Stock Market MCP
Requirements
Requirement | Version |
Node.js | ≥ 20 |
npm | ≥ 8 (bundled with Node 20) |
Git | Any recent version |
Why Node 20? The server uses the native
fetchAPI andAbortSignal.timeout(), both of which require Node 18+. Node 20 is the active LTS and is recommended.
Installation
1. Clone the repository
git clone https://github.com/manitgupta/nse-mcp.git
cd nse-mcp2. Install dependencies
npm install3. Build
npm run buildThis compiles the TypeScript source in src/ to dist/. The entry point is dist/index.js.
4. Verify it starts
node dist/index.jsThe server communicates over stdio (standard input/output) — it will appear to hang because it is waiting for MCP messages. That is correct. Press Ctrl+C to exit.
Configuration
The server works out of the box with no required configuration. One optional environment variable is available:
Variable | Default | Description |
| Chrome 120 UA string | Override the User-Agent sent to NSE and Yahoo Finance. Useful if NSE starts blocking the default UA. |
Setting the environment variable
macOS / Linux
export NSE_MCP_UA="Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 Chrome/121.0.0.0 Safari/537.36"Windows (PowerShell)
$env:NSE_MCP_UA = "Mozilla/5.0 ..."You can also set it inline in your MCP client config (see below).
How NSE session auth works
NSE India's API requires browser-like cookies. On the first request the server automatically:
Fetches
https://www.nseindia.comto obtain initial cookies.Fetches the live-equity-market page with those cookies to complete the session.
Caches the session for ~7 minutes, then refreshes transparently.
No manual login or API key is needed.
Adding to an MCP client
In all configs below, replace /absolute/path/to/nse-mcp with the actual path where you cloned the repo.
Claude Desktop
Edit ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"nse-mcp": {
"command": "node",
"args": ["/absolute/path/to/nse-mcp/dist/index.js"]
}
}
}With an env override:
{
"mcpServers": {
"nse-mcp": {
"command": "node",
"args": ["/absolute/path/to/nse-mcp/dist/index.js"],
"env": {
"NSE_MCP_UA": "Mozilla/5.0 ..."
}
}
}
}Restart Claude Desktop after saving.
VS Code (GitHub Copilot / Continue)
Add to .vscode/mcp.json in your workspace, or to your user settings:
{
"servers": {
"nse-mcp": {
"type": "stdio",
"command": "node",
"args": ["/absolute/path/to/nse-mcp/dist/index.js"]
}
}
}Cursor
Edit ~/.cursor/mcp.json:
{
"mcpServers": {
"nse-mcp": {
"command": "node",
"args": ["/absolute/path/to/nse-mcp/dist/index.js"]
}
}
}Any stdio-based MCP host
command: node
args: ["/absolute/path/to/nse-mcp/dist/index.js"]Tool reference
get_bulk_deals
Today's NSE bulk deals — single-client trades of ≥ 0.5% of a company's listed shares in one session.
Parameter | Type | Description |
| string | NSE symbol (e.g. |
|
| Direction filter. Default: |
get_block_deals
Today's NSE block deals — negotiated trades of minimum ₹10 crore executed in the Block Deal Window.
Parameter | Type | Description |
| string | NSE symbol. Omit for all. |
|
| Direction filter. Default: |
get_insider_trading
SEBI PIT (Prohibition of Insider Trading) disclosures — promoter and insider buy/sell transactions.
Parameter | Type | Description |
| string | NSE symbol. Omit for all companies. |
| string |
|
| string |
|
get_latest_bulk_deals
Today's bulk deals sorted by trade value.
Parameter | Type | Description |
|
| Direction filter. Default: |
get_top_bulk_buys
Largest bulk-deal purchases today, ranked by total value (quantity × price).
Parameter | Type | Description |
| number | Results to return. Default: |
| string | Restrict to one symbol. |
get_top_bulk_sells
Largest bulk-deal sales today, ranked by total value.
Parameter | Type | Description |
| number | Results to return. Default: |
| string | Restrict to one symbol. |
get_fii_dii_activity
Daily FII and DII net buy/sell figures in the Indian cash market.
Parameter | Type | Description |
| number | Number of recent trading days. Default: |
get_nse_announcements
Corporate announcements filed with NSE — board meetings, results, mergers, regulatory updates, etc. (equivalent to SEC 8-K filings).
Parameter | Type | Description |
| string | NSE symbol. Omit for all. |
| number | Announcements from the last N days. Omit for no date filter. |
| number | Maximum results. Default: |
get_market_status
Current open/closed status of NSE segments (Capital Market, F&O, Currency Derivatives, Commodity) plus live index levels.
No parameters.
get_nifty_indices
Live data for all NSE indices — price, change, 52-week range, advances/declines count.
Parameter | Type | Description |
| string | Partial, case-insensitive filter. E.g. |
get_top_gainers
Top gaining stocks by % change in the current session.
Parameter | Type | Description |
| string | NSE index to scan. Default: |
| number | Results to return. Default: |
get_top_losers
Top losing stocks by % change in the current session.
Parameter | Type | Description |
| string | NSE index to scan. Default: |
| number | Results to return. Default: |
get_most_active
Most actively traded stocks by total traded value (₹) in the current session.
Parameter | Type | Description |
| string | NSE index to scan. Default: |
| number | Results to return. Default: |
search_by_symbol
Aggregated view for one stock — returns today's bulk deals, block deals, recent insider trades, and recent announcements in a single call.
Parameter | Type | Description |
| string | NSE symbol. Required. |
| number | Look-back window for insider trades and announcements. Default: |
get_quote
Live stock quote via Yahoo Finance. Returns price, 52-week range, volume, market cap, P/E ratios, dividend yield, and next earnings date. Prices are in INR.
Parameter | Type | Description |
| string | NSE symbol (e.g. |
get_short_selling
Short-selling data as reported by brokers to NSE under SEBI's short-selling framework.
Parameter | Type | Description |
| string | NSE symbol. Omit for all. |
| number | Return top N stocks by short-sold quantity. |
get_corporate_actions
Upcoming and recent corporate actions — dividends, stock splits, bonus issues, rights issues, buy-backs.
Parameter | Type | Description |
| string | NSE symbol. Omit for all companies. |
| string |
|
| string |
|
Example prompts
Once configured, you can ask your LLM client things like:
"What are today's biggest bulk deals on NSE?"
"Show me insider trades for RELIANCE in the last 30 days."
"What is the live quote for TCS?"
"Which Nifty 50 stocks are up more than 2% today?"
"What's the FII/DII flow for the last 5 trading days?"
"Give me all corporate actions for INFY this quarter."
"Show everything you know about HDFC — deals, announcements, insider activity."
Development
# Watch mode — recompiles on every save
npm run dev
# One-shot build
npm run build
# Start the compiled server
npm startProject structure
src/
├── index.ts # MCP server entry point — tool list + dispatch
├── types.ts # Shared TypeScript interfaces
├── cache.ts # In-memory TTL cache
├── http.ts # Rate-paced HTTP fetcher with retry
├── nse/
│ ├── session.ts # NSE cookie session management
│ └── fetch.ts # NSE API client (wraps http.ts + session)
├── yahoo/
│ ├── fetch.ts # Yahoo Finance HTTP config
│ ├── parseQuote.ts # Quote JSON parser
│ └── quoteSummary.ts
└── tools/ # One file per tool
├── bulkDeals.ts
├── blockDeals.ts
├── insiderTrading.ts
├── latestBulkDeals.ts
├── topBulkBuys.ts
├── topBulkSells.ts
├── fiiDiiActivity.ts
├── announcements.ts
├── marketStatus.ts
├── indices.ts
├── topGainers.ts
├── topLosers.ts
├── mostActive.ts
├── searchBySymbol.ts
├── quote.ts
├── shortSelling.ts
└── corporateActions.tsData sources
Data | Source |
Bulk deals, block deals, insider trading, FII/DII, indices, market status, announcements, corporate actions, short selling | NSE India public API ( |
Live stock quotes | Yahoo Finance ( |
All data is fetched in real time. NSE endpoints are cached for 5 minutes; live quotes and market status for 60 seconds.
License
MIT
Available Tools
17 toolsget_block_dealsB
Fetch today's NSE block deals — large negotiated trades (minimum ₹10 crore) executed in the Block Deal Window. Shows counterparty, quantity, and trade price.
Inputs: symbol, dealType.
get_bulk_dealsA
Fetch today's NSE bulk deals — trades where a single client buys or sells ≥0.5% of a company's listed shares in one session. Returns the buyer/seller, quantity, and weighted-average price.
Inputs: symbol, dealType.
get_corporate_actionsA
Upcoming and recent corporate actions — dividends, stock splits, bonus issues, rights issues, and buy-backs. Shows ex-date, record date, and payment date.
Inputs: symbol, toDate, fromDate.
get_fii_dii_activityA
Daily FII (Foreign Institutional Investor) and DII (Domestic Institutional Investor) net buy/sell figures in the Indian cash market. Key macro signal for market direction.
Inputs: limit.
get_insider_tradingA
Fetch SEBI PIT (Prohibition of Insider Trading) disclosures — promoter and insider buy/sell transactions reported to the exchanges. Shows acquirer name, category, shares before/after, and mode of acquisition.
Inputs: symbol, toDate, fromDate.
get_latest_bulk_dealsA
Convenience wrapper — returns today's bulk deals sorted by trade value, optionally filtered by direction.
Inputs: dealType.
get_market_statusA
Current NSE market status — whether Capital Market, F&O, Currency Derivatives, and Commodity segments are open or closed, plus live index levels.
Inputs: no named parameters.
get_most_activeA
Most actively traded NSE stocks by total traded value (₹) in the current session.
Inputs: index, limit.
get_nifty_indicesA
Live data for all NSE indices (Nifty 50, Nifty Bank, Nifty IT, Nifty Midcap 150, etc.) — price, change, 52-week range, advances/declines.
Inputs: name.
get_nse_announcementsB
Corporate announcements filed with NSE — board meetings, results, dividends, mergers, regulatory updates, etc. Equivalent to 8-K filings on SEC EDGAR.
Inputs: limit, symbol, daysBack.
get_quoteA
Live stock quote from Yahoo Finance for any NSE-listed stock. Includes price, 52-week range, volume, market cap, P/E ratios, dividend yield, and next earnings date. Prices are in INR.
Inputs: symbol (required).
get_short_sellingA
NSE short-selling data — quantity of shares sold short and second-leg (covering) quantities, as reported by brokers under SEBI's short-selling framework.
Inputs: limit, symbol.
get_top_bulk_buysA
Today's largest bulk-deal purchases ranked by total trade value (quantity × price). Useful for spotting institutional accumulation.
Inputs: limit, symbol.
get_top_bulk_sellsA
Today's largest bulk-deal sales ranked by total trade value. Useful for spotting institutional distribution.
Inputs: limit, symbol.
get_top_gainersA
Top gaining NSE stocks by percentage change for the current session within a given index.
Inputs: index, limit.
get_top_losersB
Top losing NSE stocks by percentage change for the current session within a given index.
Inputs: index, limit.
search_by_symbolA
Aggregate view for a single NSE stock — returns today's bulk deals, block deals, recent insider trades, and recent announcements in one call.
Inputs: symbol (required), daysBack.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 17 tools
Tools are mostly distinct, covering different data types (quotes, indices, deals, insider trading, etc.). However, the multiple bulk-deal tools (get_bulk_deals, get_latest_bulk_deals, get_top_bulk_buys, get_top_bulk_sells) could cause confusion as they overlap in purpose but differ in sorting/filtering.
All tool names follow a consistent verb_noun pattern using snake_case (e.g., get_quote, search_by_symbol, get_top_gainers). There is no mixing of conventions or ambiguous naming.
With 17 tools, the count is slightly above the typical well-scoped range, but each tool serves a clear purpose covering a breadth of NSE data. A few could be consolidated (e.g., the bulk-deal variants), but overall it's reasonable for the domain.
The tool set covers many essential NSE data points: quotes, indices, market status, top movers, bulk/block deals, insider trading, FII/DII activity, short selling, announcements, and corporate actions. Missing historical data and fundamental analysis, but the core real-time and regulatory data is well covered.
Related MCP Connectors
48 tools for ~8,000 NSE & BSE stocks: quotes, screener, financials, filings, FII/DII, options
Hosted MCP server for Indian NSE/BSE stock research: 59 tools for quotes, financials and ratios, peers, shareholding and pledge, filings with extracted facts, screens, F&O and FII/DII context. Source and freshness on every answer; no buy/sell calls.
NSE/BSE stock data via Tickertape as JSON: index lists, screener, 10-year fundamentals.
NSE India filings as JSON: announcements, ex-dates, board meetings, bulk deals, ratings. $3/1k
Related MCP Servers
- AlicenseNot gradedqualityDmaintenanceProvides real-time and historical Indian stock market data from NSE and BSE exchanges with 66 tools covering quotes, options chains, corporate actions, IPOs, and market analytics for LLM-powered financial analysis.54 npm14MIT
- AlicenseAqualityBmaintenanceIndian 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.55167 npm152MIT
- AlicenseAqualityCmaintenanceEnables AI assistants to query live NSE & BSE stock market data, with 55 tools covering quotes, financials, screeners, FII/DII flows, option chains, and company filings.55MIT
- AlicenseNot gradedqualityCmaintenanceProvides access to NSE India equity research data, including securities, Nifty 50 constituents and prices, historical data, financial results, shareholding patterns, corporate actions, announcements, earnings-call transcripts, bulk/block deals, short-selling disclosures, and XBRL documents.1PolyForm Noncommercial 1.0.0