Skip to main content

MCP server for Indian stock market analysis — fundamentals, technicals, DCF, peer comparison

Project description

stock-analyst-mcp

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

Install

pip install stock-analyst-mcp

Or run directly without installing:

uvx stock-analyst-mcp

MCP Configuration

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

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

Or if installed via pip:

{
  "mcpServers": {
    "stock-analyst": {
      "command": "stock-analyst-mcp"
    }
  }
}

Tools

Tool Description
analyze_stock Full analysis: fundamentals + technicals + peers + DCF + forecast + news
get_fundamentals Financial ratios: profitability, liquidity, leverage, efficiency, valuation
get_technicals Technical signals: EMA trend, RSI, MACD, Bollinger position
get_peer_comparison Peer fundamental + technical metrics with rankings
get_dcf_valuation DCF: WACC (India-adjusted), equity value/share, sensitivity range
get_revenue_forecast Revenue forecast: base/bull/bear scenarios
get_news Recent headlines + analyst recommendation summary
compare_stocks Side-by-side comparison of multiple stocks
get_raw_data Fetch cached raw financials for deep dives

CLI

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

Configuration

All settings configurable via environment variables with SA_ prefix. Defaults work out of the box for Indian markets (NSE).

Variable Default Description
SA_DEFAULT_EXCHANGE .NS NSE (.NS) or BSE (.BO)
SA_DEFAULT_PERIOD 1y Historical data period
SA_CACHE_BACKEND redis redis, csv, or none
SA_REDIS_URL redis://localhost:6379/0 Redis connection URL
SA_CACHE_TTL 3600 Cache TTL in seconds
SA_SCREENER_ENABLED true Use screener.in as fallback for peers
SA_FA_DCF_ENABLED true Run DCF valuation
SA_FA_WACC_RISK_FREE_RATE 0.07 India 10Y govt bond yield
SA_PEERS_MAX_COUNT 10 Max peers to compare
SA_MCP_TRANSPORT stdio stdio or streamable-http
SA_MCP_PORT 3001 Port for streamable-http

See configurations.env.example for the full list.

Python Library

from stock_analyst import analyze, get_fundamentals, get_technicals

result = analyze("RELIANCE")
ratios = get_fundamentals("TCS")
signals = get_technicals("INFY", period="6mo")

Testing

# 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

Data Sources

  • yfinance — OHLCV, financials, balance sheet, cashflow, info, peer discovery via Industry API
  • screener.in — peer discovery fallback (best-effort, graceful degradation)
  • India-adjusted defaults — risk-free rate 7%, cost of debt 9%, tax 25%

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

stock_analyst_mcp-0.3.0.tar.gz (38.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

stock_analyst_mcp-0.3.0-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

Details for the file stock_analyst_mcp-0.3.0.tar.gz.

File metadata

  • Download URL: stock_analyst_mcp-0.3.0.tar.gz
  • Upload date:
  • Size: 38.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.13.11

File hashes

Hashes for stock_analyst_mcp-0.3.0.tar.gz
Algorithm Hash digest
SHA256 0b06e4eb4bcef4bb71d240300807ab2e9a82e78092fde031f27f9a576eb4fc2f
MD5 c1a8ab707152fbd30b27c1d50f49632e
BLAKE2b-256 9aba931df8a1495deefc70b7e9d65ba5733bd13a940c20750a476469d1af0503

See more details on using hashes here.

File details

Details for the file stock_analyst_mcp-0.3.0-py3-none-any.whl.

File metadata

File hashes

Hashes for stock_analyst_mcp-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 d73545a3f95c58a697a297806768de9cf26545f7536ada378fa3cbc151c9555d
MD5 38596d332f668859a340b9bcc1eeebb1
BLAKE2b-256 c017730dd2533264358800f3dc315cc4c383dc3a5ce9ebc72142a933e3947e5b

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page