Expense_Tracker_MCP
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_MCPadd a $50 expense for dinner under Food"
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.
π Overview
Expense Tracker MCP Server bridges the gap between Large Language Models (LLMs) and Personal Financial Intelligence. Traditional finance tools force users to perform manual data entry across complex tabular interfaces. By introducing a standardized Model Context Protocol (MCP) backend, AI assistants can converse with your local database to manage transactions, monitor budgets, and audit financial health autonomously.
Why MCP? Standard APIs require custom LLM integrations and continuous maintenance. MCP provides an open, universal standard connecting AI applications to data sources securely, preserving local privacy without third-party SaaS cloud lock-in.
π‘ Core Value Drivers
π§ Natural Language Accounting: Simply say "I spent $45 on groceries today" and let the AI extract merchants, categories, amounts, and dates with full validation.
π‘οΈ Zero Cloud Leakage & Isolation: All transactions are stored locally or in your private PostgreSQL instance. Multi-tenant UUID isolation keeps user records compartmentalized.
π Proactive Financial Intelligence: Beyond storage, the server empowers AI clients to run spending trend analyses, calculate category distribution metrics, and flag budget overruns dynamically.
π Executive Exports: Instant generation of production-ready CSV, Excel spreadsheets, and formatted PDF reports straight from chat windows.
Related MCP server: accounting-mcp-server
ποΈ System Architecture
Built from the ground up using clean Layered & Repository Architecture patterns to enforce strict separation of concerns, complete testability, and asynchronous performance.
graph TD
%% Styling Definitions
classDef client fill:#1e293b,stroke:#38bdf8,stroke-width:2px,color:#f8fafc;
classDef mcp fill:#0f172a,stroke:#818cf8,stroke-width:2px,color:#f8fafc;
classDef service fill:#1e1b4b,stroke:#c084fc,stroke-width:2px,color:#f8fafc;
classDef repo fill:#111827,stroke:#34d399,stroke-width:2px,color:#f8fafc;
classDef db fill:#064e3b,stroke:#10b981,stroke-width:2px,color:#f8fafc;
subgraph LLM_Clients[" Client Integration Layer "]
Claude[" π€ Claude Desktop Client "]:::client
Cursor[" π» Cursor IDE / VS Code "]:::client
Gemini[" π Gemini CLI / Custom Agent "]:::client
end
subgraph MCP_Server[" Model Context Protocol (FastMCP) "]
ToolRegistry[" β‘ Tools Layer (17 Endpoint Handlers) "]:::mcp
Schemas[" π‘οΈ Pydantic v2 Schema Validation "]:::mcp
end
subgraph Application_Core[" Business & Persistence Layer "]
Services[" βοΈ Service Layer (Business Logic & Audit Logs) "]:::service
Repos[" π¦ Repository Layer (Async Queries & Data Access) "]:::repo
end
subgraph Database_Layer[" Storage Engine "]
PostgreSQL[(" π PostgreSQL 16 DB\n(SQLAlchemy 2.0 Async + JSONB Audits) ")]:::db
end
Claude -->|stdio / JSON-RPC| ToolRegistry
Cursor -->|stdio / JSON-RPC| ToolRegistry
Gemini -->|stdio / JSON-RPC| ToolRegistry
ToolRegistry --> Schemas
Schemas --> Services
Services --> Repos
Repos --> PostgreSQL⨠Key Feature Cards
π MCP Execution Workflow
sequenceDiagram
autonumber
actor User as π€ User
participant Claude as π€ Claude Desktop
participant MCP as β‘ MCP Server (FastMCP)
participant Service as βοΈ Service / Repo
participant DB as π PostgreSQL DB
User->>Claude: "Add βΉ450 spent on Pizza yesterday under Food"
Claude->>Claude: Parse Intent & Select Tool `add_expense`
Claude->>MCP: Call `add_expense(amount=450, category="Food", title="Pizza", date="2026-07-23")`
MCP->>MCP: Validate Input Schema via Pydantic v2
MCP->>Service: Dispatch to `ExpenseService.create()`
Service->>DB: Execute Async INSERT & Update Budget Totals
DB-->>Service: Return Transaction Record + Audit ID
Service-->>MCP: Format Structured Response
MCP-->>Claude: JSON Tool Result (Success Payload)
Claude-->>User: "Expense of βΉ450 logged successfully! Monthly Food budget remaining: βΉ3,550."π Project Structure
Expense_Tracker_MCP/
βββ π expense_tracker/ # Main Application Package
β βββ π database/ # Database Connection & Migration Setup
β β βββ π models/ # SQLAlchemy 2.0 ORM Models (Expense, Budget, CreditCard, Audit)
β β βββ π connection.py # Async Engine & Session Generators
β β βββ π base.py # Declarative Base & Mixins
β βββ π repositories/ # Data Access Layer (Decoupled SQLAlchemy Queries)
β β βββ π expense_repo.py
β β βββ π budget_repo.py
β β βββ π card_repo.py
β βββ π services/ # Core Business Logic & Audit Trail Handlers
β β βββ π expense_service.py
β β βββ π budget_service.py
β β βββ π report_service.py
β βββ π schemas/ # Pydantic v2 Request/Response Validation Models
β β βββ π financial_schemas.py
β βββ π tools/ # FastMCP Endpoint Registration Handlers (17 Tools)
β β βββ π expense_tools.py
β β βββ π budget_tools.py
β β βββ π card_tools.py
β β βββ π report_tools.py
β βββ π server.py # FastMCP Server Entrypoint & Initialization
βββ π alembic/ # Database Schema Migration Scripts
β βββ π versions/ # Sequential Version Stamps
β βββ π env.py # Migration Environment Config
βββ π tests/ # Pytest Test Suite (SQLite In-Memory / Asyncpg)
β βββ π test_expenses.py
β βββ π test_budgets.py
β βββ π test_reports.py
βββ π docker-compose.yml # Production PostgreSQL & MCP Stack Containerization
βββ π Dockerfile # Multi-stage Lightweight Python 3.12 Build
βββ π pyproject.toml # UV / Hatchling Project Configuration
βββ π alembic.ini # Alembic Configuration Settings
βββ π README.md # Project Documentationπ Quick Start Guide
Prerequisites
Ensure you have the following software installed on your host system:
Python:
v3.12+PostgreSQL:
v16+(or Docker)uv:
v0.1.0+(Fast Python package installer and resolver)
Step 1: Clone Repository
git clone https://github.com/satyam0singh/Expense_Tracker_MCP.git
cd Expense_Tracker_MCPStep 2: Set Up Virtual Environment
# Create virtual environment with uv
uv venv
# Activate Virtual Environment
# On Linux/macOS:
source .venv/bin/activate
# On Windows (PowerShell):
.venv\Scripts\Activate.ps1
# Install package dependencies in editable mode
uv pip install -e .Step 3: Configure Environment Variables
Create a .env file in the root directory (or copy from .env.docker):
DATABASE_URL=postgresql+asyncpg://postgres:postgres@localhost:5432/expense_db
USER_ID=123e4567-e89b-12d3-a456-426614174000
ENVIRONMENT=production
LOG_LEVEL=INFOStep 4: Run Database Migrations
Apply database schemas using Alembic:
uv run alembic upgrade headβοΈ Claude Desktop Configuration
To allow Claude Desktop to control the server, register it inside your local configuration file.
Location of claude_desktop_config.json:
macOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%APPDATA%\Claude\claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add Configuration:
{
"mcpServers": {
"expense-tracker": {
"command": "uv",
"args": [
"--directory",
"C:/path/to/Expense_Tracker_MCP",
"run",
"python",
"-m",
"expense_tracker.server"
],
"env": {
"DATABASE_URL": "postgresql+asyncpg://postgres:postgres@localhost:5432/expense_db",
"USER_ID": "123e4567-e89b-12d3-a456-426614174000"
}
}
}
}Understanding USER_ID Scoping
The USER_ID environment variable is a unique UUID assigned to your client instance. If you run multiple Claude instances or share a remote PostgreSQL database, changing USER_ID guarantees complete isolation between financial profiles.
π οΈ Available MCP Tools
The server dynamically exposes 17 robust endpoints directly into the LLM context window:
Icon | Tool Name | Category | Description / Purpose | Return Type | Natural Language Example |
β |
| Expense | Records new transaction & adjusts budget caps |
| "Add βΉ450 for Pizza yesterday" |
βοΈ |
| Expense | Modifies fields of an existing record |
| "Change expense #12 category to Dining" |
ποΈ |
| Expense | Soft-deletes a record with audit tracking |
| "Delete expense #45" |
π |
| Query | Filters transactions by date, merchant, or notes |
| "Find all electronics expenses last week" |
π·οΈ |
| Metadata | Retrieves hierarchy of categories & subcategories |
| "What categories can I log expenses under?" |
π― |
| Budget | Configures monthly spending limit for category |
| "Set a βΉ10,000 budget for Food this month" |
π |
| Budget | Adjusts existing category spending ceiling |
| "Increase my Shopping budget to βΉ15,000" |
π |
| Budget | Reports consumed % and remaining balance |
| "How much budget is left in Groceries?" |
π° |
| Analytics | Category percentage breakdown for a month |
| "Show category spending pie chart breakdown" |
π¬ |
| Analytics | High-level summary, average ticket, & peak days |
| "Analyze my spending habits for July" |
π |
| Analytics | Multi-month velocity & month-over-month delta |
| "Compare spending over the past 6 months" |
π³ |
| Credit Card | Registers a new credit card line & limit |
| "Add HDFC card with limit βΉ2,000,000" |
π³ |
| Credit Card | Displays active cards, utilization, & due dates |
| "List all my active credit cards" |
πΈ |
| Credit Card | Logs payments made against credit balances |
| "Record βΉ5,000 payment to HDFC card" |
π |
| Reports | Generates raw CSV export file path |
| "Export July expenses to CSV" |
π |
| Reports | Generates formatted Excel workbook with formulas |
| "Generate Excel report for Q2" |
π |
| Reports | Generates printable PDF statement document |
| "Create a PDF summary of my expenses" |
π» Visual Technology Stack
Domain | Technologies Used |
Language & Core | |
Protocol Framework | |
Database & Engine | |
ORM & Migrations | |
Validation & Schemas | |
Containerization | |
Testing & Quality | |
πΌοΈ Application Interfaces
+-----------------------------------------------------------------------------------+
| CLAUDE DESKTOP DEMO PLACEHOLDER |
| |
| User: "Add βΉ450 spent on Pizza yesterday." |
| Claude: [Executing Tool: add_expense] |
| -> Amount: βΉ450.00 | Category: Food | Date: 2026-07-23 |
| "Successfully recorded expense #104. Remaining Food Budget: βΉ3,550.00" |
+-----------------------------------------------------------------------------------+Interface | Preview Mockup |
Claude Desktop Integration | |
Budget Analytics Dashboard | |
Executive PDF Financial Statement |
π¬ Real-World AI Conversation Example
π¬ User
"Add βΉ450 spent on Pizza yesterday."
π€ Claude (via Expense Tracker MCP)
Calling tool: add_expense(amount=450, category="Food & Dining", title="Pizza", date="2026-07-23")
Response:
β
Expense recorded successfully!
β’ Transaction ID: #104
β’ Amount: βΉ450.00
β’ Category: Food & Dining
β’ Date: July 23, 2026
π Budget Update:
You have spent βΉ6,450 of your βΉ10,000 Food budget for July. (64.5% consumed, βΉ3,550 remaining).π¬ User
"How much did I spend on Food this month? Show me a breakdown."
π€ Claude (via Expense Tracker MCP)
Calling tool: get_category_breakdown(month=7, year=2026)
Response:
Here is your Food spending summary for July 2026:
Total Spent: βΉ6,450.00 (14 transactions)
Breakdown:
π Groceries: βΉ3,800.00 (58.9%)
π Dining Out: βΉ2,150.00 (33.3%)
β Coffee Shops: βΉ500.00 (7.8%)
π‘ Insight: Your dining out expenses increased by 12% compared to June.π Multi-Format Report Generation Engine
The server includes dedicated export services to render financial files dynamically:
π CSV Export (
export_csv): Standard RFC 4180 formatted flat CSV files ideal for importing into Google Sheets, ledger tools, or custom data pipelines.π Excel Workbook Export (
export_excel): Usesopenpyxlto build structured spreadsheets featuring automated column width calculation, styled header banners, currency formatting, and SUM total formulas.π PDF Executive Statement (
export_pdf): Built usingreportlabto construct clean vector PDF reports containing table summaries, category distribution graphics, audit footers, and page numbers.
β‘ Performance Benchmarks
Engineered for lightning-fast execution times, minimizing LLM tool call latency:
Operation Metric | Mean Duration | Throughput / Capacity | Benchmark Notes |
Tool Execution Latency |
| ~85 req/sec | Standard local PostgreSQL connection |
Async Connection Pool |
| 20 Pool Connections | Powered by |
Pydantic Validation Time |
| 2,500 validation/sec | Pydantic v2 Compiled Rust Core |
PDF Report Generation |
| Single-page document | Complete PDF rendering with ReportLab |
Memory Footprint |
| Idle RAM Usage | Optimized Python 3.12 footprint |
π‘οΈ Security & Data Governance
π User Scoping & Isolation: Enforced
USER_IDfilter predicate across all queries prevents horizontal data leakage.π Immutable JSONB Audit Logs: All state-modifying tools capture original state, target state, timestamps, and caller IDs in an
audit_logstable.π SQL Injection Prevention: Built entirely on SQLAlchemy 2.0 ORM query builders using parameterized input bindings.
ποΈ Soft-Delete Lifecycle: Records are marked with a soft
is_deletedflag, preserving data integrity and permitting recovery if directed by users.
πΊοΈ Product Roadmap
v1.0.0 β Core Engine Release
Asynchronous FastMCP Server core integration
PostgreSQL + SQLAlchemy 2.0 async persistence layer
17 Core Tools for expenses, budgets, credit cards, and exports
Comprehensive Pytest suite and Docker containerization
v1.1.0 β Smart Subscriptions & Rules (In Progress)
Recurring expense automation (Subscriptions, Rent, Bills)
Custom categorization rule engine with regex matching
v1.2.0 β Auth & Multi-User
OAuth2 / API Key authentication handshake
Multi-currency support with real-time FX conversion rates
v2.0.0 β Web Interface & Ecosystem
Full-fledged Next.js Web Dashboard for graphical inspection
Cloud sync adapter for Supabase and AWS RDS
π€ Contributing
Contributions are warmly welcomed! To contribute:
Fork the Repository:
git checkout -b feature/amazing-featureCommit your changes:
git commit -m 'feat: Add amazing feature'Push to the Branch:
git push origin feature/amazing-featureOpen a Pull Request for review.
Please ensure all pytest checks pass prior to opening a PR:
uv run pytest testsπ License
Distributed under the MIT License. See LICENSE for complete terms and details.
π¨βπ» Author & Maintainer
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
- AlicenseAqualityDmaintenancePersonal expense tracker MCP server that enables tracking expenses, income, budgets, and savings goals through natural language.10MIT
- -license-quality-maintenanceA personal accounting MCP server that enables AI assistants to record and query financial transactions through natural language, supporting income/expense tracking, balance inquiry, and monthly summaries.
- Flicense-qualityCmaintenanceA cloud-deployed MCP server for managing personal expenses and providing financial analytics. It enables AI assistants like Claude Desktop to add, update, delete, and retrieve expenses, with features like budgeting assistance and category-wise summaries.
- FlicenseAqualityBmaintenanceA lightweight MCP server for managing personal finances locally. It allows users to log transactions, view summaries, manage categories, and interact with their budget via any MCP-compatible LLM client.12
Related MCP Connectors
Hosted MCP server for Mini Accountant: invoices, expenses, customers, analytics, tax estimates.
MCP server for Gainium β manage trading bots, deals, and balances via AI assistants
MCP server for AI agents to plan, verify, and deploy Cloudflare-native apps.
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/satyam0singh/Expense_Tracker_MCP'
If you have feedback or need assistance with the MCP directory API, please join our Discord server