Skip to main content
Glama
Sudhanvaha

Expense Tracker MCP Server

by Sudhanvaha

Expense Tracker MCP Server

A Model Context Protocol (MCP) server for tracking personal expenses with SQLite database storage. This server integrates with Claude Desktop to provide expense management capabilities through natural language.

Features

  • ✅ Add, update, and delete expenses

  • ✅ List expenses by date range

  • ✅ Summarize expenses by category

  • ✅ Flexible deletion by multiple criteria

  • ✅ Predefined expense categories

  • ✅ SQLite database for persistent storage

  • ✅ Local and remote deployment options

Related MCP server: ExpenseTracker MCP Server

Quick Start Options

Choose the setup method that works best for you:

Option 1: Direct Remote Server (Instant Setup - Claude Pro Only)

⚠️ Requires Claude Pro subscription - Direct URL connections are a Pro feature.

Connect directly to the deployed remote server without any local setup:

  1. Open Claude Desktop configuration file:

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

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

    • Linux: ~/.config/Claude/claude_desktop_config.json

  2. Add this configuration:

{
  "mcpServers": {
    "expense-tracker": {
      "url": "https://boiling-aqua-trout.fastmcp.app/mcp"
    }
  }
}
  1. Restart Claude Desktop

  2. Start tracking expenses immediately! 🎉

Note: This remote server is hosted on FastMCP Cloud. Your data is stored on the remote server.

Don't have Claude Pro? Use Option 2 below to connect via a local proxy server!


Option 2: Local Proxy to Remote Server (For Free Users & Customization)

✅ Works with Claude Free plan! Run a local MCP server that proxies requests to the remote server. This is the way to access remote MCP servers if you don't have Claude Pro.

Use cases:

  • Connect to remote servers on Claude Free plan

  • Add custom logging or middleware

  • Run locally while using remote data

  • Extend functionality with additional features

Setup Steps:

  1. Install uv (if not already installed):

Windows (PowerShell):

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

macOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh
  1. Create a new project:

mkdir expense-tracker-proxy
cd expense-tracker-proxy
uv init .
  1. Install FastMCP:

uv add fastmcp
  1. Create proxy server (main.py):

from fastmcp import FastMCP

mcp = FastMCP.as_proxy(
    "https://boiling-aqua-trout.fastmcp.app/mcp",
    name="expense tracker remote proxy server"
)

if __name__ == "__main__":
    mcp.run()
  1. Configure Claude Desktop:

{
  "mcpServers": {
    "expense-tracker-proxy": {
      "command": "uv",
      "args": [
        "--directory",
        "C:/Users/YOUR_USERNAME/path/to/expense-tracker-proxy",
        "run",
        "main.py"
      ]
    }
  }
}

Important: Replace the path with your actual project directory.

  1. Restart Claude Desktop

Benefits of Proxy Approach:

  • Add custom logging or middleware

  • Modify requests/responses before forwarding

  • Run locally but leverage remote infrastructure

  • Easy to extend with additional features


Option 3: Full Local Installation (Complete Control & Privacy)

For those who want full control, privacy, and the ability to modify the core server logic.

Prerequisites

  • Python 3.10 or higher

  • uv package manager

  • Claude Desktop app

Installation

1. Install uv

Windows (PowerShell):

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

macOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

2. Clone or Create Project

# Clone this repository
git clone https://github.com/Sudhanvaha/expense-tracker-mcp-server.git
cd expense-tracker-mcp-server

# OR create from scratch
mkdir expense-tracker-mcp-server
cd expense-tracker-mcp-server
uv init .

3. Install Dependencies

# Install required packages
uv add fastmcp

4. Create the Server

Copy the full main.py code from this repository into your project.

5. Test the Server

# Run the server
uv run main.py

6. Configure Claude Desktop for Local Server

  1. Open Claude Desktop configuration file (locations mentioned above)

  2. Add the MCP server configuration:

{
  "mcpServers": {
    "expense-tracker-local": {
      "command": "uv",
      "args": [
        "--directory",
        "C:/Users/YOUR_USERNAME/path/to/expense-tracker-mcp-server",
        "run",
        "main.py"
      ]
    }
  }
}

Important: Replace the path with your actual project directory path.

  1. Restart Claude Desktop


Usage

Once configured (via any method), you can interact with the expense tracker through Claude using natural language:

Add Expense

"Add an expense: $50 for groceries on 2024-12-14"
"Log $25.50 spent on transport today with note 'Uber to office'"

