Expense Tracker MCP Server
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Expense Tracker MCP Server Add a $20 lunch expense to the Food category"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Expense Tracker MCP Server
An asynchronous Model Context Protocol (MCP) server built with Python and FastMCP to log and track personal expenses inside a local SQLite database with strict category/subcategory checks.
Features
SQLite Database Backend: Logs expenses locally in
expenses.dbusingaiosqlite.Asynchronous Execution: Fully utilizes
asyncioand async database connections.Categorization: Validates categories and subcategories against a custom JSON hierarchy (
categories.json).Exposed Tools:
add_expense: Add a new transaction (validates amount, category, and dates).get_expenses: View matching logs with optional category, subcategory, start date, and end date filters.get_expense_summary: View spent totals, item count, and percentages grouped by category.delete_expense: Remove transaction logs by database ID.
Exposed Resources:
expense://categories: Returns the JSON representation of categories and their subcategories.expense://categories/{category}/subcategories: Returns subcategories for a given category in JSON format.
Related MCP server: Expense Tracker MCP Server
Files Structure
main.py: Server entrypoint containing initialization, SQLite queries, MCP tools, and MCP resource declarations.
categories.json: Configuration file specifying categories and subcategories.
pyproject.toml: Package configuration with metadata and dependency requirements (
fastmcpandaiosqlite)..gitignore: Configured to ignore virtual environments, cache directories, and local database files.
Installation
Ensure you have uv installed.
To sync dependencies:
uv syncRunning the Server
To start the MCP server locally:
uv run python main.pyDevelopment and Testing
A test suite is available under the artifacts directory. To run the async test suite:
uv run python C:\Users\User\.gemini\antigravity-ide\brain\7f833c64-f9e4-404b-a691-0d0df923616c\scratch\test_server.pyAvailable Tools
4 toolsadd_expenseA
Add a new expense with amount, category, subcategory, optional description, and date (YYYY-MM-DD)
Inputs: amount (required), category (required), subcategory (required), date, +1 more. Returns: result
delete_expenseA
Delete an expense record by its numeric ID
Inputs: expense_id (required). Returns: result
get_expensesA
Retrieve list of expenses, optionally filtered by category, subcategory, start_date, or end_date (YYYY-MM-DD)
Inputs: category, end_date, start_date, subcategory. Returns: result
get_expense_summaryA
Get total summary and category breakdown of all expenses
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool targets a distinct operation: adding, listing, summarizing, and deleting expenses. There is no overlap in purpose, so an agent can easily select the correct tool.
All tool names follow a consistent verb_noun pattern (add_expense, get_expenses, get_expense_summary, delete_expense). The snake_case style is uniform across the set.
The server has 4 tools, which is well-scoped for an expense tracker. Each tool covers a fundamental operation without unnecessary redundancy or excessive granularity.
The set covers the main expense lifecycle: create, read (list), summary, and delete. Missing an update operation is a minor gap, but most core workflows are supported.
Related MCP Connectors
Track expenses from your AI chat: log, categorize, monthly CSV reports. All data is local.
Personal finance tracker — log transactions, view summaries, and browse a dashboard
Track expenses from receipt photos, then search, summarize and update them from your AI assistant.
Expense ledger for AI assistants: record receipts line by line, ask what you spent, export anytime.
Related MCP Servers
- FlicenseCqualityDmaintenanceEnables personal expense management with SQLite storage, allowing users to add, update, delete, list, and summarize expenses by category through natural language interactions.5-
- FlicenseAqualityDmaintenanceEnables tracking and managing personal expenses through a local SQLite database. Supports adding, editing, deleting, listing, and summarizing expenses by category, as well as managing credit accounts.6-
- FlicenseNot gradedqualityDmaintenanceEnables natural language management of personal expenses, including adding, listing, and summarizing expenses with local SQLite storage.-
- FlicenseBqualityDmaintenanceTracks and manages personal expenses with tools to add, view, filter by category, and summarize spending over date ranges using SQLite storage.4-