Skip to main content
Glama
SAYOUNCDR

expense-tracker-mcp-server

by SAYOUNCDR

ExpenseTracker FastMCP server

Lightweight MCP server for tracking personal expenses using FastMCP and SQLite. This repo provides a small, local MCP server you can run on your machine for quick experiments, demos, or as the basis for a remote deployment.

What this is -

  • A minimal MCP server exposing a few tools to record and query expenses.

  • Stores data in a local SQLite database: expenses.db (created automatically).

  • Ships a JSON resource expense://categories backed by categories.json.

Main features

  • add_expense(date, amount, category, subcategory, note)

  • list_expenses(start_date, end_date)

  • update_expense(expense_id, ...)

  • delete_expense(expense_id)

  • summarize(start_date, end_date, category=None)

  • categories resource (JSON)

Related MCP server: local-expense-tracker

Quick start (Windows - cmd.exe)

  1. Create a virtual environment and activate it (Windows cmd.exe):

First of all install uv if you don't have it already globally using:

pip install uv

Then create and activate a virtual environment:


python -m venv .venv
.venv\Scripts\activate
  1. Install dependencies. If you use pip directly, at minimum install FastMCP. If your project uses a lockfile or pyproject.toml, prefer that.

pip install fastmcp
# or, if you maintain requirements.txt:
pip install -r requirements.txt

Optional: if you're using the uv helper CLI (used in some FastMCP guides), you can add FastMCP via the uv CLI instead of pip. Only run the following if you already have the uv tool installed:

uv add fastmcp
  1. Run the server in development mode (opens FastMCP studio if available):

uv run fastmcp dev main.py
  1. Run the server for normal usage:

uv run fastmcp run main.py

Notes

  • Database: expenses.db will be created next to main.py on first run.

  • Edit categories.json to customize categories; the MCP categories resource reads it fresh on each call.

Testing with FastMCP Studio / Claude Desktop

You can test and inspect the MCP server locally either using the FastMCP studio (dev mode) or by adding the server to Claude Desktop.

  1. Run FastMCP studio (dev mode)

uv run fastmcp dev main.py

This runs the server in development mode and opens FastMCP's studio/inspector (if available) so you can call tools interactively.

  1. Add the server to Claude Desktop (optional)

If you want Claude Desktop to manage and talk to your MCP server, install the Claude Desktop helper using the FastMCP/uv helper (only if you have the uv helper installed):

uv run fastmcp install claude-desktop main.py

Important notes when using Claude Desktop:

  • After changing the server code, fully restart Claude Desktop so it reloads the MCP server. That means quitting the app completely (exit from the system tray / taskbar) and then reopening it.

  • If Claude Desktop fails to load your MCP server, edit the Claude Desktop MCP config: open Claude Desktop, go to Settings → Developer → Edit config. You'll see a JSON like this:

{
  "mcpServers": {
    "ExpenseTracker": {
      "command": "C:\\Users\\Sayoun Parui\\AppData\\Roaming\\Python\\Python313\\Scripts\\uv.exe", # here if u see  only  uv 
      "args": [
        "run",
        "--with",
        "fastmcp",
        "fastmcp",
        "run",
        "C:\\Users\\Sayoun Parui\\Desktop\\ExpenceTracker MCP Server\\main.py"
      ],
      "env": {},
      "transport": "stdio",
      "type": null,
      "cwd": null,
      "timeout": null,
      "description": null,
      "icon": null,
      "authentication": null
    }
  },
  "preferences": {
    "menuBarEnabled": false,
    "legacyQuickEntryEnabled": false
  }
}
  • If the command value just shows uv (or a short name) you should replace it with the full path to the uv executable. To find the full path, open a Windows cmd.exe and run:

where uv

Copy the full path returned (for example C:\Users\You\AppData\Roaming\Python\Python313\Scripts\uv.exe) and paste it into the command field in the Claude config, replacing the short uv value. Save the config and restart Claude Desktop.

If where uv returns multiple results, pick the one that points to your desired Python environment (global or the one where you installed uv).

Tools / API (what you can call)

  • add_expense(date: str, amount: float, category: str, subcategory: str = "", note: str = "") -> {status, id}

  • list_expenses(start_date: str, end_date: str) -> list of expense objects

  • update_expense(expense_id: int, date, amount, category, subcategory, note) -> {status}

  • delete_expense(expense_id: int) -> {status}

  • summarize(start_date: str, end_date: str, category: Optional[str]) -> [{category, total_amount}]

  • Resource: expense://categories — returns categories.json content (mime_type: application/json)

