Skip to main content
Glama
Expense-Tracker-MCP-Server

Expense-Tracker-MCP-Server

Expense Tracker MCP Server

A simple Expense Tracker MCP (Model Context Protocol) server built with FastMCP and SQLite, designed to be used from Claude Desktop. Ask Claude in plain English to log, list, and summarize your expenses.

This repo is also my learning log for MCP: it documents how I built this server step by step, how I connected it to Claude Desktop, and how I tried out a few other community MCP servers (Manim, Weather).

Related MCP server: expense-mcp

✨ Features

Tools

Tool

What it does

add_expense

Add a new expense (date, amount, category, note)

list_expenses

View expenses within a date range

summarize

Summarize spending by category

Resources

Resource

What it returns

expense:///categories

Available expense categories and subcategories

Tool and resource names above follow the reference project. Adjust the table to match whatever is defined in main.py.


Tech Stack

  • Python 3.12+

  • FastMCP (tested with 3.4.4) and MCP (tested with 1.28.1)

  • SQLite for storage

  • uv for dependency and environment management

  • Claude Desktop as the MCP client

  • MCP Inspector (by Anthropic) for testing and debugging


Project Structure

Expense-Tracker-MCP-Server/
├── main.py          # FastMCP server: tools and resources
├── expenses_db      # SQLite database file
├── pyproject.toml   # Project metadata and dependencies (uv)
├── uv.lock          # Locked dependency versions
└── README.md

Getting Started

Prerequisites

1. Install uv

pip install uv

2. Create the project

mkdir expense-tracker-mcp-server
cd expense-tracker-mcp-server
uv init .

3. Add FastMCP

uv add fastmcp

4. Verify the installation

fastmcp version

Sample output:

FastMCP version: 3.4.4
MCP version:     1.28.1
Python version:  3.12.6
Platform:        Windows-11

5. Write the server

Create main.py with your FastMCP tools and resources for a clean async SQLite example using aiosqlite).


Run and Debug

Test with MCP Inspector (the quickest way to check that tools work before touching Claude):

uv run fastmcp dev main.py

Run the server directly:

uv run fastmcp run main.py

Connect to Claude Desktop

uv run fastmcp install claude-desktop main.py

Option B: Edit the config manually

  1. Open Claude Desktop → Settings → Developer → Edit Config

  2. This opens claude_desktop_config.json. Add your server under mcpServers:

{
  "mcpServers": {
    "expense-tracker": {
      "command": "uv",
      "args": [
        "run",
        "--with",
        "fastmcp",
        "fastmcp",
        "run",
        "/absolute/path/to/main.py"
      ]
    }
  }
}
  1. Fully quit and restart Claude Desktop. Do this after every config change or newly added MCP server.

Screenshots

Claude Desktop MCP config Expense tracker in action


Example Prompts

Once connected, try these in Claude Desktop:

Add an expense

Add an expense for a cab ride to Delhi last Sunday. The fare was ₹600.

List expenses

Show all expenses between 2026-06-01 and 2026-06-30.

Summarize

Summarize my expenses for June 2026 by category.

Expense Categories

The server supports categories such as:

Food · Transport · Housing · Utilities · Health · Education · Entertainment · Shopping · Travel · Business · Investments · Personal Care · Taxes · Miscellaneous


☁️ Deploying to FastMCP Cloud (Optional)

The local setup above only works on your machine. To make the server available remotely, you can deploy it to FastMCP Cloud, as done in expense-tracker-mcp-cloud.

Once deployed you get a remote endpoint like:

https://<your-project-name>.fastmcp.app/mcp

To use it from Claude Desktop, create a small local proxy (proxy.py):

from fastmcp import FastMCP

mcp = FastMCP.as_proxy(
    "https://<your-project-name>.fastmcp.app/mcp",  # get your URL from FastMCP Cloud
    name="Expense Tracker Proxy"
)

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

Then install it into Claude Desktop and restart:

uv run fastmcp install claude-desktop proxy.py

Other MCP Servers I Tried

While learning MCP I also set up a few community servers. Notes below for future me (and anyone else).

After adding any server, restart Claude Desktop.

Manim MCP Server (math animations)

Repo: abhiemj/manim-mcp-server

Setup

pip install manim
pip install mcp

cd ~/Desktop
git clone https://github.com/abhiemj/manim-mcp-server.git
cd manim-mcp-server

Find the paths you need

which python3        # path to your Python executable  -> "command"
which manim          # path to the manim executable    -> MANIM_EXECUTABLE
cd src && pwd        # folder containing manim_server.py

On Windows use where python and where manim instead of which.

Add to claude_desktop_config.json (Settings → Developer → Edit Config):

