Skip to main content
Glama
AshC2004

Expense Tracker MCP Server

by AshC2004
README.md
# Expense Tracker MCP Server

A Model Context Protocol (MCP) server for tracking personal expenses and wallet balance, built with [FastMCP](https://github.com/jlowin/fastmcp) and SQLite. Lets Claude Desktop, Cursor, or any MCP client log expenses, summarize spending, and check your balance through natural conversation.

## Features

- Log expenses with date, amount, category, subcategory, and note
- List expenses within a date range
- Summarize spending by category over a date range
- Track and update a wallet balance
- A predefined category/subcategory taxonomy exposed as an MCP resource

## Tools

| Tool | Description |
|------|-------------|
| `add_expense(date, amount, category, subcategory, note)` | Insert an expense record |
| `list_expenses(start_date, end_date)` | List expenses in an inclusive date range |
| `summarize(start_date, end_date, category)` | Sum expenses by category over a date range |
| `get_balance()` | Read the current wallet balance |
| `set_balance(amount)` | Set the wallet balance |

All dates use `YYYY-MM-DD` format and are validated on input.

## Resources

- `expense://categories`: JSON taxonomy of categories and subcategories (food, transport, housing, utilities, health, education, and more), read fresh from `categories.json` on every request.

## Setup

Requires Python 3.11+ and [uv](https://docs.astral.sh/uv/).

```bash
uv sync
```

### Claude Desktop config

```json
{
  "mcpServers": {
    "expense-tracker": {
      "command": "/path/to/expense-tracker-mcp-server/run.sh"
    }
  }
}
```

Replace `/path/to/expense-tracker-mcp-server` with the absolute path to this repo.

## Storage

Data is stored in a local SQLite database (`expenses.db`, created automatically on first run, gitignored). Override the location with the `EXPENSE_TRACKER_DB_PATH` environment variable.

## Testing

```bash
uv run pytest
```

## License

MIT

TDQS

A3.5/5.0

Scored across 5 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: adding expenses, listing them, summarizing by category, and managing the wallet balance. No overlap or ambiguity.

Naming Consistency5/5

All tool names follow a consistent verb_noun pattern in snake_case (add_expense, list_expenses, summarize, get_balance, set_balance), making them predictable and easy to understand.

Tool Count5/5

The set of 5 tools is well-scoped for an expense tracker, covering core expense management and balance tracking without unnecessary duplication or bloat.

Completeness4/5

The tools cover the core workflows (add, list, summarize expenses; get/set balance). Missing update/delete for expenses, but the domain is largely covered for typical use cases.

Maintenance

ActivityStale
ResponsivenessNo issues