Skip to main content
Glama
ExpenseTracker

ExpenseTracker

by Aricode2005

๐Ÿ’ฐ ExpenseIQ (MCP Server)

A production-grade Model Context Protocol (MCP) server for personal expense tracking โ€” powered by SQLite, designed for Claude Desktop, and ready for remote deployment.

Python 3.13+ MCP FastMCP

Live Server URL: https://expenseiq.fastmcp.app/mcp


โœจ Feature Highlights

Feature

Description

15 Tools

Add, list, edit, delete, search, summarize, trend, budget, breakdown โ€” plus editable categories

Fully Async

Non-blocking I/O using aiosqlite for high performance

Budget Tracking

Set monthly limits per category, get over-budget warnings with utilization %

Trend Analysis

Month-over-month spending trends for the last N months

CSV Export

Export filtered expenses as CSV โ€” paste directly into Google Sheets / Excel

Smart Search

Full-text search across notes and tags

Editable Categories

Pre-seeded with 100+ subcategories, fully editable via add_category / remove_category

Input Validation

Category, date, amount, and payment method validation on every operation

Currency: โ‚น INR

All responses include currency: "INR" for clarity

Prompt Templates

Built-in monthly_report prompt for structured expense analysis

Pagination

Large result sets with limit / offset support


Related MCP server: expense-mcp

๐Ÿ—๏ธ Architecture

graph LR
    A["Claude Desktop / MCP Inspector"] -->|MCP Protocol| B["FastMCP Server"]
    B --> C["main.py โ€” 12 Tools + 2 Resources + 1 Prompt"]
    C --> D["db.py โ€” SQLite"]
    C --> E["categories.json"]
    D --> F["expenses.db"]

๐Ÿš€ Quick Start

Prerequisites

  • Python 3.13+

  • uv โ€” fast Python package manager

  • Node.js / npx โ€” for MCP Inspector (optional)

  • Claude Desktop โ€” to use the server as an AI assistant

1. Clone & Install

git clone https://github.com/Aricode2005/expense-tracker-mcp.git
cd expense-tracker-mcp
uv sync

2. Test with MCP Inspector

npx @modelcontextprotocol/inspector uv run main.py

This opens a web UI where you can interactively call all 12 tools, read resources, and test prompts.

3. Install in Claude Desktop

Open your Claude Desktop config file:

  • Windows: %APPDATA%\Claude\claude_desktop_config.json

  • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

Add this entry:

{
  "mcpServers": {
    "expense-tracker": {
      "command": "uv",
      "args": [
        "run",
        "--directory",
        "C:\\Users\\aritr\\Downloads\\AgenticAI\\MCP\\epense_tracker-mcp",
        "main.py"
      ]
    }
  }
}

๐Ÿ’ก Replace the path with your actual project directory.

Restart Claude Desktop. You should see the ExpenseTracker server in the MCP tools panel (๐Ÿ”Œ icon).


๐Ÿ› ๏ธ Tool Reference

Core CRUD

Tool

Description

add_expense

Add expense with date, amount, category, subcategory, note, payment method, tags, recurring flag

get_expense

Fetch a single expense by ID

edit_expense

Update any field(s) of an existing expense

delete_expense

Delete an expense by ID (returns deleted record)

Tool

Description

list_expenses

List expenses in a date range with filters (category, amount range, payment method, tag) + pagination

search_expenses

Full-text search across notes and tags

Analytics

Tool

Description

summarize_expenses

Aggregate by category / subcategory / month / day with count, total, avg, min, max

get_monthly_trend

Month-over-month spending totals for the last N months

get_category_breakdown

Subcategory-level breakdown for a single category

Budgets

Tool

Description

set_budget

Set or update a monthly budget limit for a category

get_budget_status

Compare actual vs budget with utilization %, over-budget warnings

Export

Tool

Description

export_expenses

Export expenses as CSV text for spreadsheets

Resources

URI

Description

expense://categories

Full category โ†’ subcategory mapping (JSON)

expense://stats

Live dashboard: totals, this month, top categories

Prompts

Prompt

Description

monthly_report

Generates a structured monthly report with summaries, budgets, and trend analysis