Example call (pseudo):

# with FastMCP client or via the studio, call the `add_expense` tool:
result = mcp.call('add_expense', date='2025-10-01', amount=12.50, category='food', subcategory='snacks', note='coffee')

Project layout

  • main.py — MCP server implementation and tool definitions.

  • categories.json — default categories/subcategories used by the resource.

  • expenses.db — SQLite DB (auto-created).

Deployment & next steps

This project is intentionally small so it's easy to convert to a remote service. Ideas for production-ready deployments:

  • Move the DB to Postgres or another managed DB (RDS, Cloud SQL).

  • Containerize the app and deploy to ECS, EKS, GKE, or App Services.

  • Add authentication to MCP endpoints and secure the server behind a gateway.

Short-term suggestions:

  • Add basic schema migration tooling (alembic/sqlalchemy or a simple migration script).

  • Add input validation and richer date handling (ISO 8601 enforcement).

  • Add unit tests for the tool functions.

Contributing

Small contributions welcome. Suggested workflow:

  1. Fork the repo

  2. Create a feature branch

  3. Open a PR with a short description of changes

Please keep changes small and focused. If you plan a large refactor (DB change, API redesign), open an issue first.

Available Tools

5 tools
add_expenseC

Add a new expense entry to the database.

ParametersJSON Schema
NameRequiredDescriptionDefault
dateYes
amountYes
categoryYes
subcategoryNo
noteNo

TDQS

C2.7/5.0
Behavior2/5

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

No annotations provided. The description only states the action but lacks details on idempotency, side effects, or data validation.

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

Conciseness3/5

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

Single sentence, concise but lacks structure or front-loading of key information.

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?

With five parameters, no output schema, and no annotations, the description is incomplete; it does not explain return values or handle edge cases.

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 coverage is 0%. The description adds no meaning to any of the five parameters, not even the required date, amount, or category.

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 ('Add') and resource ('expense entry'), clearly distinguishing it from siblings like delete_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 Guidelines2/5

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

No guidance on when to use this tool versus alternatives. Siblings exist but no differentiation is provided.

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

delete_expenseC

Delete an expense entry by its ID.

ParametersJSON Schema
NameRequiredDescriptionDefault
expense_idYes

TDQS

C2.9/5.0
Behavior2/5

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

As a destructive tool with no annotations, the description fails to disclose important behavioral traits such as permanence, required permissions, or potential side effects. 'Delete' implies mutation but lacks further detail.

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

Conciseness3/5

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

The description is a single, concise sentence with no extraneous information. However, for a destructive tool, it is overly brief and sacrifices necessary detail.

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?

Given no annotations, no output schema, and a single parameter, the description is incomplete. It omits return values, error handling, and prerequisites for safe deletion.

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?

With 0% schema description coverage, the description adds minimal value. It mentions 'by its ID' but does not explain the format, source, or constraints of expense_id.

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 ('Delete') and resource ('expense entry') with a clear method ('by its ID'). It distinguishes from siblings like add_expense, list_expenses, and update_expense.

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?

The description only states how to delete (by ID) but provides no context on when to use this tool versus alternatives, prerequisites (e.g., existence of expense), or when not to use it.

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

list_expensesC

List expense entries within an inclusive date range.

ParametersJSON Schema
NameRequiredDescriptionDefault
start_dateYes
end_dateYes

TDQS

C2.9/5.0
Behavior2/5

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

With no annotations, the description bears full responsibility for behavioral disclosure. It only states basic read-only behavior without mentioning pagination, limits, ordering, or potential side effects, leaving significant gaps.

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 concise sentence that front-loads key information. It is appropriately brief, though it could benefit from additional context without sacrificing conciseness.

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?

Given the tool's simplicity with 2 required parameters and no output schema, the description should cover return format or data structure. It fails to mention what the response contains, leaving the agent uncertain about the output.

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?

The input schema has 0% description coverage, so the description must compensate. It clarifies the date range is inclusive but does not specify date format, timezone handling, or parameter constraints beyond the schema.

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 'List' and the resource 'expense entries', and specifies the scope as 'within an inclusive date range'. This explicitly differentiates it from sibling tools like add_expense, delete_expense, update_expense, and summarize.

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?

