Indian Stock Analyst MCP

by parth-mehta-989

Not rated
GitHub

About

MCP server for Indian stock market analysis — fundamentals, technicals, DCF valuation, peer comparison, and more.

Details

Author
parth-mehta-989
Categories
Finance

Setup

Install Indian Stock Analyst MCP in your MCP client (Claude Desktop, Cursor, Windsurf, and others).

Repository: https://github.com/parth-mehta-989/stock-analyst-mcp

Follow the installation instructions in the repository README, then restart your MCP client.

MCP server for global stock market analysis — fundamentals, technicals, DCF valuation, peer comparison, multi-asset support, and more. Works for 50+ regions worldwide.

- Requires Python >=3.13: Fixesuvxpicking stale Python 3.12 which caused pandas C extension crashes (ModuleNotFoundError: pandas._libs.pandas_parser)
- uvx stock-analyst-mcpnow works without--python: uv/uvx auto-selects 3.13+

MCP Framework Migration — FastMCP standalone

- ReplacedmcpSDK with standalonefastmcp: Eliminates v2.0.0 breaking changes, no moremcp.server.fastmcpimport errors
- Cleaner dependency:fastmcp>=3.4.0,<4.0.0(Prefect-maintained, actively developed)
- Port configuration: Now passed as kwarg tomcp.run(transport=..., port=...)
- Future-proof: No SDK version conflicts, fastmcp handles all MCP protocol versions

- Fixed empty headlines: yfinance now nests news fields undercontent
- Correct mapping: title, publisher, link, pub_date extracted fromcontent.*
- Backward compatible: still handles legacy top-level news format

- Fixed TypeError:FastMCP.run()doesn't acceptportkwarg
- Port configuration: Set viamcp.settings.portbefore callingrun()

Compatibility Fix —mcp>=1.28support

- Fixed breaking import: Replaced removedMCPServerwithFastMCPfrommcp.server.fastmcp
- Pinned mcp dependency:mcp>=1.0.0,<3.0.0to prevent future breakage
- Added requirements.txtfor pip-based installs

Screener Fix —screen_stocksworks across regions

- Fixed yfinance EquityQuery parameter:_sizesizeinyf.screen()call, restoring screener results for India and other regions

Performance Overhaul — 3-19x faster peer analysis

- Parallel peer fundamentals: ThreadPoolExecutor onget_info()calls (3.7x speedup)
- Batch history downloads: Singleyf.download()for all peers (19.3x speedup)
- Parallel snippet fetching: News analysis now fetches article snippets concurrently
- Newstock_analyst/utils/module: Reusable concurrency helpers (parallel_map,parallel_map_dict,batch_download_history)
- Zero new dependencies: Uses stdlibconcurrent.futures

Example: Analyzing LOW (US) with 10 peers now takes ~2-3s instead of 8-10s.

Add to your MCP client config (Claude Desktop, Devin, Cursor, etc.):

{ "mcpServers": { "stock-analyst": { "command": "uvx", "args": ["stock-analyst-mcp"] } } }
{ "mcpServers": { "stock-analyst": { "command": "stock-analyst-mcp" } } }

Retrieve all current configuration settings. Useful for understanding what parameters are available before callingset_config.

from stock_analyst import get_config config = get_config() # Returns dict with sections: # - data_provider, default_exchange, default_period, cache settings # - technical_analysis: EMA periods, RSI period, MACD params, Bollinger settings # - financial_analysis: DCF params, WACC settings, forecast scenarios # - peer_comparison: max count, metrics to compare # - output: format, pretty-print settings

Update configuration dynamically without restarting. Changes affect subsequent tool calls.

from stock_analyst import set_config # Change technical analysis period from 1y to 1d result = set_config("default_period", "1d") # Returns: {"status": "success", "key": "default_period", "new_value": "1d", "affected_tools": ["all_tools"]} # Change RSI period from 14 to 21 result = set_config("ta_rsi_period", "21") # Returns: {"status": "success", "key": "ta_rsi_period", "new_value": 21, "affected_tools": ["get_technicals", "analyze_stock"]} # Change DCF projection years from 5 to 10 result = set_config("fa_dcf_projection_years", "10") # Returns: {"status": "success", "key": "fa_dcf_projection_years", "new_value": 10, "affected_tools": ["get_dcf_valuation", "get_revenue_forecast", "analyze_stock"]}
from stock_analyst import set_config, get_technicals # Use 1-day data with custom RSI period set_config("default_period", "1d") set_config("ta_rsi_period", "21") # Get technicals with new settings signals = get_technicals("RELIANCE")
from stock_analyst import set_config, get_dcf_valuation # Use 10-year projection with different growth assumptions set_config("fa_dcf_projection_years", "10") set_config("fa_dcf_terminal_growth", "0.03") # 3% terminal growth set_config("fa_wacc_risk_free_rate", "0.065") # 6.5% risk-free rate # Get DCF with new assumptions valuation = get_dcf_valuation("RELIANCE")

Also works as a standalone CLI (no LLM needed):

