Expense Tracker MCP

Expense Tracker MCP

Provides tools for natural language expense management, including automated categorization using embeddings and real-time transaction tracking. It enables users to create expenses, generate spending summaries, and analyze subscriptions through the Model Context Protocol.

Category
Visit Server

README

Expense Tracker Backend

AI-powered expense tracking system with natural language interface, intelligent categorization, and real-time sync.

Architecture

The system uses a two-server architecture:

  1. MCP Server: Core expense tracking tools exposed via Model Context Protocol
  2. Gemini AI Server: FastAPI server providing chat interface with authentication

Features

  • šŸ¤– Natural language expense management via Gemini AI
  • 🧠 Intelligent categorization using embeddings and similarity search
  • šŸ” JWT authentication with Supabase
  • šŸ“Š Hierarchical categories for organization
  • šŸ·ļø Predefined tag system
  • šŸ“ˆ Real-time data sync
  • šŸ”„ Learning system that improves over time

Quick Start

Prerequisites

python3 -m venv venv
source venv/bin/activate
pip install -r requirements.txt

Environment Setup

cp .env.example .env
# Add your credentials:
# - SUPABASE_URL
# - SUPABASE_KEY
# - GOOGLE_API_KEY (for Gemini)

Database Setup

Execute the SQL scripts in your Supabase SQL Editor:

# Core tables
scripts/create_tables.sql
# Embeddings support
scripts/create_embeddings_schema.sql

Run Both Servers

Terminal 1 - MCP Server:

python run_mcp.py

Terminal 2 - Gemini AI Server:

uvicorn app.servers.gemini.main:app --reload --port 8000

Initialize Data

# Populate categories
python scripts/populate_hierarchical_categories.py

# Populate predefined tags
python scripts/populate_predefined_tags.py

API Endpoints

Chat Interface

  • POST /chat - Send natural language commands
  • POST /auth/refresh - Refresh JWT token

MCP Tools (via chat)

  • Create expenses from natural language
  • Auto-categorize transactions
  • Get spending summaries
  • Analyze subscriptions
  • View recent transactions

Flutter Client

refer https://github.com/keyurgit45/expense-tracker-client

Testing

# Run all tests with mocks
ENVIRONMENT=test pytest tests/ -v

# Run specific components
ENVIRONMENT=test pytest tests/test_mcp_tools.py -v
ENVIRONMENT=test pytest tests/test_categorization.py -v

Project Structure

backend/
ā”œā”€ā”€ app/
│   ā”œā”€ā”€ core/              # Business logic
│   ā”œā”€ā”€ servers/
│   │   ā”œā”€ā”€ gemini/       # AI chat server
│   │   └── mcp/          # MCP tool server
│   └── shared/           # Shared configs
ā”œā”€ā”€ scripts/              # Utilities
└── tests/               # Test suite

AI Categorization

The system uses a hybrid approach:

  1. Generates embeddings for transactions using Sentence Transformers
  2. Finds similar past transactions using pgvector
  3. Uses weighted voting to predict categories
  4. Falls back to rule-based matching
  5. Learns from user confirmations

Development

  • API docs: http://localhost:8000/docs
  • Frontend integration: Configure CORS in Gemini server
  • MCP tools can be tested directly via chat interface

Recommended Servers

playwright-mcp

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.

Official
Featured
TypeScript
Magic Component Platform (MCP)

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.

Official
Featured
Local
TypeScript
Audiense Insights MCP Server

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.

Official
Featured
Local
TypeScript
VeyraX MCP

VeyraX MCP

Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.

Official
Featured
Local
graphlit-mcp-server

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.

Official
Featured
TypeScript
Kagi MCP Server

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.

Official
Featured
Python
E2B

E2B

Using MCP to run code via e2b.

Official
Featured
Neon Database

Neon Database

MCP server for interacting with Neon Management API and databases

Official
Featured
Exa Search

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.

Official
Featured
Qdrant Server

Qdrant Server

This repository is an example of how to create a MCP server for Qdrant, a vector search engine.

Official
Featured