The description provides no guidance on when to use this tool versus alternatives, no exclusion criteria, and no prerequisites. It merely states the function without context for decision-making.

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

summarizeB

Summarize expenses by category within an inclusive date range.

ParametersJSON Schema
NameRequiredDescriptionDefault
start_dateYes
end_dateYes
categoryNo

TDQS

B3.2/5.0
Behavior2/5

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

With no annotations, the description must disclose behavioral traits. It mentions 'inclusive date range' but does not state that the tool is read-only, lacks details on return format, and omits any side effects or permissions.

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?

One sentence with no wasted words. It is front-loaded with the key action but could benefit from additional param details without becoming verbose.

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?

Given no annotations, no output schema, and 0% schema coverage, the description is insufficient. It fails to provide parameter details, return value expectations, or usage context beyond the basic purpose.

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 coverage is 0%. The description mentions 'category' as a grouping field but does not clarify its optionality or the expected format for date parameters. It adds minimal value beyond the schema structure.

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?

Description clearly states the tool summarizes expenses by category within a date range. The verb 'summarize' and resource 'expenses' are specific, and the grouping by 'category' distinguishes it from sibling tools that perform CRUD operations.

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 when-to-use or when-not-to-use guidance. The usage is implied by the tool name and siblings, but no alternatives or exclusions are mentioned.

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

update_expenseC

Update an existing expense entry.

ParametersJSON Schema
NameRequiredDescriptionDefault
expense_idYes
dateYes
amountYes
categoryYes
subcategoryNo
noteNo

TDQS

C2.3/5.0
Behavior2/5

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

The description implies a mutation but provides no details on side effects, permissions required, or whether the update merges or replaces fields. With no annotations, the description fails to disclose behavioral traits.

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

Conciseness2/5

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

The description is extremely concise (5 words) but at the expense of essential information. It does not earn its place as it omits critical details such as parameter usage, return behavior, or optional field handling.

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

Completeness1/5

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

The tool has 6 parameters (4 required) and no output schema. The description provides no context about return values, update behavior (e.g., partial vs. full replacement), or error handling. It is severely incomplete for an update operation.

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 adds no information about parameter meaning, format, constraints, or default behavior. While parameter names are somewhat self-explanatory, the description does not compensate for the lack of schema documentation.

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 action ('Update') and the resource ('an existing expense entry'). It differentiates from siblings like add_expense (create new) and delete_expense (remove). However, it lacks specificity on which fields can be updated.

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 on when to use this tool versus alternatives. There is no mention of prerequisites, context, or conditions for updating an expense.

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. Dates show when Glama detected each change.

  1. 5 tool updatesv0.1.0
    • First observedadd_expense
    • First observeddelete_expense
    • First observedlist_expenses
    • First observedsummarize
    • First observedupdate_expense

TDQS

B3.2/5.0
Disambiguation5/5

Each tool has a clearly distinct purpose: add, delete, list, summarize, and update. No overlap or ambiguity.

Naming Consistency4/5

Four tools follow verb_noun pattern (add_expense, delete_expense, list_expenses, update_expense), but 'summarize' lacks a noun, which is a minor inconsistency.

Tool Count5/5

Five tools is well-scoped for an expense tracker, covering essential operations without being excessive or insufficient.

Completeness4/5

CRUD operations are present (add, delete, update) along with listing and summarization. Missing a get_expense by ID, but list by date range covers retrieval adequately. Minor gap in filtering without summary.

Maintenance

ActivityInactive
ResponsivenessNo issues

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

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
    Not graded
    quality
    D
    maintenance
    A local MCP server for tracking personal expenses using SQLite, enabling users to add, list, and summarize expenses via natural language.
    -
  • F
    license
    Not graded
    quality
    C
    maintenance
    An MCP server that enables any MCP-compatible client to add, list, and summarize expenses through natural conversation, using FastMCP and aiosqlite for async database operations.
    -
  • F
    license
    Not graded
    quality
    B
    maintenance
    A lightweight MCP server that lets LLM clients track, query, and summarize personal expenses using a local SQLite database.
    -

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/SAYOUNCDR/Expense-Tacker-MCP-Server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server