# Full analysis stock-analyst --symbol RELIANCE # Specific analysis stock-analyst --symbol TCS --analysis fundamentals stock-analyst --symbol INFY --analysis technicals stock-analyst --symbol RELIANCE --analysis dcf # Compare multiple stocks stock-analyst --symbols RELIANCE,TCS,INFY --compare # Markdown output stock-analyst --symbol RELIANCE --format markdown # Raw data stock-analyst --symbol RELIANCE --raw financials # Market mood (no symbol needed) stock-analyst --analysis market-mood # Stock screener (India) stock-analyst --screen --sector Technology --pe-max 30 --roe-min 0.15 stock-analyst --screen --market-cap-min 50000000000 --sort-by pe --limit 20 # Global stocks (any region) stock-analyst --symbol AAPL --region us stock-analyst --symbol 0700.HK --region hk stock-analyst --screen --region gb --sector Technology --pe-max 25 # Market mood (global) stock-analyst --analysis market-mood --region us stock-analyst --analysis market-mood --region de # Ticker search stock-analyst --search "Apple" --search-type stock --region us stock-analyst --search "Bitcoin" --search-type cryptocurrency # Multi-asset analysis stock-analyst --symbol SPY --analysis asset --asset-type etf stock-analyst --symbol GC=F --analysis asset --asset-type commodity stock-analyst --symbol BTC-USD --analysis asset --asset-type crypto

All settings configurable via environment variables withSA_prefix. Defaults work out of the box for Indian markets (NSE). Supports 50+ regions globally.

Seeconfigurations.env.examplefor the full list.

from stock_analyst import ( analyze, get_fundamentals, get_technicals, get_news, get_market_mood, screen_stocks, search_tickers, analyze_asset, ) # Indian stocks (default region) result = analyze("RELIANCE") ratios = get_fundamentals("TCS") signals = get_technicals("INFY", period="6mo") # Global stocks (any region) us_stock = analyze("AAPL", region="us") hk_stock = analyze("0700.HK", region="hk") uk_stock = analyze("HSBA", region="gb") # News with sentiment news = get_news("TCS") # Returns headlines with sentiment_score, sentiment_label, snippet # Market mood (region-specific) mood_in = get_market_mood(region="in") # Includes MMI from tickertape mood_us = get_market_mood(region="us") # S&P 500 + VIX mood_de = get_market_mood(region="de") # DAX + VDAX # Stock screener (any region) results_in = screen_stocks({"sector": "Technology", "pe_max": 30}, region="in") results_us = screen_stocks({"sector": "Technology", "pe_max": 40}, region="us") # Ticker search apple_results = search_tickers("Apple", instrument_type="stock", region="us") crypto_results = search_tickers("Bitcoin", instrument_type="cryptocurrency") # Multi-asset analysis etf = analyze_asset("SPY", asset_type="etf") commodity = analyze_asset("GC=F", asset_type="commodity") crypto = analyze_asset("BTC-USD", asset_type="crypto") currency = analyze_asset("EURUSD=X", asset_type="currency")
# Install dev dependencies pip install -e ".[dev]" # Run all tests pytest # Run with coverage pytest --cov=stock_analyst --cov-report=term-missing # Run specific test file pytest tests/test_peers.py -v

- yfinance— OHLCV, financials, balance sheet, cashflow, info, peer discovery via Industry API, stock screener via EquityQuery (50+ regions)
- screener.in— peer discovery + stock screener fallback for India (best-effort, graceful degradation)
- tickertape.in— Market Mood Index (MMI) scraping for India
- VADER— headline sentiment analysis (vaderSentiment)
- India-adjusted defaults— risk-free rate 7%, cost of debt 9%, tax 25%

50+ regions via yfinance: US, UK, Germany, France, Italy, Spain, Netherlands, Belgium, Switzerland, Austria, Sweden, Norway, Denmark, Finland, Poland, Czech Republic, Romania, Portugal, Greece, Hungary, Ireland, Lithuania, Latvia, Estonia, Canada, Mexico, Brazil, Argentina, Chile, Peru, Colombia, Venezuela, Australia, New Zealand, Japan, South Korea, China, Hong Kong, Singapore, Malaysia, Thailand, Philippines, Indonesia, Vietnam, Pakistan, Sri Lanka, UAE, Saudi Arabia, Kuwait, Qatar, Israel, Egypt, Turkey, South Africa, and more.

Bridge Town is an MCP-native, git-versioned financial modeling platform for FP&A teams and finance leaders. AI agents use Bridge Town tools to create projects, write Python model files, run models in isolated cloud sandboxes, query data, write outputs to Google Sheets, create dashboards, branch scenarios, and collaborate with teammates.

The Capital.com MCP Server lets your AI assistant talk to your trading account directly. Market data, position checks, trade previews – all in plain language, without leaving your AI tool.

Coinrule Agentic Trading MCP enables investors to create, backtest, execute, and manage trading agents through natural language across stocks, crypto and ETFs

Invest with Claude and other AI assistants

Australian Consumer Data Right Product Data

Remote MCP server for historical crypto & prediction-market data: search ~500K instruments, live market stats (OHLC, turnover, spreads, depth, slippage) and tick-data purchase. Keyless for catalog & stats; optional OAuth for account tools. Endpoint: https://cryptostruct.com/mcp

Cross-border debt collection from your AI assistant: check cases, get pricing, submit new cases.

Read-only MCP server for your Evibe investment portfolio + live market data (holdings, performance, dividends, benchmarks, screeners). Works with Claude & ChatGPT.

Financial and quantitative modeling engine for AI agents. Typed, named, deterministic.

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.