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 ServerAdd โน500 for dinner today."
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 local Expense Tracker MCP Server built with Python, FastMCP, and SQLite.
This project allows an MCP-compatible AI client such as Claude Desktop to interact with a local expense database using natural language.
For example:
"Add โน500 for dinner today."
"How much have I spent?"
"Give me a summary of my expenses."
"Show me my biggest expenses."
The AI client communicates with the FastMCP server, which executes the appropriate tools and interacts with the local SQLite database.
๐ Project Overview
Architecture
โโโโโโโโโโโโโโโโโโโโโโโโ
โ MCP Client โ
โ Claude Desktop โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โ MCP Protocol
โผ
โโโโโโโโโโโโโโโโโโโโโโโโ
โ Expense Tracker โ
โ MCP Server โ
โ FastMCP โ
โโโโโโโโโโโโฌโโโโโโโโโโโโ
โ
โโโโโโโโโโโโโโผโโโโโโโโโโโโโ
โ โ โ
โผ โผ โผ
MCP Tools MCP Resources Prompts
โ
โผ
โโโโโโโโโโโโโโโโโ
โ SQLite โ
โ expenses.db โ
โโโโโโโโโโโโโโโโโ๐ ๏ธ Technologies Used
Python
FastMCP
SQLite
uv
Claude Desktop
MCP (Model Context Protocol)
๐ Project Structure
expense-tracker/
โ
โโโ server.py
โโโ expenses.db
โโโ pyproject.toml
โโโ .python-version
โโโ README.md
โโโ .gitignoreserver.py
Contains the MCP server, database initialization, and MCP tools.
expenses.db
Local SQLite database containing all expense records.
pyproject.toml
Contains project metadata and dependencies.
README.md
Project documentation.
๐ Installation
Related MCP server: Expense Tracker MCP Server
1. Install uv
Install uv if it is not already installed.
Verify the installation:
uv --versionYou should see the installed version of uv.
๐ 2. Create the Project
Create a folder for the project:
mkdir expense-tracker
cd expense-trackerOpen it in VS Code:
code .๐ 3. Initialize the Python Project
Run:
uv initThis creates the Python project configuration.
๐ฆ 4. Install FastMCP
Install FastMCP using:
uv add fastmcpFastMCP is used to create and expose the MCP server and its tools.
๐๏ธ 5. SQLite Database
This project uses SQLite because the expense tracker is designed to run locally.
The database is automatically created when the server starts.
The database contains an expenses table.
Example structure:
expenses
โ
โโโ id
โโโ date
โโโ amount
โโโ category
โโโ subcategory
โโโ note
โโโ payment_method
โโโ currency
โโโ created_atExample record:
ID: 1
Date: 2026-08-22
Amount: 500
Category: Food
Subcategory: Dinner
Note: Dinner with friends
Payment Method: UPI
Currency: INR๐ง 6. MCP Server
The MCP server is created using FastMCP.
Basic structure:
from fastmcp import FastMCP
mcp = FastMCP("Expense Tracker")The server acts as the bridge between the AI client and the local expense database.
๐ง 7. MCP Tools
The server exposes several tools that the AI can call.
add_expense
Adds a new expense.
Example request:
Add โน500 for dinner today.
The AI can call:
add_expense(
amount=500,
category="Food",
subcategory="Dinner"
)get_expense
Retrieves a specific expense using its ID.
Example:
Show me expense number 5.
list_expenses
Returns recent expenses.
Example:
Show me my recent expenses.
update_expense
Updates an existing expense.
Example:
Change expense 5 from โน500 to โน650.
delete_expense
Deletes an expense.
Example:
Delete expense number 5.
search_expenses
Searches expenses using category, subcategory, note, or payment method.
Example:
Find all my food expenses.
get_total_expenses
Calculates the total amount spent.
Example:
How much have I spent in total?
get_category_summary
Groups expenses by category.
Example:
How much did I spend on food, transport and shopping?
Example result:
Food โน5,200
Shopping โน3,400
Transport โน2,100
Bills โน1,750get_monthly_summary
Returns spending information for a specific month.
Example:
How much did I spend in August 2026?
get_expenses_by_date_range
Returns expenses between two dates.
Example:
Show my expenses from August 1 to August 15.
get_top_expenses
Returns the largest expenses.
Example:
What are my five biggest expenses?
get_expense_summary
Provides an overall financial summary.
It can include:
Total spending
Number of transactions
Average expense
Category breakdown
Largest expenseExample:
Total Spent: โน12,450
Transactions: 32
Average Expense: โน389
Top Categories:
Food โน4,500
Shopping โน3,200
Transport โน2,100
Bills โน1,800
Largest Expense:
โน2,500
Category: Shopping๐ 8. MCP Resources
MCP resources are used to expose information/context to the MCP client.
For example:
@mcp.resource(
"expenses://categories",
mime_type="application/json"
)
def expense_categories():
return """
{
"categories": [
"Food",
"Transport",
"Shopping",
"Bills",
"Entertainment"
]
}
"""The important difference is:
Tool โ Performs an action
Resource โ Provides information
Prompt โ Provides a reusable instruction/templateโถ๏ธ 9. Run the Server
You can run the server using:
uv run python server.pyThe MCP server will start locally.
๐ 10. Inspect/Test the MCP Server
FastMCP provides development tooling.
You can use:
uv run fastmcp dev server.pyThis is useful for testing and inspecting the MCP server during development.
๐ค 11. Connect to Claude Desktop
To use the expense tracker through Claude Desktop, add the MCP server to the Claude Desktop configuration.
The configuration generally looks like:
{
"mcpServers": {
"expense-tracker": {
"command": "/path/to/uv",
"args": [
"run",
"--directory",
"/path/to/expense-tracker",
"python",
"server.py"
]
}
}
}Replace:
/path/to/uvwith the actual path to your uv executable.
On Linux, find it using:
which uvAlso replace:
/path/to/expense-trackerwith the actual project directory.
โ ๏ธ 12. If Claude Desktop Shows a Connection Error
If Claude cannot connect to the MCP server:
Step 1
Check that the server works independently:
uv run python server.pyStep 2
Check the uv path:
which uvStep 3
Make sure the Claude configuration uses the correct absolute path.
Step 4
Restart Claude Desktop after changing the configuration.
Step 5
Check:
Claude Desktop
โ
Settings
โ
Developer
โ
ConfigurationThen verify the MCP server configuration.
๐ฌ 13. How to Use the Expense Tracker
Once the MCP server is connected to Claude, you don't need to manually call the functions.
You can simply use natural language.
Add an expense
I spent โน250 on dinner today.Claude can use:
add_expense()Check total spending
How much have I spent so far?Claude can use:
get_total_expenses()Get a summary
Give me a summary of all my expenses.Claude can use:
get_expense_summary()Search
Show me all my shopping expenses.Claude can use:
search_expenses()Find largest expenses
What are my five biggest expenses?Claude can use:
get_top_expenses()Monthly analysis
How much did I spend in August 2026?Claude can use:
get_monthly_summary()Date range
Show me everything I spent between August 1 and August 15.Claude can use:
get_expenses_by_date_range()Update an expense
Change expense 12 from โน300 to โน450.Claude can use:
update_expense()Delete an expense
Delete expense number 12.Claude can use:
delete_expense()๐ 14. Complete Request Flow
When you say:
"I spent โน500 on dinner today."
The flow is:
You
โ
โผ
Claude Desktop
โ
โ Understands request
โผ
MCP Client
โ
โ Calls tool
โผ
add_expense()
โ
โผ
FastMCP Server
โ
โผ
SQLite
โ
โผ
expenses.db
โ
โผ
Success Response
โ
โผ
Claude
โ
โผ
"Expense added successfully."๐งฉ 15. Why MCP Is Useful Here
Without MCP:
User โ Application โ DatabaseWith MCP:
User
โ
AI
โ
MCP
โ
Expense Tools
โ
DatabaseThe AI can decide which tool is appropriate based on the user's natural-language request.
This makes the expense tracker a good example of AI + tools + local data.
๐ 16. Local Data and Privacy
This project stores expense data locally in:
expenses.dbThe database is not inherently hosted on a cloud server.
This makes the project useful for experimenting with personal/local financial data.
However, when using an external AI client, prompts and tool results may still be processed according to that client's policies. Avoid assuming that "local MCP server" means every piece of data stays entirely on your machine.
๐งช 17. Example Session
User
I spent โน300 on lunch today.AI
Expense added successfully.User
I also spent โน120 on an auto.AI
Expense added successfully.User
How much did I spend today?AI
You spent โน420 today.User
Give me my complete expense summary.AI
Total Spending: โน420
Transactions: 2
Average Expense: โน210
Categories:
Food: โน300
Transport: โน120
Largest Expense:
Lunch โ โน300๐ฏ 18. What I Learned From This Project
This project demonstrates knowledge of:
Python
SQLite
Database CRUD operations
FastMCP
MCP tools
MCP resources
MCP client/server architecture
Tool calling
Natural-language interaction with databases
Local AI integrations
JSON-based configuration
uvproject management
๐ 19. Future Improvements
The project can be extended with:
Budget Management
set_budget()
get_budget_status()Example:
My monthly budget is โน20,000.
Spending Insights
get_spending_insights()Example:
Where am I overspending?
Monthly Comparison
compare_months()Example:
Did I spend more this month than last month?
Recurring Expenses
add_recurring_expense()
get_recurring_expenses()Export
Add support for:
CSV
JSON
Excel
PDFVisualization
Generate:
Monthly spending charts
Category charts
Spending trendsAI Financial Assistant
Eventually, the MCP server can become the backend for an AI financial assistant:
AI Expense Assistant
โ
โผ
MCP Server
โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโ
โ โ โ
Expenses Budget Analytics
โ โ โ
โโโโโโโโโโโโโโโโโโโผโโโโโโโโโโโโโโโโโโ
โผ
SQLiteThe user could ask:
"Analyze my spending this month and tell me three areas where I can reduce expenses."
The AI could retrieve the required data through MCP tools and generate an analysis.
โ Final Workflow
The complete development workflow is:
1. Install uv
โ
2. Create project folder
โ
3. Open in VS Code
โ
4. uv init
โ
5. uv add fastmcp
โ
6. Create server.py
โ
7. Initialize SQLite
โ
8. Create MCP tools
โ
9. Create MCP resources
โ
10. Run server
โ
11. Test/inspect with FastMCP
โ
12. Configure Claude Desktop
โ
13. Restart Claude
โ
14. Use natural language
โ
15. Claude calls MCP tools
โ
16. Tools interact with SQLite
โ
17. Results return to Claude๐ Project Summary
Expense Tracker MCP Server is a local AI-enabled expense management system that uses FastMCP to expose expense-management tools and resources, with SQLite as the local persistence layer and an MCP-compatible client such as Claude Desktop as the natural-language interface.
It demonstrates how an AI application can safely interact with structured local data through the Model Context Protocol (MCP) instead of directly accessing the database.
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 Servers
- 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.1
- FlicenseAqualityDmaintenanceEnables AI assistants like Claude to manage personal expenses locally using SQLite. Supports adding, categorizing, summarizing expenses, setting budgets, and exporting data without cloud services.8
- FlicenseNot gradedqualityDmaintenanceEnables natural language management of personal expenses, including adding, listing, and summarizing expenses with local SQLite storage.
- FlicenseAqualityCmaintenanceEnables AI assistants to track, query, summarize, and delete personal expenses stored in a local SQLite database via natural language.4
Related MCP Connectors
Log, query, and edit expenses, budgets, and accounts in Ledgy from any MCP-compatible AI assistant.
Capture receipts, scan Gmail, analyze spending, and create reviewed reports from AI assistants.
Analytical memory for AI agents: a real Postgres queried in plain English over MCP. One command.
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/ayushpaliwal1920/ExpenseTracker_Mcp_Server'
If you have feedback or need assistance with the MCP directory API, please join our Discord server