NSE-FNO-MCP
Stores normalized NSE India F&O end-of-day bhavcopy data in a local DuckDB database and exposes tools to query contract history, list contracts, rank open-interest movers, and inspect database coverage.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
NSE-FNO-MCP
A Python Model Context Protocol (MCP) server for querying NSE India end-of-day Futures & Options (F&O) bhavcopy history.
Supported instrument classes
FUTSTK— stock futuresFUTIDX— index futuresOPTSTK— stock optionsOPTIDX— index options
The server downloads NSE UDiFF F&O daily archive ZIP files, normalizes the data and stores it in DuckDB. ChatGPT or another MCP client can query the local database using MCP tools.
Data limitations: This project targets end-of-day bhavcopy records, not intraday candles, tick data or a live option chain. NSE controls archive access and may change URL patterns, schemas, availability or automated-download rules. Verify sample records against NSE before using the data for research or trading.
MCP tools
Tool | Description |
| Download a bounded date range of daily archives and store them |
| Query contract-wise OHLC, volume, OI and change in OI |
| List symbols, expiries, instrument types and option sides |
| Rank contracts by daily change in OI |
| Inspect local database coverage |
Related MCP server: MF-NAV-MCP
Quick start (local)
Requires Python 3.11+.
python -m venv .venv
# Windows
.venv\Scripts\activate
# macOS/Linux
source .venv/bin/activate
pip install -r requirements.txt
python server.pyThe Streamable HTTP endpoint is:
http://localhost:8000/mcpUse the MCP Inspector to test the endpoint:
npx -y @modelcontextprotocol/inspectorSync a small test range first
Call sync_fno_history with known NSE trading dates. Example:
{
"start_date": "2026-11-02",
"end_date": "2026-11-06"
}Then query stock options:
{
"start_date": "2026-11-02",
"end_date": "2026-11-06",
"symbol": "TVSMOTOR",
"instrument_type": "OPTSTK",
"option_type": "CE",
"limit": 500
}For futures, use FUTSTK or FUTIDX. For index options, use OPTIDX.
The default sync limit is 31 calendar days, configurable with MAX_SYNC_DAYS. Sync larger periods in small chunks and check get_database_status after each run.
Environment variables
Variable | Default | Purpose |
|
| Persistent raw archives and DuckDB location |
|
| HTTP port |
|
| Maximum calendar days per sync call |
|
| Maximum rows returned per query |
|
| Delay between archive downloads |
Docker
Build and run with a persistent volume:
docker build -t nse-fno-mcp .
docker run --rm -p 8000:8000 \
-e DATA_DIR=/app/data \
-v nse-fno-data:/app/data \
nse-fno-mcpEndpoint: http://localhost:8000/mcp.
Deploying a remote MCP endpoint
Deploy this Docker image to a Docker-compatible host. Configure:
Persistent volume mounted at
/app/dataPort
8000(or inject the platform'sPORT)HTTPS ingress
Authentication at the gateway or platform layer
Request rate limits and restricted access to the sync tool
Security: This starter server does not implement OAuth or bearer-token validation itself. Do not expose it publicly without a secure authentication gateway. The sync_fno_history tool writes to the database and triggers external downloads; restrict it to trusted users. Read tools may be separately exposed with read-only credentials.
ChatGPT custom MCP availability and supported authentication modes vary by plan and workspace. Follow OpenAI's current documentation: https://developers.openai.com/
Data schema
The normalized DuckDB table includes:
Trade date, segment, instrument type and symbol
Contract expiry and actual expiry (where available)
Strike and option type
Open, high, low, close, settlement and underlying price
Traded volume, turnover and number of trades
Open interest and change in open interest
Data integrity checklist
Before research use:
Confirm the archive was an actual ZIP, not an NSE HTML access-denied page.
Confirm the UDiFF field mapping against the downloaded CSV header.
Compare a selection of contracts against the NSE report for the same date.
Check that all expected instrument types and option sides were loaded.
Record missing trading days and retry them if the exchange archive was temporarily unavailable.
No market data is bundled in this repository. Downloaded archives and databases are excluded by .gitignore.
Disclaimer
This is an independent research utility and is not affiliated with or endorsed by NSE. It is not investment advice or a trading recommendation. Respect NSE website terms, data licensing and rate limits. Verify any data used for financial decisions.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Hosted MCP server for Indian market quotes, option-chain Greeks and multi-broker telemetry.
Query, join, profile, clean and convert CSV/JSON/Parquet with server-side DuckDB over MCP.
Historical tick, order book and settlement data for Polymarket and Predict.fun crypto up/down markets, plus smart-money lists and backtest quotes, over a read-only MCP server.
Market Data App MCP — wraps the Market Data App API (marketdata.app)
Related MCP Servers
- AlicenseAqualityCmaintenanceAn MCP server exposing Indian market and regulatory data from official sources (NSE, NIFTY, AMFI, SEBI), providing tools for end-of-day quotes, index constituents, mutual fund NAVs, and SEBI order searches with a focus on primary sources and no fabricated data.8MIT
- FlicenseNot gradedqualityBmaintenanceMCP server for Indian mutual fund NAV analytics. It provides tools to search funds, compute returns, and analyze categories using DuckDB over parquet data, supporting local files or Azure Blob.-
- FlicenseNot gradedqualityAmaintenanceIndian stock market MCP server exposing 55 tools covering all 8,200+ NSE and BSE listed stocks, letting users pull live quotes, quarterly financials, technical indicators, a 326-ratio screener, FII/DII flows, option chains and IV, corporate filings, IPOs, bulk deals and portfolio P&L through plain-English prompts. It can be added to Claude, ChatGPT, Cursor, VS Code, Codex or Gemini CLI either as a remote OAuth endpoint or as a local npx/uvx stdio bridge.-
- AlicenseNot gradedqualityBmaintenanceGives AI assistants live, structured data on all 8,200+ NSE and BSE listed stocks through 55 tools, covering quotes, financials, a 326-ratio screener, technical indicators, FII/DII flows, option chains and IV, corporate filings, IPOs, bulk deals and portfolio P&L. Runs either remotely over OAuth or locally over stdio, so it works in Claude, ChatGPT, Cursor, VS Code, Codex, Gemini CLI and any other MCP client.MIT