io.github.NayakwadiS/bahi-mcp

السجل الرسمي التسويق والمبيعات

Indian mutual fund data and analytics, NSE/BSE market data, and financial calculators.

ماذا يمكنك أن تفعل مع io.github.NayakwadiS/bahi-mcp؟

  • "Compare these three flexi-cap funds on 3-year return, volatility and max drawdown."
  • "How often has this fund beaten 12% on rolling 3-year returns?"
  • "If I had invested ₹10,000 a month in scheme 119551 since January 2020, what would it be worth today, and what is my XIRR?"
  • "What's the Nifty at, and how has RELIANCE done over the last year?"
  • "How much tax would I pay if I sell this equity fund after 14 months with a ₹2 lakh gain?"
  • "How much corpus do I need to retire at 55 if I spend ₹60,000 a month today?"

التثبيت

أضف هذا إلى إعدادات MCP في عميلك (Claude Desktop: claude_desktop_config.json، وCursor: ‏.cursor/mcp.json، ويستخدم VS Code وغيره الصيغة نفسها «mcpServers»).

PYPI package bahi-mcp
Claude Code
claude mcp add bahi-mcp -- uvx bahi-mcp==0.3.1
إعداد JSON (Claude Desktop وCursor وVS Code)
{
    "mcpServers": {
        "bahi-mcp": {
            "command": "uvx",
            "args": [
                "bahi-mcp==0.3.1"
            ]
        }
    }
}

التوثيق

مأخوذ من ملف README للمشروع على GitHub ويُحدَّث أسبوعيًا. تفتح الروابط على GitHub.

المحتويات
  1. bahi-mcp
  2. What you can ask
  3. Tools
  4. Install
  5. Configure your MCP client
  6. Notes on data and accuracy
  7. Development
  8. Roadmap
  9. Contributing
  10. License

bahi-mcp

MCP server that gives AI assistants (Claude, Cursor, VS Code and others) access to Indian mutual fund data, NSE/BSE market data and financial calculators.

Bahi (बही) is the traditional Indian ledger. This server keeps the numbers straight so your assistant doesn't guess them.

Disclaimer: bahi-mcp provides information and calculations from public data sources (AMFI via the mftool library, and Yahoo Finance for stocks) and from assumptions you supply. It is not investment or tax advice and the author is not a SEBI-registered adviser. Data may be delayed or inaccurate, and tax rules change. Verify before making decisions.

What you can ask

  • "Compare these three flexi-cap funds on 3-year return, volatility and max drawdown."
  • "How often has this fund beaten 12% on rolling 3-year returns?"
  • "If I had invested ₹10,000 a month in scheme 119551 since January 2020, what would it be worth today, and what is my XIRR?"
  • "What's the Nifty at, and how has RELIANCE done over the last year?"
  • "How much tax would I pay if I sell this equity fund after 14 months with a ₹2 lakh gain?"
  • "How much corpus do I need to retire at 55 if I spend ₹60,000 a month today?"

Tools

Mutual fund data (AMFI)

ToolWhat it does
search_schemesSearch schemes by name, returns AMFI scheme codes
get_scheme_quoteLatest NAV and quote for a scheme code
get_scheme_detailsFund house, type, category, start date
get_nav_historyNAV history with optional date range (capped to keep responses small)
get_portfolio_valueCurrent value of a list of holdings (scheme code + units)
clear_cacheDrop cached AMFI data so the next call fetches fresh NAVs

Mutual fund analytics

ToolWhat it does
calculate_sip_returnsMonthly SIP simulation on a fund's real NAV history: invested, units, value, absolute return, XIRR
compare_fundsSide-by-side 1/3/5-year returns, volatility, max drawdown and Sharpe ratio for 1 to 5 funds
get_rolling_returnsDistribution of rolling returns: min, max, mean, median, how often positive or above a threshold

Stocks and market data (NSE/BSE, via Yahoo Finance; unofficial and best-effort)

ToolWhat it does
get_stock_quoteLatest price, day and 52-week range for an NSE/BSE stock
get_index_quoteNifty 50, Sensex, Bank Nifty, Nifty IT, India VIX
get_stock_historyOHLCV history for a stock or index

Calculators

