Skip to main content

🇮🇳 india-markets-mcp

Give your AI agent a live view of the Indian stock market. Quotes, transparent technical signals, valuation and sector comparison for NSE/BSE, over MCP. No API keys.

CI PyPI Aarya-Mhatre69/india-markets-mcp MCP server License: MIT Python MCP No API key

Demo: asking an AI agent about TCS and getting live NSE data

See it work

You: Can you give me the price of TCS, and is it a good time to buy?

Agent (calls the india-markets tools): TCS closed at ₹2,407.50 on 13 Nov 2026, down 1.43% on the day. Whether it's a good time to buy is your decision. I can't give buy, sell or hold advice, but here is where the stock stands.

Metric Value
52-week range ₹1,961.36 – ₹3,187.34
Distance from 52-week high −24.5%
RSI(14) 50.7 (neutral)
30-day volatility (annualised) 32.8%
50-day / 200-day average ₹2,287.43 / ₹2,366.05
Market cap ₹8,71,055 crore

(Condensed from a real session using the bundled skill, so the agent reports facts instead of advice. Numbers move with the market.)

▶ Watch the 20-second version with sound

Why this one

  • Built for India. RELIANCE just works. NIFTY, BANKNIFTY and SENSEX are first-class. Market cap comes back in ₹ crore, not dollars.
  • Signals you can audit. The trend regime is a plain rule on the 50/200-day averages and the 200-day slope, and the tool returns the rule text, so the agent can explain why, not just emit a label.
  • Honest about gaps. Missing data is null, never guessed. Unknown tickers and upstream outages raise clear errors.
  • Polite to the data source. 5-minute cache, 3 retries with backoff, bounded fan-out.
  • Tested offline. Indicator and tool logic is pure pandas with 53 tests (including contract tests for the tool schemas), run in CI on Linux, macOS and Windows.
  • Comes with an agent skill that teaches the agent when to use each tool and keeps answers to facts, not buy/sell calls.

Tools

Tool What it does
search_symbol(query) Find a ticker from a company name ("Infosys" → INFY): NSE/BSE equities, indices and ETFs
get_quote(symbol) Latest close, daily change, 52-week range, volume
get_signals(symbol) RSI(14), 30-day volatility, max drawdown, 12-1 momentum, rule-based trend regime
compare_symbols(symbols, period) Rank 2-10 symbols by return, with volatility and drawdown
get_fundamentals(symbol) Market cap (₹ crore), P/E, P/B, ROE, debt/equity, dividend yield, sector
compare_fundamentals(symbols) Side-by-side valuation of 2-10 symbols, cheapest P/E first
sector_peers(symbol) A large-cap vs hand-picked same-sector peers: median P/E and P/B and its premium or discount

Symbols: RELIANCE → RELIANCE.NS · TCS.BO and ^NSEI pass through · NIFTY, BANKNIFTY, SENSEX map to the indices.

Prompts: clients that support MCP prompts (Claude Desktop shows them as starters) also get analyze_stock, compare_stocks and market_snapshot, ready-made facts-only briefings.

Every tool is read-only and annotated as such, so well-behaved clients can call them without asking for confirmation each time.

Try asking

  • "What's the P/E of Infosys, and how does it compare with Tata Consultancy?" (it looks up the tickers itself)
  • "Give me a quick read on HDFCBANK: price, trend and valuation."
  • "Rank INFY, TCS, WIPRO and HCLTECH by 1-year return and by P/E."
  • "Is Reliance expensive compared with other oil and gas names?"
  • "Which of the big private banks has the lowest drawdown this year?"

Install

Claude Desktop / Claude Code / Cursor (any MCP client). The quickest way is uvx, which needs no install step:

{
  "mcpServers": {
    "india-markets": { "command": "uvx", "args": ["india-markets-mcp"] }
  }
}

With Claude Code you can register it in one line:

claude mcp add india-markets -- uvx india-markets-mcp

Prefer pip?

pip install india-markets-mcp

then use "command": "india-markets-mcp" in the config above. If that command isn't on your PATH, use the full path to the executable (for a venv: .venv/Scripts/india-markets-mcp.exe on Windows, .venv/bin/india-markets-mcp elsewhere).

Optional: the agent skill

skills/india-markets/SKILL.md teaches an agent which tool to pick, how to read units and nulls, and to stay on facts (no buy/sell advice, ends with a disclaimer). Copy the folder into .claude/skills/ (Claude Code) or your agent's skills directory.

How it works

 your agent ──MCP──▶ server.py ──▶ core.py ──▶ indicators.py   (pure pandas, tested offline)
                                      │
                                      └──▶ data.py ──▶ yfinance (cache + retry)   ← only network code

Only data.py touches the network, so everything else is deterministic and easy to test.

Good to know

  • Not investment advice. Signals describe the past; they do not predict.
  • Data comes from Yahoo Finance via the unofficial yfinance library. It can be delayed, rate-limited or wrong, and Yahoo's terms limit commercial use. Fine for research and learning, not for trading systems.
  • Fundamentals can be null (loss-making companies, new listings, gaps in the source).
  • sector_peers uses a small hand-picked list in sectors.py, not an official classification. Edit it if you disagree with a grouping.

Develop

git clone https://github.com/Aarya-Mhatre69/india-markets-mcp
cd india-markets-mcp
pip install -e ".[dev]"
pytest

Contributions welcome: new peer groups, a better data source behind the same interface, more indicators. Open an issue first for anything big.

Roadmap

  • Quotes, signals, comparison
  • Fundamentals and sector peers
  • Caching, retries, CI, agent skill
  • Name-to-ticker search, built-in prompts, read-only tool annotations
  • Portfolio view: pass holdings, get concentration, sector mix and drawdown
  • Pluggable data sources behind one interface
  • Nifty 50 screener (oversold + cheap vs peers)

License

MIT

Metadata

Release files for india-markets-mcp 0.3.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for india-markets-mcp 0.3.0
File Size Uploaded Provenance Actions
india_markets_mcp-0.3.0.tar.gz 3.6 MB With provenance Details for india_markets_mcp-0.3.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for india-markets-mcp 0.3.0
File Interpreter ABI Platform Actions
india_markets_mcp-0.3.0-py3-none-any.whl Python 3 none any Details for india_markets_mcp-0.3.0-py3-none-any.whl

Total release size: 3.6 MB

Release files / india_markets_mcp-0.3.0.tar.gz

Download URL india_markets_mcp-0.3.0.tar.gz
Size 3.6 MB
Tags Source
SHA-256 checksum
How to use checksums
532762e316fe8d80997c7b83b899bb7cfa59638a3c4efd80bf4da4844a272c51
BLAKE2b-256 checksum
How to use checksums
cf21f69d356d9588d636aa66c4a584dbca4a1c55342c846bfe222a16a27e922d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Release files / india_markets_mcp-0.3.0-py3-none-any.whl

Download URL india_markets_mcp-0.3.0-py3-none-any.whl
Size 16.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
c057e748b091f7bc693e4d65ef2659a5fae9f4d671170a4f5e5935befc0d694c
BLAKE2b-256 checksum
How to use checksums
f7e16c7ee3e48e4236b4dfce891b416614ac7f079693453995da4c8ec280440b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

Security for india-markets-mcp 0.3.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for india_markets_mcp-0.3.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Nov 26, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page