bahi-mcp
MCP server that gives AI assistants (Claude, Cursor, VS Code and others) access to Indian mutual fund data and investor analytics.
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 publicly available data (AMFI, via the
mftoollibrary). It is not investment advice and the author is not a SEBI-registered adviser. Data may be delayed or inaccurate. Verify before making decisions.
What you can ask
- "Find SBI midcap direct growth schemes and give me the latest NAV."
- "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 CAGR if ₹1,00,000 became ₹2,40,000 between 2018-04-01 and 2025-04-01?"
Tools
| Tool | What it does |
|---|---|
search_schemes |
Search schemes by name, returns AMFI scheme codes |
get_scheme_quote |
Latest NAV and quote for a scheme code |
get_scheme_details |
Fund house, type, category, start date |
get_nav_history |
NAV history with optional date range (capped to keep responses small) |
calculate_sip_returns |
Monthly SIP simulation on real NAV history: invested, units, value, absolute return, XIRR |
calculate_xirr |
XIRR for any dated cash flows |
calculate_cagr |
CAGR between two values over a date range |
Dates can be DD-MM-YYYY or YYYY-MM-DD.
Install
Requires Python 3.10+.
pip install bahi-mcp
Or run without installing, using uv:
uvx bahi-mcp
Configure your MCP client
Claude Desktop
Add to claude_desktop_config.json:
{
"mcpServers": {
"bahi-mcp": {
"command": "uvx",
"args": ["bahi-mcp"]
}
}
}
Restart Claude Desktop.
Cursor and other clients
{
"bahi-mcp": {
"command": "uvx",
"args": ["bahi-mcp"]
}
}
Development
git clone https://github.com/YOUR_USERNAME/bahi-mcp
cd bahi-mcp
python -m venv .venv
source .venv/bin/activate # Windows: .venv\Scripts\activate
pip install -e ".[dev]"
pytest
python -m bahi_mcp # runs the server over stdio
Calculations live in src/bahi_mcp/analytics.py (pure Python, fully tested offline). Data access is in data.py, and the MCP tools are defined in server.py.
Roadmap
- Portfolio overlap and fund comparison
- Rolling returns and risk metrics
- Tax-aware SIP and redemption planning
- Document search over factsheets and SEBI/RBI circulars
- Hosted version with caching
Contributing
Issues and pull requests are welcome.
License
MIT. See LICENSE.
Metadata
Release files for bahi-mcp 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| bahi_mcp-0.1.0.tar.gz | 7.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| bahi_mcp-0.1.0-py2.py3-none-any.whl | Python 2, Python 3 | none | any | Details |
Total release size: 16.9 kB
Release files / bahi_mcp-0.1.0.tar.gz
| Download URL | bahi_mcp-0.1.0.tar.gz |
|---|---|
| Size | 7.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
cae3c85cced9e86527a84ead8d6ef3984c10fd54daf4eda7d219c5108d009856
|
|
BLAKE2b-256 checksum How to use checksums |
0ddc4acd6f1be77c6084811c096b248e3b3d45bc674c2df53e6adfac005bbfa9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Release files / bahi_mcp-0.1.0-py2.py3-none-any.whl
| Download URL | bahi_mcp-0.1.0-py2.py3-none-any.whl |
|---|---|
| Size | 9.0 kB |
| Tags | Python 2 Python 3 |
|
SHA-256 checksum How to use checksums |
367afce35841c75a81e8c0fde5d91e931ffdf4663d77f55f533d42a816b9b7fc
|
|
BLAKE2b-256 checksum How to use checksums |
6f7d8b5ed41b5c12d65207931f52fa922c285c339d060cab9894de088d4bc87a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Security for bahi-mcp 0.1.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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.