ExpenseTracker MCP Server
A lightweight MCP server that lets LLM clients track, query, and summarize personal expenses using a local SQLite database.
README
ExpenseTracker MCP Server
A lightweight MCP server built with FastMCP that lets an LLM client (Claude Desktop, Claude Code, etc.) track, query, and summarize personal expenses backed by a local SQLite database.
Features
Add, view, update, delete, and search expense entries Summarize spending by category, date range, or month Export expenses to CSV Input validation for dates and amounts Zero external services — just a local expenses.db SQLite file
Requirements
Python 3.10+ fastmcp
Installation
bashpip install fastmcp
Clone or copy this repo, then make sure the following files sit in the same directory:
main.py # the MCP server category.json # list of categories (see below) expenses.db # auto-created on first run
category.json
Exposed as the expense://categories resource. Create it next to expense_tracker.py:
json{ "categories": [ "Food", "Travel", "Rent", "Utilities", "Entertainment", "Health", "Shopping", "Other" ] }
Running the server
bashpython main.py
FastMCP runs over stdio by default, ready to be connected to any MCP-compatible client.
Connecting to Claude Desktop
Add this to your claude_desktop_config.json:
json{ "mcpServers": { "expense-tracker": { "command": "python", "args": ["/absolute/path/to/main.py"] } } }
Restart Claude Desktop and the tools below will be available in chat.
Tools
ToolDescriptionadd_expense(date, amount, category, subcategory="", note="")Add a new expense entry. date must be YYYY-MM-DD.get_expense(expense_id)Fetch a single expense by id.update_expense(expense_id, date=None, amount=None, category=None, subcategory=None, note=None)Update one or more fields of an existing entry. Only provided fields change.delete_expense(expense_id)Delete an entry by id.list_expenses(start_date, end_date, category=None)List entries in an inclusive date range, optionally filtered by category.search_expenses(keyword, start_date=None, end_date=None)Search notes/category/subcategory for a keyword.summarize(start_date, end_date, category=None)Total + count per category over a date range.total_expenses(start_date, end_date, category=None)Grand total and entry count over a date range.monthly_summary(year, month, category=None)Category breakdown for a given calendar month.list_categories()Distinct categories currently present in the data.export_csv(start_date, end_date)Return a CSV string of all entries in the range.
Resources
ResourceDescriptionexpense://categoriesReturns the contents of category.json (read fresh on every access).
Example usage (in chat)
"Add an expense of 933 for travel today" "Show me all expenses from last week" "How much did I spend on Food in July 2026?" "Update expense #4, change the amount to 500" "Export all June expenses as CSV"
Database schema
sqlCREATE TABLE expenses( id INTEGER PRIMARY KEY AUTOINCREMENT, date TEXT NOT NULL, amount REAL NOT NULL, category TEXT NOT NULL, subcategory TEXT DEFAULT '', note TEXT DEFAULT '' );
Indexes are created automatically on date and category for faster range queries.
Validation rules
Date: must match YYYY-MM-DD, or the call raises a ValueError. Amount: must be a positive number. Category: required and cannot be empty on add_expense.
推荐服务器
Baidu Map
百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。
Playwright MCP Server
一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。
Magic Component Platform (MCP)
一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。
Audiense Insights MCP Server
通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。
VeyraX
一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。
graphlit-mcp-server
模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。
Kagi MCP Server
一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。
e2b-mcp-server
使用 MCP 通过 e2b 运行代码。
Neon MCP Server
用于与 Neon 管理 API 和数据库交互的 MCP 服务器
Exa MCP Server
模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。