Expense Tracker MCP Server
Click on "Deploy 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 ServerAdd ₹500 for groceries"
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 simple MCP (Model Context Protocol) server that lets an AI assistant (like Claude) add, list, and summarize your personal expenses — backed by a persistent Turso (libSQL) database, deployed on Render.
Instead of manually opening a spreadsheet, you can just tell your AI assistant things like "Add ₹500 for food" or "Show my expenses this month", and it calls this server to actually store and fetch the data.
What is MCP?
MCP (Model Context Protocol) is an open standard that lets AI assistants call external tools over a common interface. An MCP server exposes a set of tools (functions) that the assistant can invoke, with typed inputs and structured outputs.
In this project:
The assistant "sees" three tools:
add_expense,list_expenses,summarize.When you ask something in plain language, the assistant picks the right tool, fills in the parameters, and calls this server.
This server runs the actual database logic and returns a structured JSON result back to the assistant.
This means the assistant doesn't need to know how the database works — it just needs to know what tools are available and what they do.
Related MCP server: Expense Tracker MCP Server
What this server does
Built with FastMCP (a Python framework for building MCP servers) and Turso (a hosted libSQL/SQLite database) for storage.
Tools
Tool | Purpose | Parameters |
| Adds a new expense entry |
|
| Lists all expenses in a date range |
|
| Totals and counts expenses per category in a date range |
|
Resource
expense:///categories— returns the list of available expense categories as JSON (read fromcategories.json, falling back to a default list if missing).
Data stored per expense
id— auto-incrementing primary keydate— expense dateamount— expense amountcategory— e.g. Food, Travel, Personal Caresubcategory— optional finer detail (e.g. "Haircut")note— optional free-text note
How it works, step by step
Database: On first use, the server connects to a Turso database and creates the
expensestable if it doesn't already exist.Adding an expense: The
add_expensetool inserts a row into theexpensestable and returns the new row's ID.Listing expenses: The
list_expensestool queries all rows between two dates (inclusive), most recent first.Summarizing: The
summarizetool groups expenses by category within a date range, returning the total amount and entry count per category (optionally filtered to a single category).Serving over HTTP: The server runs with
mcp.run(transport="http", ...), binding to the port Render provides via thePORTenvironment variable (defaults to8000locally).
Project structure
expense-tracker-mcp-server/
├── main.py # Server entry point — defines the MCP tools and resource
├── categories.json # Default list of expense categories
├── pyproject.toml # Project metadata and dependencies
├── requirements.txt # Pip-installable dependency list
├── uv.lock # Locked dependency versions (uv package manager)
└── src/ # Additional source filesSetup
1. Prerequisites
2. Clone the repo
git clone https://github.com/Digam-hue/expense-tracker-mcp-server.git
cd expense-tracker-mcp-server3. Set environment variables
Create a .env file or export these directly:
export TURSO_DATABASE_URL="libsql://<your-db>.turso.io"
export TURSO_AUTH_TOKEN="<your-auth-token>"These are required — the server will refuse to start without them.
4. Install dependencies
uv sync
# or
pip install -r requirements.txt5. Run locally
python main.pyBy default it serves on http://0.0.0.0:8000.
6. Deploy (this project uses Render)
Push the repo to GitHub.
Create a new Web Service on Render, pointing at this repo.
Add
TURSO_DATABASE_URLandTURSO_AUTH_TOKENas environment variables in Render's dashboard.Render automatically sets
PORT; no changes needed for that.
Connecting it to an AI assistant
Once deployed, add the server's URL (e.g. https://your-app.onrender.com/mcp) as an MCP connector in your assistant's settings. Once connected, you can just talk naturally:
"Add ₹500 for food"
"Show my expenses this month"
"Summarize spending by category"
The assistant will call add_expense, list_expenses, or summarize accordingly and show you the result.
Notes
All amounts are stored as-is with no currency conversion — pick one currency and stick to it.
Categories are freeform strings;
categories.jsonis just a suggested list, not an enforced schema.The database client is created lazily on first request (inside the server's event loop) to avoid async setup issues at import time.
This server cannot be deployed
Maintenance
Related MCP Connectors
Track expenses from your AI chat: log, categorize, monthly CSV reports. All data is local.
- Era ContextOAuthapp.era
Personal finance, bank account, and shared memory connector for Claude, ChatGPT, Gemini Spark & more
- ManiloOAuthapp.manilo
Log, query, and edit expenses, budgets, and accounts in Manilo from any MCP-compatible AI assistant.
Log, query, and edit expenses, budgets, and accounts in Ledgy from any MCP-compatible AI assistant.
Related MCP Servers
- AlicenseNot gradedqualityFmaintenanceEnables AI agents to manage personal expenses through natural language conversations. Supports adding, searching, and analyzing transactions with automatic categorization and financial insights.3MIT
- FlicenseNot gradedqualityDmaintenanceEnables 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-
- FlicenseCqualityDmaintenanceEnables AI assistants to manage personal finances by storing, analyzing, and exporting expense data using a persistent PostgreSQL database. Supports adding/editing expenses, generating spending summaries, detecting top categories, and creating monthly reports.12-
- AlicenseNot gradedqualityDmaintenanceEnables AI assistants to manage personal expenses by adding, querying, and summarizing expense data through a SQLite database and configurable categories.1GPL 3.0