mcp-finance-assistant
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@mcp-finance-assistantHow much did I spend on food this month?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
๐ฐ Personal Finance Assistant โ MCP + Gemini
An AI-powered finance assistant that lets you ask questions about your expenses in plain English. Built using the Model Context Protocol (MCP) to connect Google's Gemini to real tools โ a SQL database, forecasting models, and anomaly detection โ instead of a scripted chatbot that only knows how to talk.
๐ Live demo: mcp-finance-assistant-z6txg3k6xparsajcsvftrr.streamlit.app
What it does
Ask it things like:
"How much did I spend on food this month?"
"Compare my spending in August vs July"
"Add an expense of 250 for Uber to the airport" โ it infers the category itself
"What will I spend on food next month?" โ real ML forecasting, not a guess
It also proactively flags unusual spending the moment the page loads, without being asked.
Related MCP server: Expense Tracker MCP Server
Why MCP
Most AI finance-tracker demos hardcode a chatbot's responses or bolt an LLM onto static data. This project instead builds a real MCP server โ a standardized way (introduced by Anthropic) for an AI model to discover and call real tools. Gemini reads the available tools, decides which one(s) it needs, calls them through the MCP protocol, and reasons over the actual results. It's the same pattern used by production AI agent systems, not a toy simulation.
Architecture
User question โ Streamlit UI โ Gemini (decides which tool to call)
โ
MCP Server (server.py)
โ
SQLite Database (real transaction data)
โ
Tool result โ back to Gemini โ plain-English answerFor multi-step requests (like adding an expense without a category), Gemini chains multiple tool calls โ first fetching existing categories, then inferring the right one, then adding the expense โ up to 3 steps per question.
Features
7 MCP tools: query totals, compare months, list recent expenses, add expenses, get categories, forecast spending, detect anomalies
Real ML, not rules:
forecast_next_monthuses scikit-learnLinearRegressionon historical trends;detect_anomalyuses an unsupervisedIsolationForestmodel instead of a hardcoded thresholdLLM-inferred categorization: describe an expense in plain English and Gemini picks the right category on its own, chaining tool calls to do it
Proactive insights: automatic anomaly checks run on page load, no question needed
Conversation memory: follow-up questions understand context from earlier in the chat
Real data: 240+ real transaction records, including 231 imported and cleaned from a public Kaggle personal-expense dataset
Production practices: full error handling and input validation on every tool, structured logging (
app.log), and an 8-testpytestsuite verifying calculations against known data
Tech stack
Python ยท MCP SDK ยท Google Gemini (google-genai) ยท SQLite ยท scikit-learn ยท Streamlit ยท pytest
Running it locally
git clone https://github.com/srushtikochare/mcp-finance-assistant
cd mcp-finance-assistant
pip install -r requirements.txtCreate a .env file:
GOOGLE_API_KEY=your_api_key_hereThen run:
streamlit run app.pyRunning the tests
pytest test_server.py -v8 tests covering correct sums, error handling, and ML tool behavior โ all passing.
A real challenge I hit
The MCP Python SDK's structure had changed since most available documentation was written โ the class I expected (FastMCP) didn't exist in the installed version. Rather than guess, I inspected the actual installed package (dir(mcp.server)) to find the correct current class (MCPServer) and API surface. Debugging against an evolving library with incomplete docs, instead of a stable tutorial-friendly one, was the most valuable part of building this.
Possible next steps
Multi-user support with individual logins
Receipt/statement OCR upload for automatic expense entry
Retry logic with backoff for external API resilience
Author
Srushti Kochare โ B.Tech Artificial Intelligence & Data Science, YCCE Nagpur
This server cannot be deployed
Maintenance
Related MCP Connectors
Personal finance by conversation: expenses, receipts, statement import, budgets, net worth.
Chat with your bank data: balances, transactions, budgets, bills. Reads only, never moves money.
Ask questions in plain language, get answers from your business database. No SQL required.
Capture receipts, scan Gmail, analyze spending, and create reviewed reports from AI assistants.
Related MCP Servers
- AlicenseAqualityAmaintenanceEnables financial professionals to interact with QuickBooks Online using natural language for reports, journal entries, bills, expenses, and more.36185 npm13MIT
- FlicenseNot gradedqualityDmaintenanceEnables AI-driven expense tracking and budget management, including adding expenses, setting budgets, analyzing trends, forecasting, and managing savings goals via natural language.-
- FlicenseNot gradedqualityDmaintenanceEnables users to manage personal finances using natural language, including tracking expenses, income, budgets, and generating financial summaries.-
- AlicenseNot gradedqualityCmaintenanceLets you query your personal finances in plain language, log expenses, and correct transaction categories through a secure MCP endpoint.MIT