Skip to main content
Glama
expense-mcp

expense-mcp

by justfsl50

💰 expense-mcp

Personal Expense Tracker as an MCP Server — works with Claude Desktop, Cursor, nanobot, Windsurf, and any MCP-compatible client.

Python MCP SDK License


Features

  • 📝 Track expenses & income with categories and descriptions

  • 📊 Spending summaries — today, week, month, year

  • 💳 Budget management — set limits per category, get alerts at 80%/100%

  • 🎯 Savings goals — create goals, track progress with visual bars

  • 📈 Spending insights — top categories, daily averages, biggest days

  • 🗑️ Safe deletion — Pydantic-based elicitation for confirmation

  • 🔄 Dual transport — stdio (local) + streamable HTTP (remote)


Related MCP server: expense-tracker-mcp-server

Install

# with uv (recommended)
uv pip install git+https://github.com/justfsl50/expense-mcp.git

# with pip
pip install git+https://github.com/justfsl50/expense-mcp.git

# from source
git clone https://github.com/justfsl50/expense-mcp.git
cd expense-mcp
pip install -e .

Quick Start

Claude Desktop

Add to %APPDATA%\Claude\claude_desktop_config.json (Windows) or ~/Library/Application Support/Claude/claude_desktop_config.json (Mac):

{
  "mcpServers": {
    "expense-mcp": {
      "command": "uv",
      "args": ["run", "expense-mcp"],
      "env": {
        "DATABASE_URL": "sqlite:///expenses.db",
        "CURRENCY": "₹",
        "DEFAULT_USER": "me"
      }
    }
  }
}

Cursor / Windsurf

Same config — paste into MCP settings under the respective app.

nanobot

{
  "mcp": {
    "servers": [{
      "name": "expense-mcp",
      "command": "uv run expense-mcp"
    }]
  }
}

HTTP mode (remote / multi-client)

python server.py http
# Server runs at http://127.0.0.1:8000/mcp

Environment Variables

Variable

Default

Description

DATABASE_URL

sqlite:///expenses.db

SQLite or PostgreSQL URL

CURRENCY

₹

Currency symbol

DEFAULT_USER

default

User ID for multi-user setups

PostgreSQL example:

DATABASE_URL=postgresql://user:pass@localhost:5432/expenses

Tools

Tool

Description

Read-only

expense_add

Save expense or income

❌

expense_search

Filter by text, date, category, amount

✅

expense_summary

today / week / month / year totals

✅

expense_delete

Delete with Pydantic confirmation prompt

❌

expense_insights

Spending patterns and top categories

✅

budget_set

Set monthly category budget

❌

budget_list

View budgets with usage %

✅

goal_create

Create savings goal

❌

goal_update

Add money toward goal

❌

goal_list

View goals with progress bars

✅

Resources

URI

Description

expense://summary/month

Current month summary

expense://budgets/current

This month's budgets

expense://goals/all

All savings goals

Prompts

Prompt

Title

Description

monthly_review

Monthly Review

Start a full month spending review

budget_setup

Budget Setup

Auto-suggest budgets from history

savings_plan

Savings Plan

Create a plan for a savings goal


Usage Examples

Just talk naturally in any MCP client:

"spent 500 on groceries"
"show food expenses this week"
"how much did I spend last month?"
"set food budget to 5000"
"am I within budget?"
"save 1000 toward my iPhone goal"
"give me spending insights"
"delete expense #12"

Architecture

  • MCP SDK v1.26.0 with FastMCP + json_response=True

  • Typed lifespan — DB engine managed via AppContext dataclass

  • SQLAlchemy 2.0 — DeclarativeBase, sessionmaker

  • Pydantic v2 — input validation, elicitation schemas

  • Tool annotations — readOnlyHint, destructiveHint, idempotentHint

  • Context logging — ctx.info(), ctx.warning() in tools

Database Schema

expenses  — id, user_id, amount, category, description, type, date, source, created_at
budgets   — id, user_id, category, amount, month
goals     — id, user_id, name, target, saved, deadline

License

MIT — free to use, modify, and distribute.

Available Tools

10 tools
budget_listA
Read-onlyIdempotent

Get all budgets and current spending for this month.

Returns: Formatted budget list with usage percentages and status indicators.

Inputs: no named parameters. Returns: result

budget_setA
Idempotent

Set or update a monthly budget for a spending category.

Args: params: BudgetInput with category, amount, and optional month.

Returns: Confirmation of budget set.

Inputs: params (required). Returns: result

expense_addA

Save a new expense or income transaction.

Args: params: AddExpenseInput with amount, category, description, type, date.

Returns: Confirmation string with saved details and optional budget alert.

Inputs: params (required). Returns: result

expense_deleteA
Destructive

Permanently delete an expense by ID. Asks for confirmation first.

Args: expense_id: The ID of the expense to delete (from expense_search results).

Returns: Confirmation or cancellation message.

Inputs: expense_id (required). Returns: result

expense_insightsA
Read-onlyIdempotent

Get spending patterns and insights for the current month.

Returns: Key spending metrics: top category, daily average, biggest day, anomalies.

Inputs: no named parameters. Returns: result

expense_summaryA
Read-onlyIdempotent

Get spending summary for a time period.

Args: period: 'today', 'week', 'month', or 'year'.

Returns: Summary with totals, balance, and category breakdown.

Inputs: period. Returns: result

goal_createA

Create a new savings goal.

Args: params: GoalInput with name, target amount, and deadline.

Returns: Confirmation of goal creation.

Inputs: params (required). Returns: result

goal_listA
Read-onlyIdempotent

Get all savings goals with progress bars.

Returns: Formatted list of goals with progress and deadline.

Inputs: no named parameters. Returns: result

goal_updateB

Add money toward a savings goal.

Args: params: UpdateGoalInput with goal name and amount to add.

Returns: Updated goal progress.

Inputs: params (required). Returns: result

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A4.1/5.0

    Scored across 10 tools

    Disambiguation5/5

    Each tool has a distinct purpose: budgeting, expenses, and goals are clearly separated. Even similar tools like expense_summary and expense_insights provide different outputs (summary vs. patterns), so no confusion.

    Naming Consistency5/5

    All tools follow a consistent verb_noun pattern using snake_case, e.g., expense_add, goal_list, budget_set. The naming conventions are uniform across the entire set.

    Tool Count5/5

    10 tools cover the three main domains (budgets, expenses, goals) without being excessive. Each tool contributes a necessary operation, making the set well-scoped for an expense management server.

    Completeness4/5

    The tool surface covers core CRUD operations for expenses (add, delete, search) and goals (create, list, update), but misses an expense update tool. Budgets have list and set, which covers creation and reading, but no delete. Minor gaps exist.

    Maintenance

    ActivityInactive
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables users to track personal expenses through natural language interactions with comprehensive category support and financial summaries. Provides both local and remote MCP server options with SQLite storage for fast expense management operations.
      -
    • F
      license
      B
      quality
      D
      maintenance
      MCP server for tracking personal expenses using FastMCP and SQLite, enabling adding, listing, updating, deleting expenses and summarizing by category via natural language tools.
      5
      1
      -
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server for personal finance management. Enables natural language expense logging, budgeting, recurring charge detection, and statement import with deterministic local calculations.
      -
    • F
      license
      A
      quality
      D
      maintenance
      A personal expense tracker exposed over MCP, enabling users to log and query expenses in natural language sentences. It features category inference, recurring expenses, soft deletes, and SQLite storage with no external database.
      16
      -