Expense_Tracker_MCP
README.md
# ๐ฐ 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 using**Model 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
```mermaid
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](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!
This server cannot be deployed
Maintenance
ActivityStale
ResponsivenessNo issues