Expense Tracker MCP Server
An AI-native expense tracker MCP server that enables AI assistants to add and list expenses in a local SQLite database.
README
šø Expense Tracker MCP Server
<div align="center">
A blazing-fast, AI-native Expense Tracker built as an MCP (Model Context Protocol) Server using FastMCP and SQLite.
Plug it directly into Claude Desktop, Cursor, or any MCP-compatible AI client ā let your AI manage your finances for you.
</div>
š Table of Contents
- What is MCP?
- Features
- Project Structure
- Prerequisites
- Installation
- Running the Server
- Available Tools
- Connecting to Claude Desktop
- Development & Inspection
- Tech Stack
š¤ What is MCP?
The Model Context Protocol (MCP) is an open standard by Anthropic that allows AI models (like Claude) to securely interact with external tools, APIs, and data sources. This project exposes expense-tracking capabilities as MCP tools, meaning you can literally tell Claude:
"Add an expense: Coffee, $4.50, Food & Drink, Cash, 2026-08-02"
...and it will call this server and record it in your local SQLite database ā no UI needed.
⨠Features
- š Add Expenses ā Record expenses with title, amount, category, payment method, date, and optional description
- š List Expenses ā Retrieve all stored expenses as structured data
- šļø Persistent SQLite Storage ā Auto-creates a local
expenses.dbdatabase on first run - ā” FastMCP Powered ā Minimal boilerplate, maximum capability
- š Built-in Inspector ā Visual tool inspector for debugging and testing
- š MCP-Compatible ā Works with Claude Desktop, Cursor, and any MCP client
š Project Structure
expense_tracker_mcp_server/
āāā expense_mcp_server.py # šÆ Main MCP server ā all tools defined here
āāā pyproject.toml # Project metadata & dependencies
āāā uv.lock # Locked dependency versions
āāā .python-version # Python version pin
āāā .gitignore # Git ignore rules
āāā src/
ā āāā expense_tracker_mcp_server/
ā āāā __init__.py # Package entry point
āāā README.md # You are here!
š ļø Prerequisites
Make sure you have the following installed:
- Python 3.11+
- pip (comes with Python)
- uv ā Fast Python package manager
š Installation
Step 1 ā Clone the Repository
git clone https://github.com/talha963/expense_mcp_server.git
cd expense_mcp_server
Step 2 ā Install uv
pip install uv
Step 3 ā Initialize the Project with uv
uv init .
Step 4 ā Install FastMCP
# Via pip (global)
pip install fastmcp
# OR via uv (recommended ā adds to project)
uv add fastmcp
Step 5 ā Sync Dependencies
uv sync
ā¶ļø Running the Server
Option 1 ā Run directly with Python
python expense_mcp_server.py
Starts an HTTP server on
http://0.0.0.0:8000
Option 2 ā Run via uv
uv run expense_mcp_server.py
Option 3 ā Run via FastMCP CLI (Recommended for MCP clients)
uv run --active fastmcp run expense_mcp_server.py
š§ Available Tools
The server exposes the following MCP tools that AI models can call:
add_expense
Adds a new expense entry to the database.
| Parameter | Type | Required | Description |
|---|---|---|---|
title |
string | ā | Name/title of the expense |
amount |
float | ā | Amount spent (e.g. 12.50) |
category |
string | ā | Category (e.g. Food, Transport) |
payment_method |
string | ā | e.g. Cash, Card, Online |
expense_date |
string | ā | Date in YYYY-MM-DD format |
description |
string | ā | Optional notes about the expense |
Example response:
{
"success": true,
"expense_id": 1,
"message": "Expense added successfully."
}
list_expenses
Returns all recorded expenses from the database.
No parameters required.
Example response:
[
{
"id": 1,
"title": "Coffee",
"amount": 4.5,
"category": "Food & Drink",
"payment_method": "Cash",
"expense_date": "2026-08-02",
"description": "Morning coffee at the office"
}
]
š„ļø Connecting to Claude Desktop
To use this server with Claude Desktop, add the following to your claude_desktop_config.json:
{
"mcpServers": {
"expense-tracker": {
"command": "uv",
"args": [
"run",
"--active",
"fastmcp",
"run",
"/absolute/path/to/expense_mcp_server.py"
]
}
}
}
Config file location:
- Windows:
%APPDATA%\Claude\claude_desktop_config.json- macOS:
~/Library/Application Support/Claude/claude_desktop_config.json
After saving, restart Claude Desktop and the Expense Tracker tools will appear automatically.
š Development & Inspection
Use the FastMCP Inspector to visually test and explore your tools in the browser:
uv run --active fastmcp dev expense_mcp_server.py
This opens an interactive web UI where you can:
- See all registered tools
- Call tools manually with test inputs
- Inspect request/response payloads
š§° Tech Stack
| Technology | Purpose |
|---|---|
| FastMCP | MCP server framework |
| SQLite3 | Lightweight persistent storage |
| uv | Ultra-fast Python package manager |
| Python 3.11+ | Runtime |
š¤ Author
Talha ā @talha963
š License
This project is licensed under the MIT License ā feel free to use, modify, and distribute.
<div align="center"> <sub>Built with ā¤ļø using FastMCP ā making AI tool integration effortless.</sub> </div>
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.