List Expenses

"Show me all expenses from December 1 to December 14, 2024"
"List my expenses for last week"

Update Expense

"Update expense ID 5 to $75"
"Change the category of expense 3 to 'entertainment'"

Delete Expense

"Delete expense with ID 5"
"Remove all food expenses from last week"
"Delete expenses in the transport category"

Summarize Expenses

"Summarize my expenses by category for December 2024"
"What's my total spending on food this month?"

View Categories

"What expense categories are available?"
"Show me the list of categories"

Available Tools

add_expense

Add a new expense to the tracker.

Parameters:

  • date (string): Date in YYYY-MM-DD format

  • amount (float): Expense amount

  • category (string): Expense category

  • subcategory (string, optional): Subcategory

  • note (string, optional): Additional notes

list_expenses

List all expenses within a date range.

Parameters:

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

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

update_expense

Update an existing expense (only provided fields will be updated).

Parameters:

  • cid (int): Expense ID to update

  • date (string, optional): New date

  • amount (float, optional): New amount

  • category (string, optional): New category

  • subcategory (string, optional): New subcategory

  • note (string, optional): New note

delete_expense

Delete expenses based on various criteria.

Parameters:

  • id (int, optional): Delete by ID

  • date (string, optional): Delete by date

  • category (string, optional): Delete by category

  • subcategory (string, optional): Delete by subcategory

  • amount (float, optional): Delete by amount

  • note (string, optional): Delete by note

  • start_date & end_date (strings, optional): Delete by date range

summarize_expenses

Get expense summaries grouped by category.

Parameters:

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

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

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

Available Resources

expense://categories

Returns the list of available expense categories in JSON format.

Database Schema

CREATE TABLE expenses (
    id INTEGER PRIMARY KEY AUTOINCREMENT,
    date TEXT NOT NULL,
    amount REAL NOT NULL,
    category TEXT NOT NULL,
    subcategory TEXT DEFAULT '',
    note TEXT DEFAULT ''
);

File Structure

For Full Local Installation:

expense-tracker-mcp-server/
├── main.py              # MCP server code
├── expense.db           # SQLite database (auto-created)
├── categories.json      # Categories list (auto-created)
├── pyproject.toml       # uv project configuration
└── README.md            # This file

For Proxy Setup:

expense-tracker-proxy/
├── main.py              # Proxy server code (5 lines!)
└── pyproject.toml       # uv project configuration

Default Categories

The server comes with these default categories:

  • food

  • transport

  • entertainment

  • utilities

  • healthcare

You can modify categories.json to add or remove categories (local installation only).

Deployment Options Comparison

Feature

Direct Remote (Pro)

Local Proxy (Free/Pro)

Full Local

Claude Plan

Pro only

Free & Pro

Free & Pro

Setup Time

2 minutes

5 minutes

15-20 minutes

Privacy

Remote storage

Remote storage

Complete privacy

Customization

None

Middleware only

Full control

Maintenance

Zero

Minimal

Manual updates

Internet Required

Yes

Yes

No

Code Required

No

5 lines

Full codebase

Cost

Pro subscription

Free

Free

Troubleshooting

Server not appearing in Claude Desktop

  1. Check the configuration file path is correct

  2. Ensure the command path points to your project directory (for local/proxy setup)

  3. Verify the remote URL is correct (for direct remote setup)

  4. Restart Claude Desktop completely

  5. Check Claude Desktop logs for errors

Remote Server Issues

If the remote server isn't responding:

  1. Check your internet connection

  2. Verify the URL: https://boiling-aqua-trout.fastmcp.app/mcp

  3. Try removing and re-adding the configuration

  4. Contact me via GitHub issues if the problem persists

Proxy Server Issues

If the proxy isn't working:

  1. Test the proxy server independently: uv run main.py

  2. Check if the remote URL is accessible

  3. Verify your FastMCP installation: uv add fastmcp

  4. Check Claude Desktop configuration paths

Database errors (Local Installation Only)

If you encounter database errors:

# Delete the database to reset
rm expense.db

# Restart the server to recreate the database
uv run main.py

Import errors

# Reinstall dependencies
uv sync

Development

Extending the Proxy Server

You can add custom logic to the proxy server:

from fastmcp import FastMCP

mcp = FastMCP.as_proxy(
    "https://boiling-aqua-trout.fastmcp.app/mcp",
    name="expense tracker remote proxy server"
)

