Expense Tracker MCP Server
Provides tools for managing personal expenses in a SQLite database, including adding expenses with categories and descriptions, retrieving total expenses, and listing all recorded expenses.
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 Server add my $45 lunch expense to food category"
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 using MCP (FastMCP + LangChain + Ollama)- Sample Project for understanding MCP
This project demonstrates a simple end-to-end MCP (Model Context Protocol) example where:
A FastMCP server exposes tools to manage expenses stored in SQLite
A LangChain client connects to the MCP server
An LLM (Llama 3.2 via Ollama) decides when to call tools
Natural language queries like
"Add my expense 500 to groceries" automatically trigger backend database operations
š Architecture Overview
User (CLI)
ā
ā¼
LangChain Client (client.py)
ā
ā MCP (stdio)
ā¼
FastMCP Server (main.py)
ā
ā¼
SQLite Database (expenses.db)Key Components
Component | Description |
FastMCP | Exposes database operations as tools |
LangChain MCP Adapter | Connects LLM to MCP tools |
Ollama (Llama 3.2:3b) | Interprets user intent and calls tools |
SQLite | Persistent expense storage |
Related MCP server: Expense Tracker MCP
š Project Structure
.
āāā main.py # FastMCP expense database server
āāā client.py # LangChain MCP client with LLM
āāā expenses.db # SQLite database (auto-created)
āāā README.mdš Features
ā Add expenses using natural language
ā View total expenses
ā List all expenses
ā Automatic tool selection by LLM
ā Persistent storage using SQLite
ā MCP-compliant architecture
š ļø Tools Exposed by MCP Server
The FastMCP server exposes the following tools:
add_expense
Adds a new expense entry.
{
"amount": 500,
"category": "groceries",
"description": "weekly shopping"
}get_total
Returns the total sum of all expenses.
get_all_expenses
Returns a list of all recorded expenses.
āļø Prerequisites
Make sure you have the following installed:
Python 3.10+
Ollama
Llama 3.2 model
uv (Python package runner)
ollama pull llama3.2:3bš¦ Install Dependencies
uv add fastmcp langchain langchain-mcp-adapters langchain-ollamaā¶ļø Running the Client
Update paths inside client.py:
"command": "/home/omkar/.local/bin/uv",
"args": [
"run",
"fastmcp",
"run",
"/full/path/to/main.py"
]Then run:
uv run client.pyš§ How It Works (Step-by-Step)
User enters a natural language query
LLM decides whether a tool is needed
If required:
Tool name + arguments are generated
LangChain invokes MCP tool
Result is returned to LLM
LLM generates final user-friendly respons
Just tell me š
Available Tools
3 toolsadd_expenseB
Add a new expense
Args: amount: Expense amount category: Expense category (e.g., 'food', 'transport', 'utilities') description: Optional description
Returns: ID of the added expense
Inputs: amount (required), category (required), description. Returns: result
get_all_expensesC
Get all expenses
Inputs: no named parameters. Returns: result
get_totalB
Get total of all expenses
Inputs: no named parameters. Returns: result
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
TDQS
Scored across 3 tools
Each tool has a distinct purpose: add_expense creates new records, get_all_expenses retrieves all records, and get_total calculates a sum. There is no overlap or ambiguity between these operations.
All tools follow a consistent verb_noun pattern (add_expense, get_all_expenses, get_total) with clear, descriptive names. The naming style is uniform throughout the set.
With only 3 tools, the set feels thin for an expense tracker domain. It lacks essential operations like updating or deleting expenses, viewing expenses by category or date, or filtering, which limits functionality.
The tool set is severely incomplete for expense tracking. It supports adding and viewing all expenses but misses critical operations such as update_expense, delete_expense, get_expense_by_id, and filtering by category or date, leaving significant gaps in the CRUD lifecycle.
Maintenance
Related MCP Connectors
Track expenses from your AI chat: log, categorize, monthly CSV reports. All data is local.
Expense ledger for AI assistants: record receipts line by line, ask what you spent, export anytime.
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 Manilo (formerly Ledgy) from any MCP-compatible AI assistant.
Related MCP Servers
- FlicenseCqualityDmaintenanceEnables personal expense management with SQLite storage, allowing users to add, update, delete, list, and summarize expenses by category through natural language interactions.5-
- FlicenseNot gradedqualityDmaintenanceEnables management of expenses via SQLite database, including adding, listing, updating, deleting, filtering, and summing expenses through natural language.-
- FlicenseNot gradedqualityDmaintenanceEnables natural language management of personal expenses, including adding, listing, and summarizing expenses with local SQLite storage.-
- FlicenseAqualityDmaintenanceEnables AI assistants to track, query, summarize, and delete personal expenses stored in a local SQLite database via natural language.4-