india-markets-mcp
# india-markets-mcp
An [MCP](https://modelcontextprotocol.io) server that lets AI agents (Claude, Cursor, any MCP client) look up
Indian equities and get simple, **transparent** technical signals. Built on public data via
[yfinance](https://github.com/ranaroussi/yfinance) — no API keys.
> Not investment advice. Data comes from Yahoo Finance and can be delayed or wrong.
## Tools
| Tool | What it does |
|---|---|
| `get_quote(symbol)` | Latest close, daily change, 52-week range, volume |
| `get_signals(symbol)` | RSI(14), 30-day volatility, max drawdown, 12-1 momentum, and a rule-based trend regime |
| `compare_symbols(symbols, period)` | Rank 2-10 symbols by return, with volatility and drawdown |
Symbols: `RELIANCE` → `RELIANCE.NS`; `TCS.BO` and `^NSEI` pass through; `NIFTY`, `BANKNIFTY`, `SENSEX` map to indices.
The regime label is deliberately a plain rule (close vs 50/200-day averages) and the output includes the rule text,
so an agent can explain *why* a label was chosen.
## Install and run
```bash
pip install -e .
india-markets-mcp # starts the server over stdio
```
Claude Desktop / Claude Code config:
```json
{
"mcpServers": {
"india-markets": { "command": "india-markets-mcp" }
}
}
```
## Develop
```bash
pip install -e ".[dev]"
pytest
```
Indicator and tool logic is pure pandas (`indicators.py`, `core.py`) and tested offline; only `data.py` touches the network.
## Roadmap
- Fundamentals (P/E, P/B) and sector comparison
- Optional alternative data sources behind the same interface
- Caching to be kinder to the upstream API
## License
MIT
TDQS
Scored across 3 tools
Each tool has a clearly distinct purpose: single-symbol quote data, technical/statistical signals, and multi-symbol comparison. An agent can easily select the right tool based on whether it needs current pricing, derived indicators, or cross-symbol ranking.
All tool names follow a consistent snake_case verb_noun pattern: get_quote, get_signals, compare_symbols. The verbs are appropriate and predictable for their actions.
Three tools is on the lean side but appropriate for a focused market-data analytics server. Each tool earns its place, though additional utility tools may be expected for broader workflows.
The surface covers core quote retrieval, signal analysis, and relative comparison well. Minor gaps exist around symbol discovery, historical time-series access, or broader market/index coverage, but the stated analytics purpose is largely served.