pypi personal-finance-mcpstdioMITupdated 1mo ago
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.
What can you do with personal finance?
๐ฐ 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.
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.
Install
Add personal finance to your client. Pick the one you use.
claude mcp add personal-finance-mcp -- uvx personal-finance-mcpcodex mcp add personal-finance-mcp -- uvx personal-finance-mcpamp mcp add personal-finance-mcp -- uvx personal-finance-mcp{
"mcpServers": {
"personal-finance-mcp": {
"command": "uvx",
"args": [
"personal-finance-mcp"
]
}
}
}Add to `claude_desktop_config.json`, then restart Claude Desktop.
{
"mcpServers": {
"personal-finance-mcp": {
"command": "uvx",
"args": [
"personal-finance-mcp"
]
}
}
}Add to `~/.cursor/mcp.json`, or `.cursor/mcp.json` for a single project.
code --add-mcp '{"name":"personal-finance-mcp","command":"uvx","args":["personal-finance-mcp"]}'Or add the block manually to `.vscode/mcp.json` under `servers`.
{
"mcpServers": {
"personal-finance-mcp": {
"command": "uvx",
"args": [
"personal-finance-mcp"
]
}
}
}Add to `~/.codeium/windsurf/mcp_config.json`.
{
"mcpServers": {
"personal-finance-mcp": {
"command": "uvx",
"args": [
"personal-finance-mcp"
]
}
}
}Add to `cline_mcp_settings.json` via the MCP Servers panel.
{
"mcpServers": {
"personal-finance-mcp": {
"command": "uvx",
"args": [
"personal-finance-mcp"
]
}
}
}Add to `~/.gemini/settings.json`.
{
"mcpServers": {
"personal-finance-mcp": {
"type": "local",
"command": "uvx",
"args": [
"personal-finance-mcp"
],
"tools": [
"*"
]
}
}
}Add to `~/.copilot/mcp-config.json`, or run `/mcp add` inside the CLI.
{
"context_servers": {
"personal-finance-mcp": {
"command": {
"path": "uvx",
"args": [
"personal-finance-mcp"
]
}
}
}
}Add to your Zed `settings.json`.
uvx personal-finance-mcpRun `goose configure`, choose **Add Extension โ Command-line Extension**, and paste this command.
Score
39 / 100
Incomplete
- Documentation25/25
- Maintenance16/25
- Trust13/20
- Capability0/15
- Install experience12/15
- Documents what it does and how to connect
- Has a resolvable package or endpoint
- Exposes at least one tool, prompt or resource
- README has substantive content
- Includes a code example
- Documents its configuration
- Mentions credentials or security posture
- Last commit 30 days ago
- Has a release history
- Repository is not archived
- Licensed MIT
- Namespace verified in the official MCP registry
- Claimed by its owner
- Published under an organisation
- 0 tool(s) documented
- Provides prompt templates
- Provides resources
- 12 documented install method(s)
- Published to a package registry
- Offers a hosted endpoint โ no local install
Version history
| Versions | Published |
|---|---|
| 1.0.2Latest | Apr 11, 2026 |
| 1.0.1 | Apr 11, 2026 |