๐Ÿ“‚ Project Structure

expense-tracker-mcp/
โ”œโ”€โ”€ main.py              # MCP server โ€” 12 tools, 2 resources, 1 prompt
โ”œโ”€โ”€ db.py                # Database schema, init, connection helpers
โ”œโ”€โ”€ categories.json      # 20 categories with 100+ subcategories
โ”œโ”€โ”€ pyproject.toml       # Project config (uv / pip)
โ”œโ”€โ”€ README.md            # You are here
โ””โ”€โ”€ src/
    โ””โ”€โ”€ epense_tracker_mcp/
        โ””โ”€โ”€ __init__.py  # Package entry point

๐Ÿ’ฌ Example Conversations with Claude

Once installed in Claude Desktop, try:

"Add an expense of โ‚น450 for groceries today, paid via UPI"

"Show me my spending for September 2026"

"Set a monthly budget of โ‚น5000 for food"

"Am I over budget this month?"

"What's my month-over-month spending trend?"

"Export this month's expenses as CSV"

"Search for expenses tagged 'client-x'"

"Break down my food spending by subcategory"


๐Ÿ—„๏ธ Database Schema

expenses table

Column

Type

Description

id

INTEGER PK

Auto-incrementing ID

date

TEXT

Date in YYYY-MM-DD format

amount

REAL

Amount in โ‚น INR (must be > 0)

category

TEXT

e.g. food, transport, health

subcategory

TEXT

e.g. groceries, cab_ride_hailing

note

TEXT

Free-text description

payment_method

TEXT

cash / upi / credit_card / debit_card / net_banking / wallet

is_recurring

INTEGER

0 or 1

tags

TEXT

Comma-separated tags

created_at

TEXT

ISO-8601 timestamp

updated_at

TEXT

ISO-8601 timestamp

budgets table

Column

Type

Description

id

INTEGER PK

Auto-incrementing ID

category

TEXT UNIQUE

One budget per category

monthly_limit

REAL

Monthly cap in โ‚น INR

created_at

TEXT

ISO-8601 timestamp


๐ŸŒ Remote Deployment

This server has three transport modes built in โ€” no Docker needed:

# Local (MCP Inspector / Claude Desktop)
python main.py

# Remote โ€” modern streamable-http (recommended)
python main.py --remote

# Remote โ€” legacy SSE
python main.py --sse

The PORT environment variable is respected (default: 8000).

Deploy to a Cloud Platform (Railway / Render / Fly.io)

  1. Push this repo to GitHub.

  2. Link the repo in your cloud platform.

  3. Set the Start Command to:

    python main.py --remote
  4. The platform injects PORT automatically โ€” the server binds to it.

Connect Claude Desktop to a Remote Server

Use npx to bridge the remote HTTP server into a local STDIO connection for Claude Desktop.

Add this to your claude_desktop_config.json:

{
  "mcpServers": {
    "expense-iq-remote": {
      "command": "npx",
      "args": [
        "-y",
        "@modelcontextprotocol/inspector",
        "mcp-remote",
        "https://expenseiq.fastmcp.app/mcp"
      ]
    }
  }
}

Note: The mcp-remote command from the inspector package acts as a bridge, allowing Claude Desktop (which expects local STDIO) to communicate with your cloud-hosted HTTP server.

Test Remote Mode Locally

# Terminal 1 โ€” start the server
python main.py --remote

# Terminal 2 โ€” connect MCP Inspector to it
npx @modelcontextprotocol/inspector
# Then set Transport Type to "Streamable HTTP"
# and URL to http://localhost:8000/mcp

๐Ÿ›ฃ๏ธ Roadmap

  • Remote Deployment โ€” Built-in SSE transport support

  • Fully Async โ€” Converted to aiosqlite

  • Editable Categories โ€” Categories managed in SQLite

  • Authentication โ€” API key / OAuth for multi-user support

  • Income Tracking โ€” Track income alongside expenses for net savings

  • Recurring Automation โ€” Auto-add recurring expenses monthly

  • Data Visualization โ€” Generate charts (spending pie, trend line) as image resources

  • Multi-currency โ€” Support USD, EUR with conversion rates

  • Receipt OCR โ€” Extract expense data from receipt images via MCP resources


