Skip to main content
Glama
InfoSage05

Expense Tracker MCP

by InfoSage05
README.md
# 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.json` is present next to `main.py`

## Main files

- `main.py` - starts the MCP server and defines the tools
- `expenses.db` - local database created automatically on first run
- `categories.json` - optional file for category data

## How to use

1. Install the dependencies.

```bash
pip install -e .
```

2. Start the server.

```bash
python main.py
```

3. Connect 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.json` file in the project folder.