Skip to main content
Glama
ameympatil

Expense Tracker MCP Server

by ameympatil

Expense Tracker MCP Server

A Model Context Protocol (MCP) server for tracking personal expenses. This server provides tools to add, list, and summarize expenses, utilizing a local SQLite database for storage.

Features

  • Add Expenses: Log expenses with details including amount, category, subcategory, date, and notes.

  • List Expenses: Retrieve a list of expenses within a specified date range.

  • Summarize Expenses: Generate summaries of expenses (total amount) grouped by category.

  • Categories Resource: Access a comprehensive list of predefined expense categories.

  • Local Database: All data is stored in a local expenses.db file.

Related MCP server: Expense Tracker MCP Server

Prerequisites

  • Python 3.13 or higher

  • uv (recommended) or pip

Installation

  1. Clone the repository (if applicable) or navigate to the project directory:

    cd "d:\Study\Expense Tracker MCP"
  2. Install dependencies:

    Using uv:

    uv sync

    Or using pip:

    pip install -e .

Usage

Running Locally

You can run the MCP server locally for testing or development.

Development mode (with auto-reload):

uv run fastmcp dev main.py

Production run:

uv run fastmcp run main.py

Inspector

You can inspect and test the server tools using the MCP Inspector:

uv run fastmcp inspect main.py

Integration with Claude Desktop

To use this Expense Tracker with Claude Desktop:

  1. Open your Claude Desktop configuration file:

    • Windows: %APPDATA%\Claude\claude_desktop_config.json

    • macOS: ~/Library/Application Support/Claude/claude_desktop_config.json

  2. Add the expense-tracker server to the mcpServers object. Make sure to use the absolute path to your main.py file.

    {
      "mcpServers": {
        "expense-tracker": {
          "command": "uv",
          "args": [
            "run",
            "fastmcp",
            "run",
            "d:/Study/Expense Tracker MCP/main.py"
          ]
        }
      }
    }
  3. Restart Claude Desktop.

Tools Available

add_expense

Adds a new expense entry.

  • Arguments:

    • amount (float): The cost of the expense.

    • category (string): The category of the expense (see categories resource).

    • subcategory (string, optional): A more specific classification.

    • note (string, optional): Additional details.

    • date (string, optional): Date of expense in DD-MM-YYYY format. Defaults to current date (IST) if omitted.

list_expenses

Lists expenses within a date range.

  • Arguments:

    • start_date (string): Start date in DD-MM-YYYY format.

    • end_date (string): End date in DD-MM-YYYY format.

summarize

Summarizes expenses by category.

  • Arguments:

    • start_date (string): Start date in DD-MM-YYYY format.

    • end_date (string): End date in DD-MM-YYYY format.

    • category (string, optional): Filter by a specific category.

Resources

expense://categories

Returns the JSON content of the available expense categories.

Project Structure

  • main.py: The core MCP server implementation.

  • expenses.db: SQLite database file (created automatically).

  • categories.json: specific categories configuration.

  • pyproject.toml: Project configuration and dependencies.

Notes

  • Date Format: The system uses DD-MM-YYYY for date storage and querying.

  • Timezone: Default dates are calculated in Indian Standard Time (IST).

Available Tools

3 tools
add_expenseA

Add a new expense entry to the database. If date is not provided, it defaults to current IST date.

ParametersJSON Schema
NameRequiredDescriptionDefault
dateNo
noteNo
amountYes
categoryYes
subcategoryNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.6/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description must carry the full burden. It discloses a useful behavioral trait (date defaults to current IST date), but does not mention return values, validation rules, or any side effects. This adds some value but leaves notable gaps for a mutation tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is two short sentences with no redundancy. The purpose is front-loaded, and the date default is stated efficiently. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple create tool with an output schema, the description covers the core purpose and one key default. However, it lacks usage guidance and parameter explanations, which could leave an agent uncertain about how to properly construct inputs or when this tool is appropriate.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters2/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It only explains the date parameter's default behavior, leaving amount, category, note, and subcategory unexplained. The names are somewhat self-explanatory, but the description adds minimal meaning beyond the schema itself.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the verb 'Add' and the resource 'expense entry', making its purpose unambiguous. It is easily distinguished from sibling tools list_expenses and summarize, which involve reading and analyzing rather than creating.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance is given on when to use this tool versus alternatives. The description implies usage by describing the action, and the date default provides a usage nuance, but there is no mention of exclusions or comparison to list_expenses or summarize.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

