Skip to main content
Glama
Expense Tracker MCP Server

Expense Tracker MCP Server

by simran-mehta

Expense Tracker MCP Server

ClaudeのようなAIアシスタントが、ローカルのSQLiteデータベースを使用して個人経費(追加、分類、集計、予算管理)を管理できるようにするMCP(Model Context Protocol)サーバーです。


概要

このサーバーは、Claude(またはMCP互換クライアント)が支出を追跡するために呼び出せる一連のMCPツールを提供します。すべてのデータはローカルのSQLiteファイルに保存されるため、クラウドやアカウントは不要です。


Related MCP server: ExpenseTracker MCP Server

機能

  • カテゴリ、金額、日付、説明を含む経費の追加と管理

  • 日付範囲やカテゴリによる経費のフィルタリングと一覧表示

  • カテゴリ別または月別の支出集計

  • カテゴリごとの予算設定と残高確認

  • CSVへの経費エクスポート

  • 完全ローカル — データはマシン内に留まります


MCPツール

ツール

説明

主要パラメータ

add_expense

新しい経費を記録する

amount, category, description, date, currency

list_expenses

オプションのフィルタ付きで経費を一覧表示する

category?, start_date?, end_date?, limit?

get_expense_summary

カテゴリまたは月別にグループ化された合計を集計する

group_by (category または month), start_date?, end_date?

update_expense

IDを指定して既存の経費を編集する

id, amount?, category?, description?, date?

delete_expense

IDを指定して経費を削除する

id

set_budget

カテゴリの月次予算上限を設定する

category, monthly_limit, currency?

get_budget_status

予算上限と実際の支出を比較する

month? (デフォルトは当月)

export_expenses

経費をCSV文字列としてエクスポートする

start_date?, end_date?, category?


プロジェクト構造

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 (推奨) または pip

  • Claude 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 tools
add_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

    A3.6/5.0

    Scored across 8 tools

    Disambiguation5/5

    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.

    Naming Consistency5/5

    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.

    Tool Count5/5

    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.

    Completeness5/5

    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

    ActivityInactive
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables 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
      -
    • A
      license
      Not graded
      quality
      D
      maintenance
      Enables AI assistants to manage personal expenses by adding, querying, and summarizing expense data through a SQLite database and configurable categories.
      1
      GPL 3.0
    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables natural language management of personal expenses, including adding, listing, and summarizing expenses with local SQLite storage.
      -