MN

manitgupta/nse-mcp

Developer tools

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。 原文を見る

17 stars 7 forks 品質 77 トレンド 21Apache-2.0

インド株式市場向けの構造データを引き出すMCPサーバー

概要

Claude Desktop、Cursor、VS Code、その他のMCP対応ホストなどのLLMクライアントからインドの株式市場データを公開するMCP(Model Context Protocol)サーバー。 OpenInsider-MCP をモデル化し、NSE India のパブリックデータ API の周辺に完全に組み込まれています。 全てのツールが JSON をタイプしました。 スコアリング、推奨なし — 純粋なデータレイヤー。 サーバは、Node 18+ を必要とするネイティブ fetch API と AbortSignal.timeout() を使用します。 Node 20はアクティブLTSであり、推奨されます。 これは、src/ の TypeScript ソースをdist/ にコンパイルします。 エントリーポイントはdist/index.jsです。 サーバは(標準入力/出力)を通信します。MCP メッセージの待ち合わせのため、ハング表示されます。 それは正しいです。 Ctrl+Cを押して終了します。 サーバは、必要な設定がない場合、ボックスから出力されます。 任意環境変数は1つ利用できます: また、MCP クライアント config でインライン設定することもできます。(下記参照).

概要(AI 翻訳)

MCP (Model Context Protocol) サーバは、National Stock Exchange (NSE) から Claude Desktop、 Cursor、VS Code、その他 MCP 互換ホストなどの LLM クライアントに、インドの株式市場データを公開しています。

OpenInsider-MCP をモデル化し、NSE India のパブリックデータ API の周辺に完全に組み込まれています。

お問い合わせ

それが提供するもの

5つのカテゴリに17のツール:

| カテゴリー | ツール | お問い合わせ | バルク・ブロック・インサイダー取引 | get_bulk_deals, [[[T1], [get_insider_trading], [[get_latest_bulk_deals]], [get_top_bulk_sells, [search_by_symbol]]
| 組織の流れ | [[T7] | | 市場データ | [[T8], get_market_status, [[T10], [get_top_gainers], [get_top_losers], [[get_most_active]], [[[get_nifty_indices]]], [[[[get_top_gainers]]]]], [[get_top_losers]]]], [[[[get_most_active]]]]], [[[[[[[get_nifty_indices]]]]], [[[[[[[[[[[[[[[[get_nifty_indices]]]]]]]]]]]]]]]]], [[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[[ | 企業イベント | [[T14], get_corporate_actions | | ショートデータ | [[T16] |

全てのツールが JSON をタイプしました。 スコアリング、推奨なし — 純粋なデータレイヤー。

お問い合わせ

要件

| 条件 | バージョン | お問い合わせ | Node.js | ≥ 20 | | npm | ≥ 8 (Node 20 で公開) | | ジット | 最近のバージョン |

なぜNode 20? サーバは、ネイティブ [fetch] API と `AbortSignal を使用します.

このページは AI により自動翻訳されています。技術的な詳細は原文をご確認ください。

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 fetch API and AbortSignal.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:

  1. Fetches https://www.nseindia.com to obtain initial cookies.
  2. Fetches the live-equity-market page with those cookies to complete the session.
  3. Caches the session for ~7 minutes, then refreshes transparently.

No manual login or API key is needed.


Adding to an MCP client

GitHub で README 全文を見る

インストール

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"] } } }