list_expensesA

List all expenses between start_date and end_date.

ParametersJSON Schema
NameRequiredDescriptionDefault
end_dateYes
start_dateYes

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are provided, so the description carries the full burden. It clearly implies a read-only operation ('List'), but does not disclose additional behavioral details such as pagination, ordering, date format, or whether all expense fields are returned. It is minimally transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, front-loaded sentence with no redundant words. It efficiently conveys the core purpose.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

For a simple list tool with an output schema present, the description provides the essential scope. It does not cover edge cases like timezone or pagination, but these are less critical given the existence of an output schema and the tool's simplicity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The schema has 0% description coverage, and the description only adds that the two parameters define a range ('between start_date and end_date'). This reinforces the parameter names but does not specify date format, inclusivity, or other constraints. Minimal compensation for missing schema descriptions.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description states a specific verb ('List'), a clear resource ('expenses'), and a specific scope ('between start_date and end_date'). It clearly distinguishes from sibling tools: add_expense (write operation) and summarize (aggregation).

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies the tool is for listing expenses within a date range, but provides no explicit guidance on when to choose this over alternatives like summarize. It lacks any 'when not to use' or cross-reference to sibling tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

summarizeA

Summarize all expenses by category within an inclusive date range. If category is not provided, summarize all categories.

ParametersJSON Schema
NameRequiredDescriptionDefault
categoryNo
end_dateYes
start_dateYes

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

A3.8/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the burden. It discloses inclusive date ranges and category fallback, but it does not specify whether 'summarize' means sum, count, average, or another aggregation. The output schema likely covers return format, but the aggregation metric is ambiguous.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two concise sentences front-load the core action ('Summarize all expenses by category') and add a useful conditional without any superfluous words. This is an appropriate size for the tool's simplicity.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool has a simple parameter set and an output schema, so the description need not detail return values. It covers the key aspects of category grouping and date inclusivity, but the unclear 'summarize' semantics leave a minor gap in the overall completeness.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema description coverage is 0%, so the description must compensate. It explains the category parameter (optional, default all categories) and the inclusiveness of the date range, but it does not provide date format expectations or further clarify the date parameters beyond their names and types.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool summarizes expenses by category within an inclusive date range, and the optional category behavior is explicit. This distinguishes it from sibling tools like add_expense and list_expenses by focusing on aggregation rather than modification or individual listing.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines3/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies usage for aggregate views of expenses, but it does not explicitly state when to prefer this over list_expenses or provide alternative guidance. The context is clear but not the boundary between tools.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

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

  1. 3 tool updatesv0.1.0
    • First observedadd_expense
    • First observedlist_expenses
    • First observedsummarize

TDQS

A3.8/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: adding, listing, and summarizing expenses. No overlap or ambiguity between them.

Naming Consistency4/5

Two tools follow a verb_noun pattern (add_expense, list_expenses), but summarize is a bare verb, creating a minor inconsistency. Overall still readable and predictable.

Tool Count4/5

Three tools is slightly minimal for an expense tracker, but it covers the core needs. Not excessively thin or bloated.

Completeness3/5

The set covers adding, listing, and summarizing expenses, but lacks update/delete operations. Users cannot correct or remove entries, a notable gap in lifecycle coverage.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    A lightweight server built with FastMCP and SQLite for managing personal finances. It allows users to add, list, and summarize expenses by category through MCP-compatible clients.
    -
  • F
    license
    B
    quality
    D
    maintenance
    A powerful SQLite-backed expense tracking server built with the Model Context Protocol (MCP). This server allows AI agents (like Claude) to manage your personal finances by adding, deleting, and listing expenses directly from your chat interface.
    3
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    MCP server for tracking expenses with local SQLite storage. Provides tools to add, list, and summarize expenses by category.
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    A lightweight local MCP server for tracking personal or small-team expenses. It lets you add expense entries, list transactions within a date range, and generate simple summaries by category — all backed by a local SQLite database.
    -