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.1.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.1-py3-none-any.whl (36.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stock_analyst_mcp-0.3.1.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.1.tar.gz
Algorithm Hash digest
SHA256 5d985da834db312556c462e93dcbe8992aea802aadfb291d3588ba751ed69d1d
MD5 741026ca9ff8dd9a4900b16a5ddb6c78
BLAKE2b-256 538f89043d4ac64c7546e5b271277c6bfcc5e16c07df40993fd1a373c2ced8d2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for stock_analyst_mcp-0.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 c4a2775a2b94d1c6a922554892d0603964d9a75a7999100d4acb41b10b32ac70
MD5 bb334841d714a7e5885afd5d24cebc85
BLAKE2b-256 6dcdfbd88bc467a7255c4d2fc7fd3f1fa8a8c4837896eac7905d8cdb1e5d980e

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