Expense Tracker MCP
An AI-powered Expense Tracker built using FastMCP and SQLite that exposes expense management capabilities as MCP tools, allowing AI assistants to interact with a persistent expense database.
README
Expense Tracker MCP
An AI-powered Expense Tracker built using FastMCP and SQLite. This project exposes expense management capabilities as MCP tools, allowing AI assistants such as Claude Desktop to interact with a persistent expense database through the Model Context Protocol (MCP).
Features
- Add new expenses
- List expenses within a date range
- Update existing expenses
- Delete expenses
- Summarize expenses by category
- Expose expense categories as an MCP Resource
- Persistent local storage using SQLite
Tech Stack
- Python 3.11+
- FastMCP
- SQLite
- JSON
- MCP (Model Context Protocol)
Project Structure
Expense-Tracker-MCP/
│
├── main.py # FastMCP server
├── database.py # Database operations
├── categories.json # Expense categories
├── expenses.db # SQLite database (generated at runtime)
├── pyproject.toml
├── uv.lock
└── README.md
MCP Tools
| Tool | Description |
|---|---|
add_expense |
Add a new expense |
list_expenses |
Retrieve expenses between two dates |
update_expense |
Update an existing expense |
delete_expense |
Delete an expense by ID |
summarize_expenses |
Summarize expenses by category |
MCP Resources
expense://categories
Returns the list of supported expense categories and subcategories from categories.json.
Installation
Clone the repository:
git clone https://github.com/navalmishra/Expense-Tracker-MCP.git
cd Expense-Tracker-MCP
Install dependencies:
uv sync
or
pip install -e .
Running the Server
Start the FastMCP server:
python main.py
The server starts at:
http://localhost:8000/mcp
Connecting with Claude Desktop
Add the server to your Claude Desktop configuration:
{
"mcpServers": {
"expense-tracker": {
"command": "python",
"args": [
"/path/to/main.py"
]
}
}
}
Restart Claude Desktop, and the Expense Tracker tools will be available automatically.
Example Workflow
Ask Claude:
Add an expense of ₹500 for groceries today.
Claude calls:
add_expense(...)
Ask:
Show my expenses for this month.
Claude calls:
list_expenses(...)
Ask:
Summarize my food expenses.
Claude calls:
summarize_expenses(...)
Database
The application uses SQLite for local persistence.
The database is created automatically on the first run if it does not already exist.
Future Improvements
- Category validation using
categories.json - Pydantic models for input validation
- Monthly and yearly reports
- Expense analytics
- Budget tracking
- Cloud database support (PostgreSQL/Turso)
- Authentication
- Deployment on FastMCP Cloud
Learning Objectives
This project demonstrates:
- Building custom MCP servers
- Creating MCP Tools and Resources
- Integrating SQLite with FastMCP
- Persistent AI applications
- Connecting custom MCP servers with Claude Desktop
- Deploying MCP servers to FastMCP Cloud
License
This project is licensed under the MIT License.
Recommended Servers
playwright-mcp
A Model Context Protocol server that enables LLMs to interact with web pages through structured accessibility snapshots without requiring vision models or screenshots.
Magic Component Platform (MCP)
An AI-powered tool that generates modern UI components from natural language descriptions, integrating with popular IDEs to streamline UI development workflow.
Audiense Insights MCP Server
Enables interaction with Audiense Insights accounts via the Model Context Protocol, facilitating the extraction and analysis of marketing insights and audience data including demographics, behavior, and influencer engagement.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
graphlit-mcp-server
The Model Context Protocol (MCP) Server enables integration between MCP clients and the Graphlit service. Ingest anything from Slack to Gmail to podcast feeds, in addition to web crawling, into a Graphlit project - and then retrieve relevant contents from the MCP client.
Kagi MCP Server
An MCP server that integrates Kagi search capabilities with Claude AI, enabling Claude to perform real-time web searches when answering questions that require up-to-date information.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
Exa Search
A Model Context Protocol (MCP) server lets AI assistants like Claude use the Exa AI Search API for web searches. This setup allows AI models to get real-time web information in a safe and controlled way.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.