Expense Tracker MCP Server
Expense Tracker MCP Server
一个本地 Model Context Protocol (MCP) 服务器,用于个人 Expense Tracker,使用 Python 和 SQLite3 构建。
功能
add_expense— 添加一笔支出;减少可用信用额度list_expenses— 列出支出(最新的在前),可按类别筛选summarize_expenses— 按类别统计总额、笔数、已添加信用额度和可用信用额度edit_expense— 编辑一笔支出;按金额差额调整信用额度delete_expense— 删除一笔支出;将金额退还到信用额度add_credit— 向可用余额添加信用额度
所有更改余额的操作都在 SQLite 事务中运行。
Related MCP server: Expense Tracker MCP Server
文件夹结构
local MCP server/
├── main.py # MCP server + tool definitions (entry point)
├── expense_tracker/
│ ├── __init__.py
│ ├── database.py # SQLite connection + schema setup
│ └── operations.py # Core expense/credit business logic
├── pyproject.toml # Project config (fastmcp dependency)
├── uv.lock # Lockfile
└── README.md数据库文件 expense_tracker.db 会在首次调用工具时自动创建。
安装
克隆仓库:
git clone https://github.com/YogeshSharma2007/Local-Expense-tracker-MCP.git
cd Local-Expense-tracker-MCP创建并激活虚拟环境:
python -m venv .venv
.\.venv\Scripts\Activate.ps1安装依赖:
uv sync # or: pip install -e .运行服务器
python main.py然后在你的 MCP 客户端中将该服务器注册为本地 MCP stdio 服务器。
注册到 MCP 客户端(OpenCode 示例)
添加到你的 OpenCode 配置(opencode.json 或你的客户端配置所在位置):
{
"$schema": "https://opencode.ai/config.json",
"mcp": {
"local-mcp": {
"type": "local",
"command": [
"<path-to-repo>\\.venv\\Scripts\\python.exe",
"<path-to-repo>\\main.py"
],
"enabled": true
}
}
}将 <path-to-repo> 替换为你克隆此仓库的完整路径,例如:
C:\Users\<your-username>\Documents\Local-Expense-tracker-MCP配置
数据库路径默认为项目文件夹中的 expense_tracker.db。可通过环境变量覆盖:
$env:EXPENSE_TRACKER_DB = "C:\path\to\expense_tracker.db"This server cannot be deployed
Maintenance
Related MCP Connectors
Personal finance tracker — log transactions, view summaries, and browse a dashboard
Hosted MCP server for Mini Accountant: invoices, expenses, customers, analytics, tax estimates.
- BonsaveOAuthapp.bonsave
Query your real net worth, spending, transactions, budgets and portfolio from any MCP client.
- WalleKOAuthapp.wallek
Personal finance ledger: log expenses, track bills and cards, import statements.
Related MCP Servers
- FlicenseBqualityDmaintenanceA 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.3-
- FlicenseAqualityDmaintenanceA Model Context Protocol (MCP) server for tracking personal expenses. This server provides tools to add, list, and summarize expenses, utilizing a local SQLite database for storage.3-
- FlicenseNot gradedqualityDmaintenanceA lightweight local MCP server for tracking personal or small-team expenses. It lets you add expense entries, list transactions within a date range, and generate simple summaries by category — all backed by a local SQLite database.-
- FlicenseNot gradedqualityDmaintenanceA lightweight MCP server that lets LLM clients track, query, and summarize personal expenses using a local SQLite database.-