mcpField
E
expense-mcp

expense-mcp

Local
github.com/justfsl50Finance1Updated 34w ago

About expense-mcp

expense-mcp is a personal finance MCP server for people who want to manage spending, budgets, and savings goals through MCP clients. It combines period summaries and spending insights with local stdio and remote HTTP transports.

Key features

  1. 01Record categorized expenses and income
  2. 02Summaries by day, week, month, and year
  3. 03Category budgets with usage alerts
  4. 04Create and track savings goals
  5. 05Analyze spending categories and patterns
  6. 06stdio and HTTP transports

Use cases

  1. 01Log everyday spending and income
  2. 02Check spending for a week or month
  3. 03Monitor category budget usage
  4. 04Track progress toward savings goals

MCP support

The MCP server provides compatible clients with tools for recording, searching, and summarizing transactions, managing budgets, and tracking goals, along with summary resources and prompts such as monthly reviews. It supports local stdio and remote HTTP connections.

Configuration

Local server config is the same for every client. Copy it into your client’s MCP config file.

mcp.json · Universal config
{
"mcpServers": {
"justfsl50-expense": {
"command": "uvx",
"args": [
"expense-mcp"
],
"env": {
"DATABASE_URL": "<DATABASE_URL>",
"CURRENCY": "<CURRENCY>",
"DEFAULT_USER": "<DEFAULT_USER>"
}
}
}
}
Run commanduvx expense-mcp
Environment variables to set
DATABASE_URLSQLite or PostgreSQL database URL
CURRENCYCurrency symbol (default: ₹)
DEFAULT_USERUser ID for multi-user setups

Local servers need a runtime on your machine (e.g. Node.js 18+). Config file locations differ by client; see your client’s docs.

Packages
pypiexpense-mcp1.0.1

Tools

10

Saved tool list · updated 2w ago

ParameterTypeRequiredDescription
paramsanyYes

Details

From the project README

💰 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)

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

VariableDefaultDescription
DATABASE_URLsqlite:///expenses.dbSQLite or PostgreSQL URL
CURRENCY₹Currency symbol
DEFAULT_USERdefaultUser ID for multi-user setups

PostgreSQL example:

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

Tools

ToolDescriptionRead-only
expense_addSave expense or income❌
expense_searchFilter by text, date, category, amount✅
expense_summarytoday / week / month / year totals✅
expense_deleteDelete with Pydantic confirmation prompt❌
expense_insightsSpending patterns and top categories✅
budget_setSet monthly category budget❌
budget_listView budgets with usage %✅
goal_createCreate savings goal❌
goal_updateAdd money toward goal❌
goal_listView goals with progress bars✅

Resources

URIDescription
expense://summary/monthCurrent month summary
expense://budgets/currentThis month's budgets
expense://goals/allAll savings goals

Prompts

PromptTitleDescription
monthly_reviewMonthly ReviewStart a full month spending review
budget_setupBudget SetupAuto-suggest budgets from history
savings_planSavings PlanCreate 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.

Comments

Markdown supported

New to MCP?

From what the protocol is to installing your first server, these answers cover most first questions.

An open protocol that defines how AI applications connect to external tools and data in a uniform way. Clients talk to the model; MCP servers provide tools, resources and prompt templates. They exchange standard messages, so one server can be reused by many clients.