Personal Finance MCP
Provides 77 deterministic financial calculators, live market data, and a meta-advisor that chains tools into prioritized plans from plain-language descriptions.
README
💰 Personal Finance MCP
Deterministic personal-finance toolkit exposed over the Model Context Protocol — 77 calculators, a meta-advisor, and live market data, with a polished web UI. Grounded in established financial mathematics.
<!-- mcp-name: io.github.sarveshtalele/personal-finance -->
Live demo: https://sarveshtalele-personal-finance-mcp.hf.space
Connector URL: https://sarveshtalele-personal-finance-mcp.hf.space/mcp
Demo
▶️ Watch the 2-minute demo — plain-language question → chained tools → a prioritized plan.
Public demo note: the hosted Space is a shared, best-effort instance (rate-limited, may cold-start after idle). For heavy or private use, run it locally or self-host (see docs/HOW_IT_WORKS.md).
Overview
Most finance "assistants" guess at numbers. This one doesn't. It ships 77 deterministic
calculators — same inputs, same answer, every time — and lets an LLM route a plain-language
question to the right tools. Describe your situation ("I'm 30, earn ₹1L/month, want to retire
at 60") and the create_financial_plan orchestrator chains the relevant calculators into a
single prioritised plan.
It runs three ways from one codebase:
- As an MCP server — connect it to Claude Desktop, Claude Code, Cursor, or any MCP client.
- As a website — a Next.js UI with a live calculator, a market dashboard, and a tool catalog.
- As a hosted connector — deployed to a Hugging Face Docker Space; one URL does all three.
Highlights
- 🔢 Deterministic — pure math, no model inference for the numbers.
- 🤖 Story → tools — the model maps intent to tools; users never name them.
- 🇮🇳 Theory-grounded — TVM, debt, PPF/SSY/NSC/EPF, bonds, derivatives, MPT, and more.
- 🛰️ Live market data — mutual-fund NAVs (AMFI), FX (ECB), equity quotes (Yahoo) — no API keys.
- 🔒 Hardened — stateless, rate-limited, input-bounded APIs with security headers/CSP.
Tool catalog — 77 tools, 13 categories
| Category | Tools | Examples |
|---|---|---|
| Time Value of Money | 10 | future/present value, annuity, perpetuity, EAR, real return |
| Portfolio Analytics | 11 | CAPM, Sharpe, Sortino, Treynor, alpha, allocation, rebalancing |
| Financial Planning | 9 | net worth, ratios, emergency fund, retirement, education, insurance |
| Small Savings (India) | 9 | PPF, SSY, NSC, KVP, SCSS, RD, FD, EPF |
| Mutual Funds | 7 | SIP, SWP, lumpsum-vs-SIP, CAGR, NAV, expense-ratio impact |
| Debt & Loans | 6 | EMI, amortization, prepayment, consolidation, invest-vs-prepay |
| Fixed Income | 6 | bond price, YTM, current yield, duration, convexity, zero-coupon |
| Derivatives | 5 | futures fair value, option payoff, put-call parity, Black-Scholes, beta hedge |
| Equity Valuation | 5 | DDM, two-stage DDM, P/E, DCF, dividend yield |
| Live Market Data | 4 | MF search, live NAV, FX rate, stock/index quote |
| Cash Flow & Budgeting | 3 | household cash flow, debt-to-income, contingency fund |
| Risk Profiling | 1 | suitability score → suggested equity/debt split |
| Advisor | 1 | create_financial_plan — the story → plan orchestrator |
Browse them all (with live descriptions) at /tools.
Quick start
Use the hosted connector (no install)
Claude Desktop — Settings → Connectors → Add custom connector → paste:
https://sarveshtalele-personal-finance-mcp.hf.space/mcp
Claude Code
claude mcp add --transport http personal-finance https://sarveshtalele-personal-finance-mcp.hf.space/mcp
Cursor / VS Code — add to mcp.json:
{
"mcpServers": {
"personal-finance": {
"url": "https://sarveshtalele-personal-finance-mcp.hf.space/mcp",
"transport": "http"
}
}
}
Install from PyPI (stdio server)
pip install personal-finance-mcp # or: uvx personal-finance-mcp
Then point Claude Desktop at it:
{
"mcpServers": {
"personal-finance": { "command": "uvx", "args": ["personal-finance-mcp"] }
}
}
Run locally from source
git clone https://github.com/sarveshtalele/personal-finance-mcp.git
cd personal-finance-mcp
pip install -e .
# Option A — classic stdio MCP server (offline, no web)
python -m src
# Option B — unified server: website + /mcp connector + /api (http://localhost:7860)
cd web && npm install && npm run build && cd ..
python -m src.web
For stdio, point Claude Desktop at the local process:
{
"mcpServers": {
"personal-finance": { "command": "python", "args": ["-m", "src"] }
}
}
The website
python -m src.web serves everything on one port:
| Path | What |
|---|---|
/ |
Next.js site — home, tool catalog, live calculator, market dashboard, setup guide |
/mcp |
MCP server over streamable-HTTP — the connector URL |
/api/* |
JSON endpoints (tool catalog, calculators, live market data) |
Architecture
src/
├── server.py # FastMCP server — registers all tool modules
├── __main__.py # `python -m src` (stdio transport)
├── tools/ # pure math fns + per-module register(mcp)
│ ├── tvm.py debt.py planning.py bonds.py stocks.py mutual_funds.py
│ ├── portfolio.py derivatives.py india_savings.py cashflow.py
│ ├── risk_profile.py advisor.py # advisor = story → plan orchestrator
│ └── marketdata.py # live AMFI / Frankfurter / Yahoo (keyless)
├── models/ # Pydantic schemas + enums
├── utils/ # output formatters
└── web/ # unified Starlette server (MCP + /api + static site)
├── server.py # routes, security middleware, calculator registry
└── __main__.py # `python -m src.web` (uvicorn, port 7860)
web/ # Next.js front-end (static export → web/out)
└── app/ # home, tools, calculator, dashboard, connect
Each tool file keeps deterministic pure functions separate from the thin @mcp.tool
wrappers, so the same functions power the MCP server, the web calculators, and the tests.
Security
- Stateless — no database, no sessions; every call is independent and reproducible.
- Hardened API — per-IP rate limiting, request-body cap, and input validation that bounds loop-driving parameters (years/months/age) to prevent denial-of-service.
- Security headers — CSP (with
frame-ancestorsfor the Hugging Face embed),X-Content-Type-Options,Referrer-Policy,Permissions-Policy; CORS limited to GET/POST without credentials. The header middleware is implemented at the ASGI layer so it never buffers the streaming/mcp(SSE) responses. - No secrets in the app — live-data sources are public and keyless.
See SECURITY.md to report a vulnerability.
Development
pip install -e ".[dev]"
pytest -q # 119 tests
ruff check . # lint
python -m src.web # run the full stack locally
Deployment
Deployed as a Hugging Face Docker Space, auto-synced from GitHub on every push to main
(see .github/workflows/hf-sync.yml). Full instructions —
local, Docker, and Hugging Face — are in docs/deployment.md.
Documentation
- docs/HOW_IT_WORKS.md — concepts (MCP, transports, semantic routing), full architecture with diagrams, end-to-end request flows, the security model, hosting it yourself / on a portfolio site, and a production-grade roadmap.
- docs/deployment.md — local, Docker, and Hugging Face deployment.
- docs/Architecture.md · docs/testing.md · docs/setup.md
Contributing
Contributions are welcome — see CONTRIBUTING.md and the
Code of Conduct. Good first issues: add a calculator (a pure function +
a register wrapper + a test), improve descriptions for better tool routing, or extend the
web UI.
Disclaimer
Educational tool for illustrating standard financial formulas. Not investment advice. Figures are illustrative; verify before making financial decisions.
License
MIT — free to use, modify, and distribute.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。
