Skip to main content
Glama
Rawal1755

Expense Tracker MCP

by Rawal1755

Expense Tracker MCP

A Model Context Protocol (MCP) server for tracking personal expenses, built with Python, SQLAlchemy, and FastMCP.

Project Structure

expense-tracker-mcp2/
├── mcp/
│   ├── server.py            # FastMCP server & tool registration
│   └── tools/
│       └── expense_tools.py # Raw tool functions (called by server)
│
├── services/
│   └── expense_service.py   # Business logic layer
│
├── database/
│   ├── connection.py        # SQLAlchemy engine & session
│   └── models.py            # ORM models
│
├── schemas/
│   └── expense_schema.py    # Pydantic request/response schemas
│
├── .env                     # Environment variables
├── requirements.txt
└── README.md

Related MCP server: Expense Tracker MCP Server

Setup

1. Install dependencies

cd expense-tracker-mcp2
pip install -r requirements.txt

2. Configure environment

Edit .env to set your database URL. Defaults to SQLite:

DATABASE_URL=sqlite:///./expenses.db

3. Run the MCP server

python mcp/server.py

The database tables are created automatically on first run.

MCP Tools

Tool

Description

tool_add_expense

Add a new expense

tool_list_expenses

List expenses with optional filters

tool_update_expense

Update an expense by ID

tool_delete_expense

Delete an expense by ID

tool_summarize_expenses

Summarize totals grouped by category

Expense Categories

Food, Transport, Housing, Healthcare, Entertainment, Shopping, Education, Utilities, Other

Example Usage (via MCP client)

# Add an expense
tool_add_expense(title="Lunch", amount=250.0, category="Food", date="2026-05-24")

# List this month's expenses
tool_list_expenses(start_date="2026-05-01", end_date="2026-05-31")

# Summarize by category
tool_summarize_expenses(start_date="2026-05-01", end_date="2026-05-31")

Connecting to Claude Desktop

Add the following to your claude_desktop_config.json:

{
  "mcpServers": {
    "expense-tracker": {
      "command": "python",
      "args": ["/path/to/expense-tracker-mcp2/mcp/server.py"]
    }
  }
}

Related MCP Connectors

Related MCP Servers

  • F
    license
    C
    quality
    D
    maintenance
    Enables personal expense management with SQLite storage, allowing users to add, update, delete, list, and summarize expenses by category through natural language interactions.
    5
    -
  • F
    license
    A
    quality
    D
    maintenance
    Enables tracking and managing personal expenses through a local SQLite database. Supports adding, editing, deleting, listing, and summarizing expenses by category, as well as managing credit accounts.
    6
    -
  • F
    license
    A
    quality
    C
    maintenance
    Enables logging and tracking personal expenses in a local SQLite database with category/subcategory validation, offering tools to add, view, summarize, and delete expenses.
    4
    -
  • F
    license
    A
    quality
    C
    maintenance
    Enables tracking personal expenses by adding, listing, deleting, and summarizing expenses by day or month, stored locally in a JSON file.
    4
    -