# Add custom logging
@mcp.tool()
def log_expense_activity():
    """Log all expense activities"""
    # Your custom logging logic here
    pass

if __name__ == "__main__":
    mcp.run()

Modifying the Full Server

To modify the server:

  1. Edit main.py

  2. Test changes: uv run main.py

  3. Restart Claude Desktop to load changes

Deploying Your Own Remote Server

Want to deploy your own version on FastMCP Cloud?

  1. Sign up at FastMCP Cloud

  2. Follow their deployment instructions

  3. Update the URL in your Claude Desktop configuration or proxy code

  4. Share your server URL with others!

Contributing

Contributions are welcome! Feel free to submit issues or pull requests.

Roadmap

  • Add budget tracking and alerts

  • Support for multiple currencies

  • Recurring expense templates

  • Export to CSV/Excel

  • Data visualization and charts

  • Multi-user support with authentication

  • Authentication for remote server access

Support

For issues related to:

Acknowledgments

Built with:


⭐ If you find this project helpful, please consider giving it a star on GitHub!

📧 Questions? Open an issue or reach out on LinkedIn

Available Tools

5 tools
add_expenseD
ParametersJSON Schema
NameRequiredDescriptionDefault
dateYes
amountYes
categoryYes
subcategoryNo
noteNo

TDQS

D1/5.0
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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?

Tool has no description.

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?

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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

deleteC

Delete expenses based on any column criteria. like id,date,category,subcategory,amount,note,start_date,end_date

ParametersJSON Schema
NameRequiredDescriptionDefault
idNo
dateNo
categoryNo
subcategoryNo
amountNo
noteNo
start_dateNo
end_dateNo

Output Schema

ParametersJSON Schema
NameRequiredDescription

No output parameters

TDQS

C2.4/5.0
Behavior2/5

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

No annotations are provided, so the description carries full burden. It states this is a deletion operation but doesn't disclose critical behavioral traits: whether deletions are permanent or reversible, if there are confirmation prompts, what permissions are required, or what happens when multiple criteria match multiple records. The description is insufficient for a destructive operation with zero annotation coverage.

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?

Two sentences with no wasted words, but the second sentence is poorly formatted ('like' instead of 'e.g.' or 'such as') and reads as a continuation rather than proper structure. The information is front-loaded but could be more professionally presented.

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?

This is a destructive mutation tool with 8 parameters, 0% schema description coverage, no annotations, but has an output schema. The description fails to address critical context: deletion permanence, criteria logic, error conditions, or relationship to sibling tools. For a tool with this complexity and risk profile, the description is inadequate.

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 lists parameter names but doesn't explain their semantics: what format dates should use, whether 'amount' is exact match or range, how criteria combine (AND/OR), or what happens when no criteria are specified. The list adds minimal value beyond the schema's property names.

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

Purpose3/5

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

The description states 'Delete expenses based on any column criteria' which provides a clear verb ('Delete') and resource ('expenses'), but it doesn't differentiate from sibling tools like 'update' which also modifies expenses. The purpose is understandable but lacks sibling differentiation.

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 alternatives like 'update' or 'list_expenses'. The description mentions column criteria but doesn't explain prerequisites, constraints, or when this deletion is appropriate versus other operations.

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

list_expensesC

list all expenses within an inclusive date range

ParametersJSON Schema
NameRequiredDescriptionDefault
start_dateYes
end_dateYes

TDQS

C2.8/5.0
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. It states it's a list operation (implying read-only) and specifies date-range filtering, but doesn't mention pagination, sorting, authentication requirements, rate limits, error conditions, or what the return format looks like. For a list tool with zero annotation coverage, this leaves significant behavioral gaps.

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, efficient sentence with zero wasted words. It's front-loaded with the core action ('list all expenses') followed by the key constraint ('within an inclusive date range'). Every word serves a purpose.

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 description coverage, the description is incomplete. It doesn't explain what an 'expense' object contains, how results are structured, whether there are limits on date ranges, or how to handle large result sets. For a list tool with two required parameters, more context is needed for effective use.

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% (parameters have only titles), so the description must compensate. It mentions 'inclusive date range' which implies the two parameters are date boundaries, but doesn't specify date format (ISO, timestamp, etc.), timezone handling, or whether dates are inclusive/exclusive. The description adds minimal semantic context beyond what's inferable from parameter names.

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 verb 'list' and resource 'expenses', specifying the scope as 'within an inclusive date range'. It distinguishes from siblings like 'add_expense' (create) and 'update' (modify), but doesn't explicitly differentiate from 'summarize' which might also involve expense data. The purpose is specific and unambiguous.

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 like 'summarize' (which might provide aggregated data) or other siblings. It doesn't mention prerequisites, exclusions, or typical use cases. The agent must infer usage from the tool name and description alone.

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