{
  "mcpServers": {
    "manim-server": {
      "command": "/absolute/path/to/python",
      "args": [
        "/absolute/path/to/manim-mcp-server/src/manim_server.py"
      ],
      "env": {
        "MANIM_EXECUTABLE": "/absolute/path/to/manim"
      }
    }
  }
}

Test prompt

Use the manim-server to create an animation showing the concept of vector
transformation in linear algebra.

- Start with a 2D coordinate grid.
- Show two basis vectors: i = (1,0) in red and j = (0,1) in blue.
- Animate a transformation by applying a matrix A = [[2,1],[1,1]] to the
  grid and the vectors.
- Show the grid warping and the basis vectors moving to their new
  transformed positions.
- Add a title above: 'Linear Algebra: Matrix Transformation Demo'.

Twitter / X MCP Server (local)

Repo: EnesCinr/twitter-mcp

Add this inside the mcpServers object of your Claude config:

{
  "mcpServers": {
    "twitter-mcp": {
      "command": "npx",
      "args": ["-y", "@enescinar/twitter-mcp"],
      "env": {
        "API_KEY": "your_api_key_here",
        "API_SECRET_KEY": "your_api_secret_key_here",
        "ACCESS_TOKEN": "your_access_token_here",
        "ACCESS_TOKEN_SECRET": "your_access_token_secret_here"
      }
    }
  }
}

You get the keys from the Twitter/X developer console.

Weather MCP Server (remote via uvx)

Repo: adhikasp/mcp-weather

Get a free API key from AccuWeather Developer, then add:

{
  "mcpServers": {
    "weather": {
      "command": "uvx",
      "args": [
        "--from",
        "git+https://github.com/adhikasp/mcp-weather.git",
        "mcp-weather"
      ],
      "env": {
        "ACCUWEATHER_API_KEY": "your_api_key_here"
      }
    }
  }
}

Finding more MCP servers

Browse the curated list: awesome-mcp-servers

Never commit real API keys. Keep them in your local config file only.


Troubleshooting

Problem

Fix

Server doesn't show up in Claude

Fully quit Claude Desktop (check the system tray) and reopen it

fastmcp command not found

Close and reopen VS Code / your terminal after installing

Config changes have no effect

Check the JSON is valid and paths are absolute

Not sure if the server works

Run uv run fastmcp dev main.py and test the tools in MCP Inspector first

Wrong Python or manim path

Re-run which python3 / which manim (or where on Windows)


What I Learned

  • FastMCP fundamentals: tools and resources

  • Building and debugging an MCP server with MCP Inspector

  • SQLite integration for persistent storage

  • Connecting MCP servers to Claude Desktop (via fastmcp install and manual config)

  • Setting up third-party MCP servers (Manim, Twitter/X, Weather)

  • Remote deployment and proxying with FastMCP Cloud


Credits


Available Tools

3 tools
add_expenseC

Add a new expense to DB

Inputs: date (required), amount (required), category (required), note, +1 more.

list_expensesA

Listing all expense entries between startdate to enddate

Inputs: enddate (required), startdate (required).

summarizeC

Summarize expenses by category for that date range.

Inputs: enddate (required), startdate (required), category.

Tool Schema Changelog

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

Loading tool schema changelog…

    TDQS

    B3.3/5.0

    Scored across 3 tools

    Disambiguation5/5

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

    Naming Consistency4/5

    add_expense and list_expenses follow a clear verb_noun pattern, though one uses singular and the other plural. summarize is readable but omits a noun object, creating a minor inconsistency.

    Tool Count5/5

    Three tools is a well-scoped set for a focused expense tracker. Each tool serves a distinct and necessary part of the basic workflow: recording, viewing, and summarizing expenses.

    Completeness3/5

    The core add/list/summarize workflow is covered, but there are no update or delete expense operations. This is a notable gap because users cannot correct or remove mistaken entries without direct database access.

    Maintenance

    ActivityMaintained
    ResponsivenessOutdated data

    Related MCP Connectors

    Related MCP Servers

    • F
      license
      Not graded
      quality
      D
      maintenance
      Enables users to track personal expenses through natural language interactions with comprehensive category support and financial summaries. Provides both local and remote MCP server options with SQLite storage for fast expense management operations.
      -
    • A
      license
      A
      quality
      D
      maintenance
      Personal expense tracker MCP server that enables tracking expenses, income, budgets, and savings goals through natural language.
      10
      29 PyPI
      1
      MIT
    • F
      license
      Not graded
      quality
      D
      maintenance
      MCP server for tracking expenses with local SQLite storage. Provides tools to add, list, and summarize expenses by category.
      -
    • A
      license
      B
      quality
      B
      maintenance
      Enables local tracking of personal expenses by adding, listing, summarizing, updating, and deleting expense records stored in a CSV file through an MCP client.
      5
      MIT