ExpenseTracker MCP Server
## ExpenseTracker MCP Server
A production-ready Model Context Protocol (MCP) server that turns your AI assistant into a persistent personal finance manager using PostgreSQL.
This project allows Claude Desktop or any MCP-enabled agent to securely store, analyze, and export expense data using real database transactions instead of chat memory.
---
## What Is It?
ExpenseTracker MCP is a local backend service exposing structured financial tools to AI agents.
It enables your assistant to:
- Store expenses permanently
- Edit and delete past records
- Summarize spending patterns
- Detect top spending categories
- Generate monthly reports
- Export data for accounting or tax use
---
## How It Works
1. Claude Desktop sends a tool request using MCP.
2. ExpenseTracker MCP receives the request.
3. The server executes the database operation in PostgreSQL.
4. Results are returned to Claude as structured JSON.
5. Logs are written to `expense_tracker.log`.
The AI never invents data — it only queries your real database.
---
## How To Run Using uv
### Install dependencies
```bash
uv add fastmcp psycopg2-binary python-dotenv
```
### Create .env file
```bash
DB_HOST=localhost
DB_PORT=5432
DB_NAME=expense_tracker
DB_USER=expense_user
DB_PASSWORD=your_password
```
### Start MCP server
#### For Testing
```bash
uv run fastmcp dev main.py
```
#### For Run
```bash
uv run fastmcp run main.py
```
### How to connect to Claude Desktop
```bash
uv run fastmcp install claude-desktop main.py
```
Restart Claude Desktop
---
## Contribution
Contributions are welcome.
- Fork the repository
- Create a feature branch
- Add or improve MCP tools or documentation
- Submit a pull request with a clear description of your changes TDQS
Scored across 12 tools
Most tools have distinct purposes targeting specific expense tracking operations like adding, listing, deleting, updating, and reporting. However, 'summarize' and 'monthly_report' could potentially overlap in function if not clearly differentiated by their descriptions, creating minor ambiguity.
All tool names follow a consistent snake_case pattern with clear verb_noun structures (e.g., add_expense, list_expenses, monthly_report). There are no deviations in naming conventions, making the set predictable and easy to parse.
With 12 tools, this server is well-scoped for an expense tracking domain. The count is appropriate, covering core operations without being excessive, and each tool appears to serve a specific, justified role in the workflow.
The tool set provides good coverage for expense management, including CRUD operations (add, read, update, delete), reporting (monthly_report, daily_average), and utilities (export_csv, health_check). A minor gap might be the absence of a tool for setting or managing budgets, which could limit full lifecycle coverage.