summarizeD
ParametersJSON Schema
NameRequiredDescriptionDefault
start_dateYes
end_dateYes
categoryNo

TDQS

D1/5.0
Behavior1/5

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

Tool has no description.

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

Conciseness1/5

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

Tool has no description.

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?

Tool has no description.

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?

Tool has no description.

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

Purpose1/5

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

Tool has no description.

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

Usage Guidelines1/5

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

Tool has no description.

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

updateB

Update an expense.Only provided fields will be updated.

ParametersJSON Schema
NameRequiredDescriptionDefault
cidYes
dateNo
amountNo
categoryNo
subcategoryNo
noteNo

Output Schema

ParametersJSON Schema
NameRequiredDescription
resultYes

TDQS

B3.1/5.0
Behavior2/5

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

With no annotations provided, the description carries full burden for behavioral disclosure. While it mentions 'Only provided fields will be updated' (partial update behavior), it doesn't address important aspects like required permissions, whether updates are reversible, error conditions, or what happens when invalid data is provided. For a mutation tool with zero annotation coverage, this is insufficient.

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 extremely concise - just two sentences that communicate the core functionality and a key behavioral aspect. Every word earns its place with zero redundancy or unnecessary elaboration.

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?

Given this is a mutation tool with no annotations, 6 parameters (only 1 documented via description), but with an output schema present, the description is minimally adequate. The presence of an output schema means return values are documented elsewhere, but the description should do more to explain the mutation's behavior and parameter meanings.

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 description adds some value by explaining the partial update behavior ('Only provided fields will be updated'), which helps interpret the null-able parameters in the schema. However, with 0% schema description coverage and 6 parameters, it doesn't explain what 'cid', 'date', 'amount', 'category', 'subcategory', or 'note' represent or their expected formats.

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 resource ('an expense'), making the purpose immediately understandable. However, it doesn't differentiate from the 'delete' sibling tool or explain what distinguishes this update operation from other potential expense modifications.

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 like 'add_expense' or 'delete'. There's no mention of prerequisites, constraints, or appropriate contexts for expense updates versus other operations.

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. 5 tool updates
    • First observedadd_expense
    • First observeddelete
    • First observedlist_expenses
    • First observedsummarize
    • First observedupdate

TDQS

C2.4/5.0

Scored across 5 tools

Disambiguation4/5

Most tools have distinct purposes: add_expense, list_expenses, and update are clearly differentiated. However, 'summarize' lacks a description, which could cause confusion about its exact function relative to list_expenses, potentially leading to misselection if it overlaps in providing expense overviews.

Naming Consistency3/5

The naming is mixed: add_expense, list_expenses, and summarize follow a verb_noun pattern, but 'delete' and 'update' are standalone verbs without nouns, breaking consistency. This deviation makes the set less predictable, though the names are still readable overall.

Tool Count5/5

With 5 tools, the count is well-scoped for an expense tracker server, covering core operations like adding, listing, updating, deleting, and summarizing expenses. Each tool earns its place without feeling excessive or insufficient for the domain.

Completeness4/5

The toolset provides good CRUD coverage with add, list, update, and delete, along with a summarize function for analytics. A minor gap exists in the lack of descriptions for add_expense and summarize, which could hinder agent understanding, but core lifecycle operations are present and workable.

Maintenance

ActivityInactive
ResponsivenessNo issues

Related MCP Connectors

Related MCP Servers

  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to manage personal expenses through natural conversation, supporting expense tracking, categorization, filtering, and financial summaries. Uses SQLite database to store expense records with full CRUD operations for comprehensive personal finance management.
    2
    -
  • A
    license
    Not graded
    quality
    D
    maintenance
    Enables AI assistants to manage personal expenses by adding, querying, and summarizing expense data through a SQLite database and configurable categories.
    1
    GPL 3.0
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables management of expenses via SQLite database, including adding, listing, updating, deleting, filtering, and summing expenses through natural language.
    -
  • F
    license
    Not graded
    quality
    D
    maintenance
    Enables natural language management of personal expenses, including adding, listing, and summarizing expenses with local SQLite storage.
    -