Expense Tracker MCP
Expense Tracker MCP
This is a small MCP server for tracking expenses. It stores data in a local SQLite database and gives you tools to add, list, and summarize expenses.
What it does
Adds a new expense
Lists expenses for a date range
Summarizes spending by category
Exposes a categories resource if
categories.jsonis present next tomain.py
Main files
main.py- starts the MCP server and defines the toolsexpenses.db- local database created automatically on first runcategories.json- optional file for category data
How to use
Install the dependencies.
pip install -e .Start the server.
python main.pyConnect it to your MCP client and use these tools:
add_expense(date, amount, category, subcategory="", note="")list_expenses(start_date, end_date)summarize(start_date, end_date, category=None)
Notes
Dates should use the same text format everywhere, like
YYYY-MM-DD.The database file is created in the same folder as
main.py.If you want the categories resource to work, add a
categories.jsonfile in the project folder.