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 "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 Serveradd 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
| Name | Required | Description | Default |
|---|---|---|---|
| amount | Yes | ||
| category | Yes | ||
| description | No |
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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 this is a creation operation ('Add a new expense'), implying mutation, but doesn't address permissions, error conditions, validation rules, or side effects. The return value is mentioned but without details on format or potential failures. More behavioral context is needed for a mutation tool.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is well-structured and appropriately sized. It front-loads the core purpose ('Add a new expense') followed by clear sections for Args and Returns. Every sentence earns its place by providing essential information without redundancy or fluff.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's moderate complexity (3 parameters, mutation operation) and the presence of an output schema (implied by 'Returns: ID of the added expense'), the description is reasonably complete. It covers purpose, parameters, and return value. However, with no annotations and a mutation tool, it could benefit from more behavioral details like error handling or permissions.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The description adds significant semantic value beyond the input schema, which has 0% description coverage. It clarifies that 'amount' is the 'Expense amount', 'category' includes examples like 'food', 'transport', 'utilities', and 'description' is optional with a default. This compensates well for the schema's lack of descriptions, though it doesn't cover validation rules or constraints.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the tool's purpose with a specific verb ('Add') and resource ('expense'), making it immediately understandable. It distinguishes from sibling tools like 'get_all_expenses' and 'get_total' by focusing on creation rather than retrieval or aggregation. However, it doesn't explicitly contrast with siblings in the description text itself.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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. It doesn't mention sibling tools like 'get_all_expenses' or 'get_total', nor does it specify prerequisites, constraints, or appropriate contexts for expense creation. The user must infer usage from the purpose alone.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_all_expensesC
Get all expenses
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?
No annotations are provided, so the description carries the full burden of behavioral disclosure. 'Get all expenses' implies a read operation but doesn't specify whether this is paginated, filtered, sorted, or includes metadata. It lacks details on permissions, rate limits, response format, or any side effects. For a tool with zero annotation coverage, this is insufficient behavioral context.
Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is extremely concise ('Get all expenses') but borders on under-specification rather than efficient brevity. While it uses minimal words, it fails to provide necessary context that would help an agent. The structure is simple but lacks front-loading of critical information beyond the basic action.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool has 0 parameters, 100% schema coverage, and an output schema exists, the description's job is reduced. However, for a 'get all' operation with sibling tools present, the description should ideally clarify scope and differentiation. While the output schema will handle return values, the description remains incomplete regarding when and how to use this tool versus alternatives.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has 0 parameters with 100% schema description coverage (empty schema), so no parameter documentation is needed. The description doesn't add parameter semantics because there are none to describe, which is appropriate. Baseline score of 4 applies since the schema fully covers the parameter requirements (none).
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description 'Get all expenses' is a tautology that essentially restates the tool name 'get_all_expenses'. While it does specify the verb 'Get' and resource 'expenses', it lacks any differentiation from sibling tools like 'get_total' or specificity about what 'all' entails. This is minimal information that doesn't add meaningful clarity beyond the name itself.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
Does the description explain when to use this tool, when not to, or what alternatives exist?
No guidance is provided on when to use this tool versus alternatives. The description doesn't mention sibling tools like 'get_total' (which presumably provides aggregated expense data) or 'add_expense' (for creating expenses), nor does it specify any contextual prerequisites or exclusions. The agent receives no direction on appropriate usage scenarios.
Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.
get_totalB
Get total of all expenses
| Name | Required | Description | Default |
|---|---|---|---|
No parameters | |||
Output Schema
| Name | Required | Description |
|---|---|---|
| result | Yes |
TDQS
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 what the tool does but reveals nothing about how it works: no indication of data freshness, calculation method, error conditions, or response format. For a 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.
Is the description appropriately sized, front-loaded, and free of redundancy?
The description is a single, efficient sentence that communicates the core purpose without any fluff. It's appropriately sized for a simple tool with no parameters. Every word earns its place, and the structure is front-loaded with essential information.
Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.
Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?
Given the tool's simplicity (0 parameters, has output schema), the description is minimally adequate. The output schema will handle return value documentation, reducing the description's burden. However, for a tool with no annotations, it should ideally provide more behavioral context about calculation method or data scope to reach completeness.
Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.
Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?
The tool has zero parameters with 100% schema description coverage, so the schema already fully documents the parameter situation. The description appropriately doesn't waste space discussing non-existent parameters. Baseline for zero parameters is 4, as there's nothing to compensate for and no misleading information.
Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.
Does the description clearly state what the tool does and how it differs from similar tools?
The description clearly states the verb ('Get') and resource ('total of all expenses'), making the purpose immediately understandable. It distinguishes from sibling 'get_all_expenses' by focusing on the aggregated total rather than individual items. However, it doesn't specify the exact scope (e.g., time period, categories) which prevents a perfect score.
Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.
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 'get_all_expenses'. It doesn't mention scenarios where a summary total is preferred over detailed listings, nor does it indicate any prerequisites or constraints for usage. The agent must infer usage context from the tool name alone.
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. Dates show when Glama detected each change.
3 tool updates
- First observed
add_expense - First observed
get_all_expenses - First observed
get_total
TDQS
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
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
- ManiloOAuthapp.manilo
Log, query, and edit expenses, budgets, and accounts in Manilo from any MCP-compatible AI assistant.
- ManiloOAuthapp.ledgy.api
Log, query, and edit expenses, budgets, and accounts in Manilo (formerly Ledgy) from any MCP-compatible AI assistant.
Log expenses, receipts and mileage from chat: auto-categorise, split VAT, summarise, export, rebill.
Log, query, and edit expenses, budgets, and accounts in 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.-
- FlicenseAqualityBmaintenanceEnables AI assistants to track, query, summarize, and delete personal expenses stored in a local SQLite database via natural language.4-
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/Omkar4141/dbserver_mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server