Expense Tracker MCP Server
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@Expense Tracker MCP ServerHow much did I spend on food this month?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Expense Tracker MCP Server
A Model Context Protocol (MCP) server that lets Claude track, list, and summarize personal expenses through natural conversation — no spreadsheet or app UI required. Built with FastMCP, backed by SQLite, and deployable both locally and to FastMCP Cloud.
Why this project
MCP is how LLMs like Claude connect to real tools and data sources instead of just generating text. This project implements a complete, working MCP server end-to-end: tool definitions, a structured resource, an async database layer, and a client-connection story — from local stdio transport all the way to a cloud-hosted HTTP deployment proxied back into Claude Desktop.
Related MCP server: Expense Tracker MCP Server
What it does
Once connected, Claude can:
Log an expense — "I spent ₹450 on groceries today" → written to the database with date, amount, category, subcategory, and note
List expenses — "What did I spend last week?" → returns every expense in a date range
Summarize spending — "How much did I spend on food this month?" → aggregates total amount and count per category over a date range
Discover valid categories — Claude reads a structured category resource to know what categories/subcategories are valid before logging an expense, rather than guessing
MCP Components
Tools (main.py)
Tool | Description |
| Inserts a new expense row; returns the new row's ID or a structured error |
| Returns all expenses in an inclusive date range, most recent first |
| Returns total amount and count per category in a date range, optionally filtered to one category |
Resource
expense:///categories— exposescategories.json, a structured taxonomy of 20 top-level categories (food, transport, housing, utilities, health, education, family & kids, entertainment, shopping, subscriptions, personal care, gifts & donations, finance fees, business, travel, home, pet, taxes, investments, misc), each with realistic subcategories. Falls back to a sensible default category list if the file isn't found.
Data layer
SQLite database (
expenses.db), withWALjournal mode for better concurrent read/write behaviorSynchronous
sqlite3used once at startup to initialize the schema and verify write access; all runtime tool calls useaiosqlitefor non-blocking async I/ODatabase path resolved via the system temp directory, making the server safe to run in ephemeral/cloud filesystem environments
Transport & Deployment (proxy.py)
The server runs over Streamable HTTP when deployed (
mcp.run(transport="http", ...))A separate proxy (
proxy.py) wraps the deployed FastMCP Cloud endpoint and re-exposes it over STDIO, which is the transport Claude Desktop expects for local MCP connections — bridging a cloud-hosted server into a local desktop client
Architecture
flowchart LR
subgraph Local["Local Machine"]
CD[Claude Desktop] -->|STDIO| PX["proxy.py<br/>FastMCP.as_proxy"]
end
PX -->|Streamable HTTP| Cloud
subgraph Cloud["FastMCP Cloud"]
SRV["main.py<br/>FastMCP Server"]
SRV --> T1[add_expense]
SRV --> T2[list_expenses]
SRV --> T3[summarize]
SRV --> R1["expense:///categories<br/>resource"]
end
T1 --> DB[(SQLite<br/>expenses.db<br/>WAL mode)]
T2 --> DB
T3 --> DB
R1 --> CAT[categories.json]Tech Stack
Layer | Technology |
Protocol | Model Context Protocol (MCP) |
Server framework | FastMCP |
Database | SQLite, |
Transport | Streamable HTTP (cloud), STDIO (local proxy → Claude Desktop) |
Deployment | FastMCP Cloud |
Package management |
|
Language | Python 3.11+ |
Getting Started
Prerequisites
Python 3.11+
uvfor dependency managementClaude Desktop (to connect via the local proxy)
Installation
git clone <your-repo-url>
cd <repo-name>
uv syncRun the server locally
uv run main.pyThe server starts on http://0.0.0.0:8000 using Streamable HTTP transport, and initializes the SQLite schema on first run.
Connect Claude Desktop via the proxy
Add the proxy to your Claude Desktop MCP config (claude_desktop_config.json):
{
"mcpServers": {
"expense-tracker": {
"command": "uv",
"args": ["run", "python", "proxy.py"]
}
}
}The proxy connects to the deployed FastMCP Cloud endpoint over Streamable HTTP and re-exposes it to Claude Desktop over STDIO — restart Claude Desktop after adding the config.
Deploying your own instance
Push the repo to a Git provider
Deploy
main.pyon FastMCP Cloud (or any host that can run a Streamable HTTP server)Update the URL in
proxy.pyto point to your deployed endpoint
Project Structure
.
├── main.py # MCP server: tools, resource, DB init
├── proxy.py # STDIO proxy → deployed FastMCP Cloud server
├── categories.json # Expense category/subcategory taxonomy
├── expenses.db # SQLite database (created/used at runtime)
├── pyproject.toml # Project metadata + dependencies (uv)
├── uv.lock # Locked dependency versions
└── .python-version # Pinned Python versionDesign Notes
Sync init, async runtime. Schema creation and a write-access check happen synchronously once at startup (fail fast, fail loud); all subsequent tool calls are fully async so the server doesn't block under concurrent requests.
Resource-driven category discovery. Rather than hardcoding categories into the tool schema, Claude is expected to read the
expense:///categoriesresource first — keeping category logic in one editable JSON file instead of scattered across tool code.Cloud-safe file paths. Using the system temp directory for the database avoids permission issues on read-only or ephemeral cloud filesystems.
License
Add a license of your choice (e.g., MIT).
This server cannot be installed
Maintenance
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
Hosted MCP server connecting claude.ai, ChatGPT and other AI apps to your own computer
An MCP server that provides read access to your cloud storage providers, bank accounts and more.
- ManiloOAuthapp.manilo
Log, query, and edit expenses, budgets, and accounts in Manilo from any MCP-compatible AI assistant.
Hosted MCP server for LLM cost estimation, model comparison, and budget-aware routing.
Related MCP Servers
- FlicenseBqualityDmaintenanceMCP server for tracking personal expenses using FastMCP and SQLite, enabling adding, listing, updating, deleting expenses and summarizing by category via natural language tools.51-
- FlicenseNot gradedqualityDmaintenanceA 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.-
- FlicenseNot gradedqualityCmaintenanceAn MCP server that lets you log and query your own spending through natural conversation with Claude, instead of a spreadsheet or app.6-
- FlicenseNot gradedqualityBmaintenanceA lightweight MCP server that lets LLM clients track, query, and summarize personal expenses using a local SQLite database.-