expenses-tracker-mcp
This MCP server provides tools to manage and analyze expense transactions stored in a local SQLite database, including querying, filtering, classifying, and updating transactions and accounts.
Run read-only SQL queries with limits and parameters for flexible data exploration.
List transactions with filters by month, account, account group, counterparty (exact or contains), and amount range (in pence).
List accounts and filter by account group.
List pending transactions grouped by counterparty, optionally by month and account group.
Get classification summaries grouped by counterparty, account, or account group, with optional month and account group filters.
Assign specific transactions to an account by IDs, with a comment and updater type (human/AI).
Bulk assign transactions matching filters to an account, with a dry-run preview mode.
Create new accounts within existing account groups.
Click on "Deploy 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., "@expenses-tracker-mcp list pending transactions"
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.
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
![]()
![]()
MCP interactions with Codex
![]()
MCP categorize new transactions imported
![]()
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/staticRequirements
Python 3.12+
Setup
From the repository root, install Python dependencies:
uv syncThe built frontend is included in src/expenses_tracker/static and served directly by FastAPI.
Run the Web App
uv run expenses webThe 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 DateinDD/MM/YYYYformatTransaction DescriptionDebit AmountCredit 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 mcpTo 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 toolsbulk_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
Scored across 8 tools
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.
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.
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.
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
Related MCP Connectors
Query, edit, and reconcile a hosted Beancount ledger: BQL, reports, files, and bank imports.
Personal finance tracker — log transactions, view summaries, and browse a dashboard
Import bank CSV exports, categorise transactions, total them by category or month, match expenses.
Read-only bank & investment accounts via Plaid: balances, holdings, transactions, SQL analytics.
Related MCP Servers
- FlicenseAqualityDmaintenanceEnables 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-
- FlicenseAqualityDmaintenanceEnables logging and tracking personal expenses in a local SQLite database with category/subcategory validation, offering tools to add, view, summarize, and delete expenses.4-
- AlicenseNot gradedqualityBmaintenanceEnables 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.1AGPL 3.0
- AlicenseNot gradedqualityBmaintenanceEnables 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