Skip to main content
Glama
expenses-tracker-mcp

expenses-tracker-mcp

by samu187

Expenses Tracker

Track expenses locally, import bank statements, and classify transactions with an AI assistant through MCP.

Built with FastAPI, SQLite, and React. The backend stores transactions in a local SQLite database and serves both the web app and the API under /api. An included Model Context Protocol (MCP) server lets compatible AI assistants query and classify transactions.

App Demo

You can either interact with the webapp or with an AI agent to get overview on expenses per account in the last months

Web app

Expenses Tracker web app overview

Expenses Tracker transaction management

MCP interactions with Codex

Codex interacting with Expenses Tracker through MCP

MCP categorize new transactions imported

Codex categorizing expenses MCP

Related MCP server: Expense Tracker MCP Server

Features

  • Import bank statement CSV files

  • Add, edit, delete, filter, and classify transactions

  • Maintain accounts and account groups

  • View monthly overview, category totals, and daily reports

  • Run a local MCP server for agents to automatically classify your transactions

Project structure

src/expenses_tracker/
  cli.py                  Command-line entry point
  web.py                  FastAPI app and web-server runner
  database.py             SQLite setup and seed accounts
  transactions.py         Transaction data operations
  import_statement.py     CSV statement import logic
  api/routes.py           API routes
  mcp/server.py           MCP server for expense tools
  static/                 Built frontend served by FastAPI

frontend/
  index.html              Vite entry HTML
  src/                    React source
  vite.config.js          Builds into src/expenses_tracker/static

Requirements

  • Python 3.12+

  • uv

Setup

From the repository root, install Python dependencies:

uv sync

The built frontend is included in src/expenses_tracker/static and served directly by FastAPI.

Run the Web App

uv run expenses web

The app starts on http://127.0.0.1:8125 and opens the default browser automatically.

Bank statement imports

Select a CSV bank statement from the transactions screen to import it.

Expected CSV columns:

  • Transaction Date in DD/MM/YYYY format

  • Transaction Description

  • Debit Amount

  • Credit Amount

Debit amounts are stored as negative pence values. Credit amounts are stored as positive pence values. Imported transactions are assigned to the Pending account by default.

MCP server

The MCP server communicates over standard input and output (stdio). To launch it from the repository root:

uv run expenses mcp

To connect an MCP-compatible client, configure it to launch uv with these arguments, replacing the path with your local checkout:

{
  "mcpServers": {
    "expenses-tracker": {
      "command": "uv",
      "args": ["--directory", "/absolute/path/to/expenses-tracker", "run", "expenses", "mcp"]
    }
  }
}

The configuration format depends on your client; the example above is for clients that accept an mcpServers JSON object. If you installed the package and expenses is on your client's PATH, use command expenses with arguments ["mcp"] instead.

Available tools include:

  • guarded read-only SQL queries

  • transaction listing with filters

  • account listing

  • pending transaction grouping

  • classification summaries

  • account assignment for selected transactions or filtered batches

Available Tools

8 tools
bulk_update_by_filterC

Assign all transactions matching a filter to an account, or preview with dry_run.

Inputs: dry_run (required), account_id (required), updated_by (required), month, +6 more. Returns: object

create_accountB

Create an account in an existing account group.

Inputs: name (required), account_group_id (required). Returns: object

get_classification_summaryB

Summarize transactions grouped by counterparty, account, or account group.

Inputs: group_by (required), month, account_group. Returns: result

list_accountsB

List accounts, optionally filtered by account group name.

Inputs: account_group. Returns: result

list_pending_groupsC

List pending transactions grouped by counterparty.

Inputs: limit, month, account_group. Returns: result

list_transactionsA

List transactions using optional month, account, counterparty, and amount filters.

Inputs: limit, month, offset, account_id, +5 more. Returns: result

run_readonly_sqlC

Run a guarded read-only SQL query and return columns plus rows.

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

update_transactions_accountC

Assign specific transactions to an account.

Inputs: account_id (required), updated_by (required), transaction_ids (required), comment. Returns: object

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.1/5.0

    Scored across 8 tools

    Disambiguation4/5

    Tools are mostly distinct: raw SQL, list operations, update operations, and create account each target a unique action. However, list_pending_groups and get_classification_summary both group transactions, and update_transactions_account vs bulk_update_by_filter could be confused, though descriptions clarify the difference.

    Naming Consistency4/5

    The majority follow a clear verb_noun pattern (list_, create_, update_, get_). Minor deviations like bulk_update_by_filter and run_readonly_sql are still readable and consistent in style, so the overall pattern is predictable.

    Tool Count5/5

    8 tools is well-scoped for an expense tracking server. Each tool serves a clear purpose in querying, updating, or creating accounts, with no redundant or missing trivialities.

    Completeness3/5

    The surface covers listing, classification, account creation, and transaction updates, but lacks a create_transaction tool, which is a core operation for an expense tracker. Also missing account update/delete, leaving notable gaps for full lifecycle management.

    Maintenance

    ActivityStale
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      A
      quality
      D
      maintenance
      Enables tracking and managing personal expenses through a local SQLite database. Supports adding, editing, deleting, listing, and summarizing expenses by category, as well as managing credit accounts.
      6
      -
    • F
      license
      A
      quality
      D
      maintenance
      Enables logging and tracking personal expenses in a local SQLite database with category/subcategory validation, offering tools to add, view, summarize, and delete expenses.
      4
      -
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables LLMs to query a local GnuCash MariaDB database through read-only MCP tools for account balances, recent transactions, spending and income by category, transaction search, and net worth without risking data mutation.
      1
      AGPL 3.0
    • A
      license
      Not graded
      quality
      B
      maintenance
      Enables an AI assistant to query Plaid-synced bank data stored locally in SQLite — balances, transactions, spending, cash flow, recurring charges, and liabilities — plus bounded read-only SQL and local CSV/JSON exports, all over local stdio with no hosted service or listening port.
      PolyForm Noncommercial 1.0.0