ToolWhat it does
calculate_xirrXIRR for any dated cash flows
calculate_cagrCAGR between two values over a date range
calculate_emiLoan EMI, total payment, total interest
calculate_fd / calculate_rdFixed and recurring deposit maturity
calculate_lumpsum_valueFuture value of a one-time investment
project_sipSIP projection at an assumed return, with optional yearly step-up
calculate_swpDoes a corpus last under a monthly withdrawal?
plan_retirementCorpus needed and the monthly SIP to build it
estimate_mf_taxCapital gains tax estimate on a fund redemption; use purchase/sale dates for exact 12-month classification

Dates can be DD-MM-YYYY or YYYY-MM-DD.

Install

Requires Python 3.10+.

pip install bahi-mcp                # mutual funds + calculators
pip install "bahi-mcp[stocks]"      # adds NSE/BSE stock and index data

Or run without installing, using uv:

uvx bahi-mcp
uvx --with yfinance bahi-mcp        # with stock data

Configure your MCP client

Claude Desktop

Add to claude_desktop_config.json:

{
  "mcpServers": {
    "bahi-mcp": {
      "command": "uvx",
      "args": ["--with", "yfinance", "bahi-mcp"]
    }
  }
}

Drop "--with", "yfinance" if you don't need stock data. Restart Claude Desktop.

Cursor and other clients
{
  "mcpServers": {
    "bahi-mcp": {
      "command": "uvx",
      "args": ["--with", "yfinance", "bahi-mcp"]
    }
  }
}

For Cursor, save this in ~/.cursor/mcp.json. Remove "--with", "yfinance" if you don't need stock data.

Notes on data and accuracy

  • Mutual fund data comes from AMFI through mftool (3.4 or newer). NAVs are published after market close, usually by about 9 PM IST. mftool caches NAVs for 24 hours, so use clear_cache after the evening update to see the latest.
  • Stock data comes from Yahoo Finance through yfinance. It is unofficial, can be delayed, rate-limited or change without notice. Don't use it for trading decisions.
  • Tax estimates follow the configured FY 2026-27 assumptions for equity funds (STCG 20%, LTCG 12.5% above the remaining ₹1.25 lakh annual exemption); provide purchase and sale dates for exact calendar 12-month classification, or holding days for an approximate 365-day cutoff. The exemption is shared across eligible gains in a financial year. Debt funds are modelled at slab rate only for units bought on/after 1 April 2023. Surcharge, loss set-off and older indexation rules are not modelled; verify current law and consult a tax professional.
  • Projections (project_sip, calculate_swp, plan_retirement) assume constant returns. Real markets don't behave that way.

Development

git clone https://github.com/NayakwadiS/bahi-mcp
cd bahi-mcp
python -m venv .venv
source .venv/bin/activate        # Windows: .venv\Scripts\activate
pip install -e ".[dev,stocks]"
pytest
python -m bahi_mcp               # runs the server over stdio

Layout in src/bahi_mcp/:

  • analytics.py, fund_analytics.py, calculators.py: pure Python, no network, fully tested offline
  • data.py: AMFI access through mftool
  • market.py: stock and index access through yfinance
  • server.py: the MCP tool definitions

Roadmap

  • Portfolio overlap and fund-to-fund correlation
  • Document search over factsheets and SEBI/RBI circulars
  • Hosted version with caching

Contributing

Issues and pull requests are welcome.

License

MIT. See LICENSE.

الأسئلة الشائعة

ما هو io.github.NayakwadiS/bahi-mcp؟

Indian mutual fund data and analytics, NSE/BSE market data, and financial calculators.

كيف أثبّت io.github.NayakwadiS/bahi-mcp؟

يعمل على جهازك. في Claude Code: claude mcp add bahi-mcp -- uvx bahi-mcp==0.3.1. وفي العملاء الآخرين، الصق إعداد JSON من هذه الصفحة في إعدادات MCP الخاصة بهم.

هل يحتاج io.github.NayakwadiS/bahi-mcp إلى مفتاح API؟

لا يذكر إدراجه في السجل أي مفتاح أو سر إلزامي. قد تتطلب بعض الميزات حسابًا لدى الخدمة التي يتصل بها.

هل io.github.NayakwadiS/bahi-mcp مفتوح المصدر؟

نعم. شيفرته متاحة على GitHub بترخيص MIT.

من يصون io.github.NayakwadiS/bahi-mcp؟

ينشره NayakwadiS. يدرجه AI.tn لكنه لا يصونه ولا يوصي به.

من سجل MCP الرسمي. الإدراج ليس توصية: راجع شيفرة الخادم وصلاحياته قبل منحه الوصول إلى بياناتك.