Stores and manages personal expense data in a SQLite database, including adding, updating, deleting, listing, and summarizing expenses by category with persistent storage.
Expense Tracker MCP Server
A Model Context Protocol (MCP) server for tracking personal expenses with SQLite database storage. This server integrates with Claude Desktop to provide expense management capabilities through natural language.
Features
✅ Add, update, and delete expenses
✅ List expenses by date range
✅ Summarize expenses by category
✅ Flexible deletion by multiple criteria
✅ Predefined expense categories
✅ SQLite database for persistent storage
Prerequisites
Python 3.10 or higher
uv package manager
Claude Desktop app
Installation
1. Install uv
Windows (PowerShell):
macOS/Linux:
2. Initialize Project
3. Install Dependencies
4. Create the Server
Create a file named main.py and paste the expense tracker code (from the document provided).
5. Test the Server
Configuration
Claude Desktop Setup
Open Claude Desktop configuration file:
Windows:
%APPDATA%\Claude\claude_desktop_config.jsonmacOS:
~/Library/Application Support/Claude/claude_desktop_config.jsonLinux:
~/.config/Claude/claude_desktop_config.json
Add the MCP server configuration:
Important: Replace C:/Users/YOUR_USERNAME/Desktop/expense-tracker-mcp-server with your actual project path.
Restart Claude Desktop
Usage
Once configured, you can interact with the expense tracker through Claude using natural language:
Add Expense
List Expenses
Update Expense
Delete Expense
Summarize Expenses
View Categories
Available Tools
add_expense
Add a new expense to the tracker.
Parameters:
date(string): Date in YYYY-MM-DD formatamount(float): Expense amountcategory(string): Expense categorysubcategory(string, optional): Subcategorynote(string, optional): Additional notes
list_expenses
List all expenses within a date range.
Parameters:
start_date(string): Start date (YYYY-MM-DD)end_date(string): End date (YYYY-MM-DD)
update
Update an existing expense (only provided fields will be updated).
Parameters:
cid(int): Expense ID to updatedate(string, optional): New dateamount(float, optional): New amountcategory(string, optional): New categorysubcategory(string, optional): New subcategorynote(string, optional): New note
delete
Delete expenses based on various criteria.
Parameters:
id(int, optional): Delete by IDdate(string, optional): Delete by datecategory(string, optional): Delete by categorysubcategory(string, optional): Delete by subcategoryamount(float, optional): Delete by amountnote(string, optional): Delete by notestart_date&end_date(strings, optional): Delete by date range
summarize
Get expense summaries grouped by category.
Parameters:
start_date(string): Start date (YYYY-MM-DD)end_date(string): End date (YYYY-MM-DD)category(string, optional): Filter by specific category
Available Resources
expense://categories
Returns the list of available expense categories in JSON format.
Database Schema
File Structure
Default Categories
The server comes with these default categories:
food
transport
entertainment
utilities
healthcare
You can modify categories.json to add or remove categories.
Troubleshooting
Server not appearing in Claude Desktop
Check the configuration file path is correct
Ensure the
commandpath points to your project directoryRestart Claude Desktop completely
Check Claude Desktop logs for errors
Database errors
If you encounter database errors:
Import errors
Development
To modify the server:
Edit
main.pyTest changes:
uv run main.pyRestart Claude Desktop to load changes
Contributing
Contributions are welcome! Feel free to submit issues or pull requests.
Support
For issues related to:
MCP Protocol: MCP Documentation
FastMCP: FastMCP GitHub
Claude Desktop: Anthropic Support