Skip to main content
Glama
Python-Blade

Expense Tracker MCP Server

by Python-Blade
README.md
# Expense Tracker MCP Server

A powerful SQLite-backed expense tracking server built with the Model Context Protocol (MCP). This server allows AI agents (like Claude) to manage your personal finances by adding, deleting, and listing expenses directly from your chat interface.

## Features

- **Add Expenses**: Record new expenses with details like amount, category, description, and date.
- **Track History**: Maintain a persistent history of all transactions in a local SQLite database.
- **Reporting**: Generate summaries and list all expenses.
- **Management**: Delete incorrect entries by ID.

## Prerequisites

- Python 3.12 or higher
- [uv](https://github.com/astral-sh/uv) (recommended) or pip

## Installation

1. Clone or download this repository.
2. Install dependencies:

```bash
uv sync
# OR
pip install -r requirements.txt
```

## Configuration for Claude Desktop

To use this with Claude Desktop, add the following to your config file (`%APPDATA%\Claude\claude_desktop_config.json` on Windows):

```json
{
  "mcpServers": {
    "expense-tracker": {
      "command": "path/to/your/python.exe",
      "args": [
        "path/to/finance.py"
      ]
    }
  }
}
```

*Note: It is highly recommended to use absolute paths for both the python executable and the script file to avoid issues.*

## Usage

Once connected to Claude, you can use natural language to manage your expenses:

- "I spent $50 on groceries at Walmart today."
- "Add a transportation expense of $15 for a taxi ride."
- "Show me my expense report."
- "Delete expense ID 4."

## Architecture

- **Database**: Uses `sqlite3` for a lightweight, file-based database (`expenses.db`) that lives in the same directory as the script.
- **MCP Framework**: Built using `FastMCP` for a simple and efficient server implementation.

TDQS

B3.3/5.0

Scored across 3 tools

Disambiguation5/5

add_expense, delete_expense, and list_expenses target clearly distinct operations on the same resource. There is no meaningful overlap or ambiguity between them.

Naming Consistency5/5

All tools follow a consistent snake_case verb_noun pattern: add_expense, delete_expense, list_expenses. The plural in list_expenses is natural for a list operation.

Tool Count4/5

Three tools is reasonable for a minimal expense tracker, and each tool has a clear purpose. However, the surface is on the thin side for typical expense-tracking workflows.

Completeness3/5

The set covers add, delete, and list, but lacks update_expense and get_expense, which are notable gaps for correcting or inspecting individual records. Reporting operations like totals or filtering by category/date are also absent.

Maintenance

ActivityInactive
ResponsivenessNo issues