get_stock_quote
Latest price snapshot for an NSE stock — last close, prev close, change %, day H/L, volume.
symbol必填
io.github.alokbarnwal由 GitHub 账号 alokbarnwal 发布v1.0.1更新于 Oct 24, 2026
Analyze any Nifty 500 stock with AI — price action, demand zones, technicals & screener.
面向印度 NSE 股票的远程 MCP 服务器:行情、K 线、技术指标、价格行为位与 Nifty 500 选股筛选。
Web executable,通过 Streamable HTTP。 远程服务在工作区中配置后即可从网页运行时运行。
把这段提示词粘贴到 Claude Code、Codex、Cursor 等智能体,或 SourceWeft 对话中。智能体会读取该服务器的安装指南,先向你展示发布者、端点和登录方式,经你同意后再把它添加到你的客户端。密钥不会写进任何命令。
阅读 https://sourceweft.com/mcp/io.github.alokbarnwal%2Fnse-public-mcp/install.md,并按其中说明把这个 MCP 服务器接入我的客户端。修改任何配置之前,先告诉我它的发布者、端点和登录方式,等我确认。不要把 API 密钥写进命令或我会提交的文件;问我密钥应从哪里获取。把它添加到你客户端的 mcpServers 配置中。
{
"mcpServers": {
"indian-nse-stock-insights": {
"type": "http",
"url": "https://stockmcp.alokbarnwal.com/mcp"
}
}
}Public MCP server for Indian stock market analysis — Nifty 500 universe, 12 tools, 3 timeframes.
Built with FastMCP · Data from yfinance · Hosted at stockmcp.alokbarnwal.com
Educational only. Not investment advice. See DISCLAIMER.md.
Claude.ai → Settings → Connectors → Add custom MCP connector:
That's it. Start asking questions about Indian stocks.
timeframe defaults to daily. Options: daily, 15min, 5min.
Try these in Claude.ai after connecting:
Market hours: 09:15–15:30 IST, Monday–Friday (excluding NSE holidays).
Runs on
/home/ubuntu/nse-public-mcp/— completely isolated from/home/ubuntu/swingtrader/.
The repo ships with the top ~100 stocks hardcoded. To expand to all 500:
Expected runtime:
daily 5y × 500: ~30 min15min 2y × 500: ~2 h5min 6mo × 500: ~1 hIf anything fails, the failure list is written to backfill_failures_<timeframe>.json. Re-run:
After the candle backfill completes, populate the indicators table for all 500 stocks across all 3 timeframes:
Expected runtime: ~30–45 min. Idempotent — safe to re-run if interrupted.
After indicators are populated, compute price-action features (zones, S/R, patterns, breakouts, fibs, gaps, volume profile) for all 500 stocks across all 3 timeframes:
Expected runtime: ~60–90 min total. Idempotent — safe to re-run if interrupted.
Add:
Cron times are server-local. Verify the server is on IST (
timedatectl) — if not, shift the hour ranges. The 5-min indicator cron is offset to2-57/5so it runs ~2 minutes aftercron_5minand never reads stale candles. The price-action 5-min cron is offset to9-54/15(minutes 9, 24, 39, 54) so it runs ~2 minutes after eachcron_indicators_5minslot.
DB size on disk:
See PROJECT.md for architecture and data-flow diagram.
INSERT … ON DUPLICATE KEY UPDATE. Replaying a cron tick or rerunning backfill is safe.config/holidays.py. Update it once a year when NSE publishes the next year's list.jobs/cron_daily.py. Daily candles older than 5 y, 15min older than 2 y, 5min older than 6 mo are purged.MIT — free to use, modify, and distribute.
This project is for educational and informational purposes only. Not investment advice. See DISCLAIMER.md.
来源:README.md,提交 aaefc5c
Latest price snapshot for an NSE stock — last close, prev close, change %, day H/L, volume.
symbol必填Recent OHLCV candles. timeframe in {daily, 15min, 5min}; limit capped at 500; newest first.
limitsymbol必填timeframeLatest technical indicators (EMAs, SMAs, RSI, MACD, BB, ADX, Stoch, ATR, OBV, VWAP).
symbol必填timeframePivot points + historical support/resistance levels, ordered by price desc.
symbol必填timeframeDemand/supply zones (DBR/RBR/RBD/DBD) split into demand_zones and supply_zones.
statussymbol必填timeframeRecent single-bar candlestick patterns (HAMMER, DOJI, ENGULFING, ...) newest first.
limitsymbol必填timeframeMulti-bar chart patterns (DOUBLE_TOP, HEAD_AND_SHOULDERS, ...). 'ACTIVE' = PENDING/CONFIRMED.
statussymbol必填timeframeLatest fibonacci retracement swings (UP/DOWN) with 236/382/500/618/786 levels.
symbol必填timeframeVolume diagnostic: top 5min hotspots + peak slot + OBV 20-day trend + today/20-day volume ratio.
symbol必填Market-wide snapshot: indices, top_gainers, top_losers, most_active, breadth.
无需输入参数。
Side-by-side comparison of 2-5 symbols: quote, RSI/MACD/ADX, trend, 30d return, latest pattern.
symbols必填timeframeFilter the active universe. Keys: rsi_min, rsi_max, adx_min, trend, near_demand_zone, pattern, min_volume_ratio, sector. At least one required.
filters必填已满足适用检查项的 100%
该评分衡量此收录条目的完整程度,依据注册中心条目、端点与公开来源计算得出。它不是对服务器本身的评价,也不表示服务器安全或当前可用:可连通性是带日期的检查结果,评分也不包含安装量或用户评价。
Name: Indian NSE Stock InsightsURL: https://stockmcp.alokbarnwal.com/mcpgraph TB subgraph Internet C[Claude.ai / MCP Client] end
subgraph Server["Production Server"] subgraph Protection F2B[fail2ban<br/>auto-ban repeat abusers] NG[nginx<br/>rate limit 20r/s · conn limit · TLS] end
subgraph Application MCP["FastMCP Server<br/>port 8089 · 12 tools"] TOOLS["Tool Modules<br/>quote · ohlc · indicators<br/>levels · zones · patterns<br/>fibonacci · volume · market<br/>compare · screener"] end
subgraph Data DB[(MySQL: nse_public<br/>500 stocks × 3 timeframes)] CRON[Cron Jobs<br/>5min · 15min · daily] end end
subgraph External YF[Yahoo Finance<br/>yfinance API] end
C -->|HTTPS POST /mcp| NG NG -->|proxy_pass| MCP MCP --> TOOLS TOOLS -->|read-only queries| DB YF -->|OHLCV data| CRON CRON -->|upsert| DB F2B -.->|monitors| NGcd /home/ubuntugit clone https://github.com/alokbarnwal/nse-public-mcp.gitcd nse-public-mcpsudo mysql <<'SQL'CREATE DATABASE IF NOT EXISTS nse_public CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;CREATE USER IF NOT EXISTS 'nse_writer'@'localhost' IDENTIFIED BY 'CHANGE_ME_STRONG_PASSWORD';GRANT ALL PRIVILEGES ON nse_public.* TO 'nse_writer'@'localhost';FLUSH PRIVILEGES;SQLmysql -u nse_writer -p nse_public < db/schema.sqlmysql -u nse_writer -p nse_public < db/schema_indicators.sqlmysql -u nse_writer -p nse_public < db/schema_price_action.sqlpython3 -m venv .venvsource .venv/bin/activatepip install -r requirements.txtcp .env.example .envchmod 600 .envnano .env # set DB_PASSWORD to match step 2python -m config.stocks --refresh # fetches NSE archives, rewrites config/stocks.pypython -m config.stocks --load-to-dbscreen -S backfillsource .venv/bin/activatepython -m data.backfill --all# Ctrl-A D to detach. Reattach: screen -r backfillpython -m data.backfill --timeframe 15min --resumescreen -S indicatorscd /home/ubuntu/nse-public-mcppython3 -m indicators.runner --all# Ctrl-A D to detachscreen -S price_actioncd /home/ubuntu/nse-public-mcppython3 -m price_action.runner --timeframe daily --all-featurespython3 -m price_action.runner --timeframe 15min --all-featurespython3 -m price_action.runner --timeframe 5min --all-features# Ctrl-A D to detachcrontab -e# nse-public-mcp candle updaters*/5 9-15 * * 1-5 cd /home/ubuntu/nse-public-mcp && /home/ubuntu/nse-public-mcp/.venv/bin/python -m jobs.cron_5min >> logs/cron_5min.log 2>&1*/15 9-15 * * 1-5 cd /home/ubuntu/nse-public-mcp && /home/ubuntu/nse-public-mcp/.venv/bin/python -m jobs.cron_15min >> logs/cron_15min.log 2>&10 18 * * 1-5 cd /home/ubuntu/nse-public-mcp && /home/ubuntu/nse-public-mcp/.venv/bin/python -m jobs.cron_daily >> logs/cron_daily.log 2>&1
# nse-public-mcp indicator updaters (each runs after the matching candle fetch)30 18 * * 1-5 cd /home/ubuntu/nse-public-mcp && /usr/bin/python3 -m jobs.cron_indicators_daily >> logs/indicators_daily.log 2>&120,35,50 9-15 * * 1-5 cd /home/ubuntu/nse-public-mcp && /usr/bin/python3 -m jobs.cron_indicators_15min >> logs/indicators_15min.log 2>&15 16 * * 1-5 cd /home/ubuntu/nse-public-mcp && /usr/bin/python3 -m jobs.cron_indicators_15min >> logs/indicators_15min.log 2>&12-57/5 9-15 * * 1-5 cd /home/ubuntu/nse-public-mcp && /usr/bin/python3 -m jobs.cron_indicators_5min >> logs/indicators_5min.log 2>&1
# nse-public-mcp price-action updaters (each runs after the matching indicator cron)35 18 * * 1-5 cd /home/ubuntu/nse-public-mcp && /usr/bin/python3 -m jobs.cron_price_action_daily >> logs/price_action_daily.log 2>&125,55 9-15 * * 1-5 cd /home/ubuntu/nse-public-mcp && /usr/bin/python3 -m jobs.cron_price_action_15min >> logs/price_action_15min.log 2>&19-54/15 9-15 * * 1-5 cd /home/ubuntu/nse-public-mcp && /usr/bin/python3 -m jobs.cron_price_action_5min >> logs/price_action_5min.log 2>&1mysql -u nse_writer -p nse_public <<'SQL'SELECT 'daily' AS tf, COUNT(*) AS n FROM candles_dailyUNION ALL SELECT '15min', COUNT(*) FROM candles_15minUNION ALL SELECT '5min', COUNT(*) FROM candles_5min;
-- Per-stock coverage on daily — flag any with < 1000 rows (~4 trading years)SELECT symbol, COUNT(*) AS nFROM candles_dailyGROUP BY symbolHAVING n < 1000ORDER BY n;
-- Latest data freshnessSELECT MIN(candle_date) AS earliest, MAX(candle_date) AS latestFROM candles_daily;
-- Recent cron healthSELECT job_type, timeframe, symbols_success, symbols_failed, started_at, duration_secondsFROM fetch_logORDER BY started_at DESCLIMIT 20;SQLsudo du -sh /var/lib/mysql/nse_public/# Server statussudo systemctl status nse-public-mcp
# Restartsudo systemctl restart nse-public-mcp
# Logssudo journalctl -u nse-public-mcp -n 100 -f
# nginxsudo nginx -t && sudo systemctl reload nginx
# fail2bansudo fail2ban-client status nginx-mcp-ratelimitconfig/ # settings, stock universe, holiday calendardata/ # yfinance fetcher, backfill CLI, shared upsert helpersdb/ # schema and pooled connectionindicators/ # technical indicator compute, persist, runnerprice_action/ # zones, patterns, levels, trendsmcp_server/ # FastMCP server + 12 tool modulesjobs/ # cron entrypoints (candles + indicators + price action)deploy/ # systemd service, nginx config, fail2ban rulestests/ # mocked unit tests (82 tests)