
manitgupta/nse-mcp
Developer toolsЭта страница переведена автоматически. Технические детали смотрите в оригинале. Открыть оригинал
Сервер MCP для сбора структурированных данных для фондового рынка Индии
Обзор
Сервер MCP (Model Context Protocol), который предоставляет живые данные о фондовом рынке Индии клиентам LLM, таким как Claude Desktop, Cursor, VS Code и любой другой MCP-совместимый хост. Модель была смоделирована после OpenInsider-MCP, но полностью построена на основе общедоступных API данных NSE India. Все инструменты возвращаются набранными JSON. Никаких оценок, никаких рекомендаций — чистый уровень данных. Сервер использует собственный API и AbortSignal.timeout(), оба из которых требуют Node 18+. Узел 20 является активным LTS и рекомендуется. Это компилирует источник TypeScript в src/to dist/. Точка входа - dist/index.js. Сервер общается поверх (стандартный вход/выход) — он, кажется, висит, потому что он ждет сообщений MCP. Это правильно. Нажмите Ctrl+C, чтобы выйти. Сервер работает из коробки без необходимой конфигурации. Доступна одна дополнительная переменная среды: Вы также можете установить его в конфигурацию клиента MCP (см. Ниже).
Обзор (машинный перевод)
Сервер MCP (Model Context Protocol), который предоставляет живые данные фондового рынка Индии от ** Национальной фондовой биржи (NSE)** клиентам LLM, таким как Claude Desktop, Cursor, VS Code и любой другой MCP-совместимый хост.
Модель была смоделирована после OpenInsider-MCP, но полностью построена на основе общедоступных API данных NSE India.
Что это дает
17 инструментов в пяти категориях:
| Категория | Инструменты
[скрыто] [скрыто]
[[Т]], [[Т1]], [[Т2], [[Т3]], [[Т4]], [[Т5]], [[Т6]], [[Т]], [[Т]], [[Т]], [[Т]]], [[Т]], [[Т]], [[Т]]], [[Т]], [[Т]], [[Т]], [[Т]]], [[Т]], [[Т]], [[Т]], [[Т]], [[Т]], [[Т]]], [[Т]], [[Т]], [[Т]], [[Т]], [[Т]], [[Т]]], [[Т]], [[Т]], [[Т]], [[Т]], [[Т]]], [[Т]], [[Т]], [[Т]], [[Т]], [[Т]]], [[Т]
Институциональные потоки get_fii_dii_activity
Рыночные данные get_quote, get_market_status, get_nifty_indices, get_top_gainers, get_top_losers, get_most_active
Корпоративные события get_nse_announcements, get_corporate_actions
Краткие данные get_short_selling
Все инструменты возвращаются набранными JSON. Никаких оценок, никаких рекомендаций — чистый уровень данных.
Требования
Обязательство | Версия | [скрыто] [скрыто] | Node.js | ≥ 20 | npm | ≥ 8 (в комплекте с Node 20) | Гит, гит. Последняя версия
Почему именно Node 20? Сервер использует собственный API fetch и ‘AbortSignal.
Эта страница переведена автоматически. Технические детали смотрите в оригинале.
README
Показан фрагмент оригинального README. Открыть оригинал.
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 | get_bulk_deals, get_block_deals, get_insider_trading, get_latest_bulk_deals, get_top_bulk_buys, get_top_bulk_sells, search_by_symbol |
| Institutional flows | get_fii_dii_activity |
| Market data | get_quote, get_market_status, get_nifty_indices, get_top_gainers, get_top_losers, get_most_active |
| Corporate events | get_nse_announcements, get_corporate_actions |
| Short data | get_short_selling |
All tools return typed JSON. No scoring, no recommendations — pure data layer.
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-mcp
2. Install dependencies
npm install
3. Build
npm run build
This compiles the TypeScript source in src/ to dist/. The entry point is dist/index.js.
4. Verify it starts
node dist/index.js
The 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 |
|---|---|---|
NSE_MCP_UA |
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
Установка
This server does not publish a one-line install command.
Open the repository installation guide Новичок в MCP? Начните с руководства на mcpskill.org →Конфигурация
{
"mcpServers": {
"nse-mcp": {
"command": "node",
"args": ["/absolute/path/to/nse-mcp/dist/index.js"]
}
}
}