Expense Tracker MCP Server
Expense Tracker MCP Server
ClaudeのようなAIアシスタントが、ローカルのSQLiteデータベースを使用して個人経費(追加、分類、集計、予算管理)を管理できるようにするMCP(Model Context Protocol)サーバーです。
概要
このサーバーは、Claude(またはMCP互換クライアント)が支出を追跡するために呼び出せる一連のMCPツールを提供します。すべてのデータはローカルのSQLiteファイルに保存されるため、クラウドやアカウントは不要です。
Related MCP server: ExpenseTracker MCP Server
機能
カテゴリ、金額、日付、説明を含む経費の追加と管理
日付範囲やカテゴリによる経費のフィルタリングと一覧表示
カテゴリ別または月別の支出集計
カテゴリごとの予算設定と残高確認
CSVへの経費エクスポート
完全ローカル — データはマシン内に留まります
MCPツール
ツール | 説明 | 主要パラメータ |
| 新しい経費を記録する |
|
| オプションのフィルタ付きで経費を一覧表示する |
|
| カテゴリまたは月別にグループ化された合計を集計する |
|
| IDを指定して既存の経費を編集する |
|
| IDを指定して経費を削除する |
|
| カテゴリの月次予算上限を設定する |
|
| 予算上限と実際の支出を比較する |
|
| 経費をCSV文字列としてエクスポートする |
|
プロジェクト構造
expense-tracker-mcp-server/
├── main.py # MCP server entry point (all tools)
├── expenses.db # SQLite database (auto-created on first run)
├── pyproject.toml # Project metadata and dependencies
├── .venv/ # Virtual environment (created by uv)
└── readme.md前提条件
Python 3.11以上
uv (推奨) または
pipClaude Desktop (MCPサーバー接続用)
インストール
# Clone the repo
git clone https://github.com/your-username/expense-tracker-mcp-server.git
cd expense-tracker-mcp-server
# Initialize the project and install dependencies
uv init
uv add fastmcpこれにより、プロジェクトディレクトリ内に .venv フォルダが自動的に作成されます。
サーバーの実行
fastmcp run main.pyサーバーが起動し、stdio経由でMCP接続を待機します。SQLiteデータベース (expenses.db) は初回実行時に自動的に作成されます。
Claude Desktopへの接続
Claude Desktopの設定ファイルに以下を追加してください:
macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json
{
"mcpServers": {
"expense-tracker": {
"command": "uv",
"args": [
"--directory",
"C:\\Learning\\Expense-Tracker-MCP-Server",
"run",
"fastmcp",
"run",
"main.py"
]
}
}
}Claude Desktopを完全に終了(システムトレイ → 終了)してから再起動してください。ツールパネルに経費トラッカーツールが表示されるはずです。
プロンプト例
Claudeに接続したら、以下のように話しかけることができます:
"今日Whole Foodsで食料品に45ドル使ったことを記録して"
"今月の食費をすべて見せて"
"先月一番使ったものは何?"
"外食の月次予算を300ドルに設定して"
"娯楽費の予算はあといくら残ってる?"
"3月の経費をすべてCSVでエクスポートして"
開発
# Run with MCP inspector for debugging
fastmcp dev inspector main.pyライセンス
MIT
Available Tools
8 toolsadd_expenseB
Add a new expense. Date format: YYYY-MM-DD (defaults to today).
Inputs: amount (required), category (required), description, date, +1 more. Returns: object
delete_expenseB
Delete an expense by ID.
Inputs: id (required). Returns: object
export_expensesC
Export expenses as a CSV string.
Inputs: start_date, end_date, category. Returns: result
get_budget_statusB
Compare budget limits vs actual spend. Month format: YYYY-MM (defaults to current month).
Inputs: month. Returns: result
get_expense_summaryB
Summarize total spending grouped by 'category' or 'month'.
Inputs: group_by, start_date, end_date. Returns: result
list_expensesB
List expenses with optional filters. Date format: YYYY-MM-DD.
Inputs: category, start_date, end_date, limit. Returns: result
set_budgetC
Set or update the monthly budget limit for a category.
Inputs: category (required), monthly_limit (required), currency. Returns: object
update_expenseC
Update fields of an existing expense by ID.
Inputs: id (required), amount, category, description, +1 more. Returns: object
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 8 tools
Each tool has a clearly distinct purpose with no overlap: adding, deleting, updating, listing, summarizing, exporting expenses, and managing budgets. The descriptions specify unique actions (e.g., add vs. update) and resources (expenses vs. budget), eliminating ambiguity.
All tools follow a consistent verb_noun pattern (e.g., add_expense, delete_expense, get_budget_status). The naming is uniform across all eight tools, using snake_case and clear action verbs aligned with their functions.
With 8 tools, the server is well-scoped for an expense tracker, covering core operations like CRUD for expenses, budget management, summarization, and export. Each tool earns its place without being excessive or sparse.
The tool set provides complete coverage for the expense tracking domain: full CRUD for expenses (add, delete, update, list), budget management (set and status), summarization, and export. There are no obvious gaps, enabling agents to handle typical workflows end-to-end.
Maintenance
Related MCP Connectors
Track expenses from your AI chat: log, categorize, monthly CSV reports. All data is local.
Expense ledger for AI assistants: record receipts line by line, ask what you spent, export anytime.
Track expenses from receipt photos, then search, summarize and update them from your AI assistant.
Track budgets from your AI chat: envelopes, monthly limits, variance reports. All data is local.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage personal expenses through natural conversation, supporting expense tracking, categorization, filtering, and financial summaries. Uses SQLite database to store expense records with full CRUD operations for comprehensive personal finance management.2-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage personal expenses by adding, querying, and summarizing expense data through a SQLite database and configurable categories.1GPL 3.0
- FlicenseNot gradedqualityDmaintenanceEnables natural language management of personal expenses, including adding, listing, and summarizing expenses with local SQLite storage.-
- FlicenseAqualityDmaintenanceEnables AI assistants to track, query, summarize, and delete personal expenses stored in a local SQLite database via natural language.4-