๐Ÿงฐ Tech Stack

Technology

Purpose

Python 3.13

Runtime

FastMCP

MCP server framework (Async, SSE, STDIO)

SQLite (aiosqlite)

Embedded database (WAL mode, non-blocking)

Model Context Protocol

AI-tool communication standard

uv

Package management & script runner


๐Ÿ‘ค Author

Aritra Dutta โ€” GitHub ยท Email

Available Tools

12 tools
add_expenseAdd ExpenseC

Add a new expense to the tracker.

Inputs: date (required), amount (required), category (required), note, +4 more. Returns: object

delete_expenseDelete ExpenseA

Delete an expense by its ID. Returns the deleted record for confirmation.

Inputs: expense_id (required). Returns: object

edit_expenseEdit ExpenseA

Edit an existing expense. Only the fields you provide will be updated.

Inputs: expense_id (required), date, note, tags, +5 more. Returns: object

export_expensesExport ExpensesA

Export expenses in a date range as CSV text (can be pasted into a spreadsheet).

Inputs: end_date (required), start_date (required), category. Returns: object

get_budget_statusGet Budget StatusA

Compare actual spending vs budget for a given month (YYYY-MM). If month is empty, defaults to the current month.

Inputs: month. Returns: object

get_category_breakdownGet Category BreakdownA

Break down spending for a single category by its subcategories.

Inputs: category (required), end_date (required), start_date (required). Returns: object

get_expenseGet ExpenseA

Fetch a single expense by its ID.

Inputs: expense_id (required). Returns: object

get_monthly_trendGet Monthly TrendB

Show month-over-month spending totals for the last N months.

Inputs: months. Returns: object

list_expensesList ExpensesB

List expenses within an inclusive date range, with optional filters.

Inputs: end_date (required), start_date (required), tag, limit, +6 more. Returns: object

search_expensesSearch ExpensesA

Full-text search across expense notes and tags.

Inputs: query (required), limit. Returns: object

set_budgetSet BudgetB

Set or update the monthly budget for a category.

Inputs: category (required), monthly_limit (required). Returns: object

summarize_expensesSummarize ExpensesA

Aggregate spending over a date range. Group by category, subcategory, month, or day.

Inputs: end_date (required), start_date (required), category, group_by. Returns: object

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelogโ€ฆ

    TDQS

    A3.7/5.0

    Scored across 12 tools

    Disambiguation4/5

    Tools are mostly distinct: CRUD operations, search, export, and analytical aggregates. However, summarize_expenses, get_monthly_trend, and get_category_breakdown overlap in aggregation capabilities, though each targets a specific dimension (generic grouping vs. time trend vs. subcategory breakdown). Descriptions help disambiguate but slight confusion is possible.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern in snake_case (e.g., get_expense, add_expense, list_expenses, set_budget). No mixed conventions or vague verbs; naming is predictable and uniform.

    Tool Count5/5

    12 tools is well-scoped for an expense tracker covering full CRUD plus search, export, and analytical summaries. Each tool has a clear purpose and none are redundant.

    Completeness5/5

    The surface covers the full expense lifecycle (add, get, list, edit, delete) and adds search, export, budget management, and multiple aggregation views. No obvious gaps for the stated domain; it feels complete and self-sufficient.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables users to track personal expenses through natural language interactions with comprehensive category support and financial summaries. Provides both local and remote MCP server options with SQLite storage for fast expense management operations.
      -
    • A
      license
      A
      quality
      D
      maintenance
      Personal expense tracker MCP server that enables tracking expenses, income, budgets, and savings goals through natural language.
      10
      29 PyPI
      1
      MIT
    • A
      license
      B
      quality
      B
      maintenance
      Enables local tracking of personal expenses by adding, listing, summarizing, updating, and deleting expense records stored in a CSV file through an MCP client.
      5
      MIT
    • F
      license
      Not graded
      quality
      C
      maintenance
      Enables managing and analyzing personal expenses through MCP tools, including adding expense records, listing expenses within date ranges, and summarizing spending by category, with expense categories exposed as an MCP resource.
      -