Expense_Tracker_MCP
An AI-powered expense management server that enables adding, searching, and analyzing expenses using natural language through the Model Context Protocol.
README
๐ฐ Expense Tracker MCP
๐ค AI-Powered Expense Management using Model Context Protocol
<p align="center"> </p> <p align="center"> <img src="https://img.shields.io/badge/Python-3.13-blue?style=for-the-badge&logo=python"/> <img src="https://img.shields.io/badge/FastMCP-3.4.4-purple?style=for-the-badge"/> <img src="https://img.shields.io/badge/MongoDB-Database-green?style=for-the-badge&logo=mongodb"/> <img src="https://img.shields.io/badge/FastAPI-Backend-009688?style=for-the-badge&logo=fastapi"/> </p>
๐ Overview
Expense Tracker MCP is an AI-powered financial management system built usingModel Context Protocol (MCP ).
The system allows Large Language Models to interact with expense data throughMCP tools, enabling users to:
-
Add expenses
-
Search expenses
-
Analyze spending patterns
-
Generate financial insights
-
Communicate with expense data using natural language
๐ง MCP Architecture
flowchart TB
USER["๐ค User"]
CLIENT["๐ MCP Client"]
SERVER["โก FastMCP Server"]
TOOLS["๐ MCP Tools"]
FASTAPI["๐ FastAPI Application"]
MONGO["๐ MongoDB Database"]
USER --> CLIENT
CLIENT --> SERVER
SERVER --> TOOLS
TOOLS --> FASTAPI
FASTAPI --> MONGO
๐ Key Features
๐ธ Expense Managementโ Create expensesโ Update expensesโ Delete expensesโ Retrieve expense recordsโ Store financial history
๐ Model Context Protocol
This project implements MCP architecture:
User|MCP Client|FastMCP Server|Expense Tools|MongoDB
๐ ๏ธ Technology Stack
###๐ Core Development
<p align="center"> <img src="https://skillicons.dev/icons?i=python"/> </p> Python >= 3.13 Setuptools Wheel
โก MCP Framework
<img src="https://img.shields.io/badge/FastMCP-3.4.4-purple?style=flat-square"> MCP Server implementation Tool registration LLM communication layer
๐ Backend
<p align="center"> <img src="https://skillicons.dev/icons?i=fastapi"/> </p> FastAPI Uvicorn REST APIs
๐ Database
<p align="center"> <img src="https://skillicons.dev/icons?i=mongodb"/> </p> MongoDB PyMongo Motor Async Driver
๐ฆ Validation & Configuration
Pydantic v2Pydantic SettingsEnvironment Variablespython-dotenv
๐ Project Structure
Expense_Tracker/
โ
โโโ app/
โ โโโ db/
โ โโโ database.py # MongoDB connection configurations & client initialization
โ โโโ application.py # Core FastAPI application routing and logic
โ
โโโ mcp/
โ โโโ mcp_client.py # MCP Client implementation for context bridging
โ โโโ mcp_server.py # FastMCP Server registering the operational tools
โ
โโโ .env # Local environment variable configuration
โโโ .gitignore # Specified version control exclusions (e.g., venv, __pycache__ )
โโโ .python-version # Explicit python version pinning
โโโ pyproject.toml # Project metadata, dependencies, and editable tool configurations
โโโ README.md # System documentation## โ๏ธ Installation
Clone repository:
git clone https://github.com/YOUR_USERNAME/Expense-Tracker-MCP.git
cd Expense-Tracker-MCP
Install dependencies:
pip install -e .
๐ Environment Configuration
Create .env
MONGODB_URI=your_mongodb_connection_string
DATABASE_NAME=expense_tracker
โถ๏ธ Running Application
Start MCP Server
-expense-server
or
python mcp_server.py
๐ Remote MCP Server
This project also provides a remote MCP server that users can connect to:https://expense-tracker-01.fastmcp.app/mcp
API Documentation:
http://localhost:8000/docs
๐ฎ Future Improvements
-Expense prediction using ML-Budget recommendation engine-Voice-based expense entry-Multi-user authentication-React dashboard-Cloud deployment-Mobile application
๐จโ๐ป Developer
Sarim Abbas
AI Engineer | Backend Developer | Agentic AI Developer
<p align="center"> <img src="https://skillicons.dev/icons?i=python,fastapi,mongodb,docker,aws"/> </p>
โญ Star this repository if you find it useful!
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.