Expense Tracker MCP Server
Click on "Install 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., "@Expense Tracker MCP ServerAdd an expense of $30 for lunch today"
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.
💰 Expense Tracker MCP Server
A powerful, AI-ready expense tracking system built with FastMCP (Model Context Protocol) that integrates seamlessly with Claude AI and other LLM applications.
🎯 Status: Production-Ready | 📊 Database: SQLite | 🚀 Framework: FastMCP 3.4.2
✨ Features
🎯 Core Expense Management
✅ Add Expenses - Track daily spending with category, subcategory, and notes
✅ List Expenses - Query expenses by date range
✅ Summarize - Category-wise expense breakdown with totals
💰 Budget Management
✅ Set Budget - Define monthly budgets per category
✅ Check Budget Status - Real-time budget vs actual spending with 🔴🟡🟢 status indicators
✅ Budget Alerts - Automatic warnings at 80% budget usage
📊 Analytics & Insights
✅ Spending Trends - Weekly trend analysis (last 30 days)
✅ Advanced Analytics - Highest/lowest expenses, median, averages per category
✅ Smart Insights - AI-generated spending patterns and recommendations
✅ Monthly Reports - Comprehensive month-end summaries
🔄 Recurring Expenses
✅ Add Recurring Expenses - Subscriptions, rent, bills (daily/weekly/monthly/yearly)
✅ List Recurring - View all active subscriptions with estimated monthly cost
🎯 Savings Goals
✅ Create Savings Goals - Vacation, emergency fund, new gadgets, etc.
✅ Track Progress - Update and monitor goal achievements
✅ View All Goals - Dashboard with progress percentages and deadlines
🔮 Forecasting
✅ Expense Forecast - Predict next month expenses (70% historical + 30% recurring)
✅ Spending Prediction - AI-powered forecasting based on patterns
Related MCP server: MCP Agent - AI Expense Tracker
🛠️ Installation
Prerequisites
Python 3.8+
pip or uv (recommended)
Step 1: Clone Repository
git clone https://github.com/mhd-faraz/Expense-Tracker-MCP.git
cd Expense-Tracker-MCPStep 2: Create Virtual Environment
# Using uv (faster)
uv venv
source .venv/bin/activate
# Or using Python venv
python3 -m venv .venv
source .venv/bin/activateStep 3: Install Dependencies
uv add fastmcp aiosqliteStep 4: Run Server
python3 main.pyExpected Output:
✅ Database initialized with all tables - write access confirmed
INFO: Uvicorn running on http://0.0.0.0:8321/mcp (Press CTRL+C to quit)📖 Usage
Option 1: MCP Inspector (Testing)
Open browser:
http://localhost:8321/mcp/inspectorSelect tool from dropdown
Fill parameters
Click "Run Tool"
Example:
{
"date": "2026-06-19",
"amount": 450,
"category": "Food & Dining",
"subcategory": "Restaurant",
"note": "Lunch with team"
}Option 2: Claude Desktop (Production)
Connect to this MCP server in Claude Desktop
Use natural language:
"Add an expense of ₹3000 for groceries today"
"Show my spending trends for the last 30 days"
"What's my budget status for this month?"
"Create a savings goal of ₹50000 for vacation by December"
"Forecast my next month expenses"Claude will automatically call the appropriate tools and update your database!
Option 3: Python Script
import aiosqlite
import asyncio
async def add_expense():
async with aiosqlite.connect("/tmp/expenses.db") as db:
await db.execute(
"INSERT INTO expenses(date, amount, category, note) VALUES (?,?,?,?)",
("2026-06-19", 450, "Food & Dining", "Lunch")
)
await db.commit()
asyncio.run(add_expense())🗄️ Database Schema
expenses
CREATE TABLE expenses(
id INTEGER PRIMARY KEY AUTOINCREMENT,
date TEXT NOT NULL,
amount REAL NOT NULL,
category TEXT NOT NULL,
subcategory TEXT DEFAULT '',
note TEXT DEFAULT '',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)budgets
CREATE TABLE budgets(
id INTEGER PRIMARY KEY AUTOINCREMENT,
category TEXT NOT NULL,
amount REAL NOT NULL,
month TEXT NOT NULL,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
UNIQUE(category, month)
)recurring_expenses
CREATE TABLE recurring_expenses(
id INTEGER PRIMARY KEY AUTOINCREMENT,
name TEXT NOT NULL,
amount REAL NOT NULL,
category TEXT NOT NULL,
frequency TEXT NOT NULL,
start_date TEXT NOT NULL,
end_date TEXT,
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)savings_goals
CREATE TABLE savings_goals(
id INTEGER PRIMARY KEY AUTOINCREMENT,
goal_name TEXT NOT NULL,
target_amount REAL NOT NULL,
current_amount REAL DEFAULT 0,
deadline TEXT NOT NULL,
category TEXT DEFAULT 'Savings',
created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
)Database Location: /tmp/expenses.db (macOS/Linux)
🔧 Available Tools (13 Total)
# | Tool | Purpose | Parameters |
1 |
| Add new expense | date, amount, category, subcategory, note |
2 |
| Query expenses | start_date, end_date |
3 |
| Category summary | start_date, end_date, category |
4 |
| Set monthly budget | category, amount, month |
5 |
| Budget tracking | month |
6 |
| Add subscription | name, amount, category, frequency, start_date |
7 |
| View subscriptions | (no params) |
8 |
| New savings target | goal_name, target_amount, deadline, category |
9 |
| Track progress | goal_id, amount_saved |
10 |
| View all goals | (no params) |
11 |
| Weekly trends | days |
12 |
| Detailed stats | start_date, end_date |
13 |
| Next month prediction | months_ahead |
14 |
| AI recommendations | (no params) |
15 |
| Monthly summary | month |
📊 Example Outputs
Budget Status:
Category Budget Spent Remaining Usage% Status
Food & Dining ₹5000 ₹2300 ₹2700 46.0% 🟢 OK
Transportation ₹3000 ₹1200 ₹1800 40.0% 🟢 OK
Bills & Utilities ₹4000 ₹2500 ₹1500 62.5% 🟢 OKSmart Insights:
🎯 TOP SPENDING
Food & Dining is your biggest expense (₹2300) - 35.2% of budget
📊 FREQUENCY
Transportation has most transactions (4 times). Small amounts add up!
📈 DAILY PACE
You're spending ₹473 per day on average
💡 OPTIMIZATION
You have 3 categories eating >20% of budget. Consider consolidating!Forecast:
Category Predicted vs Last Month
Bills & Utilities ₹6429.70 ↑ +157.2%
Groceries ₹2450.00 ↓ -30.0%
Food & Dining ₹2060.00 ↓ -10.4%🚀 Connect to Claude Desktop
Step 1: Get Server URL
http://0.0.0.0:8321/mcpStep 2: Add to Claude Settings
In Claude Desktop, go to Settings → Connected Servers:
{
"mcpServers": {
"expense-tracker": {
"command": "python3",
"args": ["/path/to/main.py"],
"type": "stdio"
}
}
}Step 3: Start Using!
Now tell Claude:
"I spent ₹3000 on groceries today"
"Show my monthly budget status"
"Create a savings goal for my vacation"
"What are my spending trends?"📁 Project Structure
Expense-Tracker-MCP/
├── main.py # Main MCP server (13 tools)
├── test_expense_tracker.py # Complete test suite
├── categories.json # Category definitions
├── .gitignore # Git ignore rules
├── README.md # This file
└── .venv/ # Virtual environment🧪 Testing
Run the complete test suite:
python3 test_expense_tracker.pyOutput includes:
✅ 10 sample expenses
✅ 5 budget configurations
✅ 5 recurring expenses
✅ 4 savings goals
✅ All 15 tools tested
✅ Formatted analytics and reports
🔐 Security & Best Practices
✅ Database uses WAL mode for concurrent access
✅ Async/await for non-blocking operations
✅ Input validation on all parameters
✅ Proper error handling with meaningful messages
✅ Database transactions for data integrity
📈 Tech Stack
Framework: FastMCP 3.4.2
Database: SQLite 3
Async Runtime: asyncio + aiosqlite
Server: Uvicorn
Language: Python 3.12+
🎯 Use Cases
Personal Finance Tracking - Daily expense logging
Budget Planning - Monthly budget management
Goal Tracking - Savings and financial targets
Spending Analysis - Trend analysis and forecasting
AI Integration - Natural language expense tracking via Claude
📝 Categories Supported
Food & Dining Bills & Utilities Healthcare
Transportation Entertainment Travel
Shopping Education Business
Subscriptions Groceries Personal Care
Other🤝 Contributing
This is a portfolio project. Feel free to fork and extend!
Ideas for enhancement:
Export to CSV/PDF
Multi-user support
Cloud sync
Mobile app integration
Advanced ML predictions
📄 License
MIT License - Feel free to use and modify!
👨💻 Author
Faraz - CS Engineering Graduate (2025)
Portfolio: faraz-portfolio-ivvo-xi.vercel.app
GitHub: @mhd-faraz
🙋 FAQ
Q: Database file empty?
A: Database files are binary. Use list_expenses() tool to verify data exists.
Q: Can I use this without Claude Desktop?
A: Yes! Use MCP Inspector or call tools directly via Python.
Q: How do I reset all data?
A: Delete /tmp/expenses.db and restart server.
Q: Can I host this online?
A: Yes! Deploy to MCPCloud, Vercel, or Railway.
🚀 Next Steps
✅ Clone this repo
✅ Run
python3 main.py✅ Open
http://localhost:8321/mcp/inspector✅ Test a tool
✅ Connect to Claude Desktop
✅ Start tracking expenses with AI!
Happy Expense Tracking! 💰✨
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-quality-maintenanceEnables personal financial management through AI assistants by providing tools to add transactions, check balances, list transaction history, and generate monthly summaries. Supports natural language interaction for tracking income and expenses with categorization.Last updated1
- Alicense-qualityDmaintenanceEnables AI agents to manage personal expenses through natural language conversations. Supports adding, searching, and analyzing transactions with automatic categorization and financial insights.Last updated3MIT
- Flicense-qualityFmaintenanceAn AI-powered financial management engine that enables budgeting, smart expense tracking, and affordability analytics via the Model Context Protocol. It allows AI assistants to interact with financial data through natural language for tasks like category detection, bulk expense ingestion, and budget impact predictions.Last updated1
- Flicense-qualityDmaintenanceEnables users to manage personal finances—tracking expenses, income, budgets, and generating summaries—through natural language commands via AI assistants like Claude.Last updated
Related MCP Connectors
Personal finance by conversation: expenses, receipts, statement import, budgets, net worth.
Log, query, and edit expenses, budgets, and accounts in Ledgy from any MCP-compatible AI assistant.
Ask your AI about bank accounts, spending, debts, holdings, and investment activity.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/mhd-faraz/Expense-Tracker-MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server