Skip to main content
Glama
shandilya3031

Expense Tracker MCP Server

Expense Tracker MCP Server

This project is a Model Context Protocol (MCP) server for managing personal expenses. It exposes tools and a resource that can be used by MCP-compatible clients such as Claude Desktop or the FastMCP inspector.

What it does

The server provides:

  • add_expense(date, amount, category, subcategory="", note="") to store a new expense

  • list_expenses(start_date, end_date) to retrieve expenses in a date range

  • summarize(start_date, end_date, category=None) to group totals by category

  • expense://categories as a JSON resource for category definitions

Expenses are stored in a local SQLite database created automatically when the server starts.

Related MCP server: Expense Tracker MCP Server

Requirements

  • Python 3.13 or newer

  • uv for dependency and script management

Installation

From the project root:

uv sync

This installs the project and its dependencies from the pyproject.toml file.

Run locally with the MCP inspector

Start the server and inspect it in the FastMCP inspector:

uv run fastmcp dev inspector src/expense_tracker_mcp_server/main.py

This opens the inspector UI and lets you test the tools and resources.

Connect to Claude Desktop

To install the server into Claude Desktop, run:

uv run fastmcp install claude-desktop src/expense_tracker_mcp_server/main.py

On Windows, Claude Desktop may store its config under a packaged-app path. If the default location is not detected, provide it explicitly:

uv run fastmcp install claude-desktop --config-path "C:\Users\<your-user>\AppData\Local\Packages\Claude_pzs8sxrjxfjjc\LocalCache\Roaming\Claude" src/expense_tracker_mcp_server/main.py

Replace <your-user> with your Windows username.

Project structure

src/
  expense_tracker_mcp_server/
    __init__.py
    main.py
  • main.py contains the MCP server implementation and tool definitions.

  • expenses.db is created automatically at runtime in the package directory.

  • categories.json is loaded as the expense://categories resource.

Example usage

Once the server is running, you can call the tools with payloads such as:

{
  "date": "2026-07-31",
  "amount": 42.5,
  "category": "Food",
  "subcategory": "Lunch",
  "note": "Team lunch"
}

Notes

  • The SQLite database is local to the project and will be created on first run.

  • The categories resource is read from the JSON file each time it is requested, so edits are picked up without restarting the server.

Available Tools

3 tools
add_expenseC

Add a new expense entry to the database.

ParametersJSON Schema
NameRequiredDescriptionDefault
dateYes
noteNo
amountYes
categoryYes
subcategoryNo

TDQS

C2.6/5.0
Behavior2/5

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

With no annotations, the description carries the full burden of behavioral disclosure. It states that an entry is added, but does not disclose validation behavior, duplicate handling, side effects, required-field enforcement, or what happens after a successful add.

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

Conciseness4/5

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

The description is a single, direct sentence with virtually no filler. It could be considered slightly under-specified, but as far as conciseness and structure go, it is efficient and easy to parse.

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

Completeness2/5

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

For a 5-parameter create operation with no annotations, no output schema, and no schema descriptions, this is not a complete definition. The description misses parameter details, input formats, result/error behavior, and any explicit differentiation from sibling tools.

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

Parameters1/5

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

Schema description coverage is 0%, and the description does not compensate by explaining any of the parameters. The agent must rely entirely on parameter names like date, amount, category, subcategory, and note, with no type, format, or semantic guidance.

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

Purpose4/5

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

The description clearly states the operation: 'Add a new expense entry to the database.' It uses a specific verb and resource, and the action is distinct from the sibling tools list_expenses and summarize, though it does not explicitly name them.

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

Usage Guidelines2/5

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

No guidance is provided about when to use this tool versus list_expenses or summarize outside of the obvious 'add' intent. There are no prerequisite conditions, exclusions, or alternative routing hints.

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

list_expensesA

List expense entries within an inclusive date range.

ParametersJSON Schema
NameRequiredDescriptionDefault
end_dateYes
start_dateYes

TDQS

A3.7/5.0
Behavior3/5

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

With no annotations, the description carries the full behavioral burden. It clearly identifies a read operation and the inclusive date-range boundary, but does not mention pagination, ordering, or the returned fields. This is adequate but not rich.

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?

A single sentence front-loads the verb, resource, and main constraint. There is no filler or redundant restating of the tool name.

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 two-parameter list tool, the description covers the core action and range semantics. However, the lack of an output schema and absence of return-shape or date-format guidance leaves some ambiguity for an agent invoking the tool.

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 adds the key semantic that the range is inclusive, but it does not specify the expected date format or confirm how each parameter maps beyond their names.

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 uses a specific verb ('List') and resource ('expense entries'), and adds a clear scope (inclusive date range). This distinguishes it from siblings 'add_expense' (create) and 'summarize' (aggregate).

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 intended use is implied by the name and siblings, but there is no explicit statement about when to choose this over 'summarize' or how it relates to 'add_expense'. No exclusions or alternative routing are provided.

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

summarizeA

Summarize expenses by category within an inclusive date range.

ParametersJSON Schema
NameRequiredDescriptionDefault
categoryNo
end_dateYes
start_dateYes

TDQS

A3.7/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 behavioral burden. It discloses that the date range is inclusive, which is useful, but it does not mention whether the operation is read-only, what metrics are returned, or how categories with no expenses are handled.

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 redundancy or filler. Every word contributes to the tool's core behavior.

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 three-parameter summarization tool, the description gives the essential operation but leaves gaps. With no annotations and no output schema, it should say more about the return shape, optional category behavior, and what 'summarize' actually computes.

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 provides no descriptions for any parameter (0% coverage), so the description must compensate. It adds meaning by connecting category to grouping and start_date/end_date to an inclusive range, but it does not clarify whether category is a filter or required grouping key, nor the expected date format.

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 ('summarize') and resource ('expenses'), and adds the grouping dimension (by category) and date range scope. This clearly distinguishes it from the sibling tools add_expense and list_expenses.

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 intended use is implied: summarize rather than add or list expenses. However, there is no explicit guidance about when to prefer this tool over list_expenses or what scenarios it is not suited for, leaving some inference to the agent.

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.6/5.0

Scored across 3 tools

Disambiguation5/5

Each tool has a clearly distinct purpose: adding an expense, listing expenses, and summarizing expenses by category. There is no overlap or ambiguity between them.

Naming Consistency4/5

Tools follow a mostly verb_noun pattern (add_expense, list_expenses), but 'summarize' lacks a noun object, which is a minor deviation. Overall the pattern is still clear and predictable.

Tool Count5/5

Three tools is an appropriate, well-scoped count for a focused expense tracker server. Each tool serves a necessary function without redundancy.

Completeness4/5

The domain of expense tracking is covered with basic create (add_expense), read (list_expenses), and aggregate (summarize) operations. Missing update and delete capabilities are minor gaps that can be worked around.

Maintenance

ActivitySlowing
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • 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
    A
    quality
    D
    maintenance
    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.
    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
    B
    maintenance
    A simple MCP server for tracking expenses in a local SQLite database, enabling add, read, update, delete, and summarization of expenses with predefined categories.
    -