Expense Tracker MCP Server

Expense Tracker MCP Server

A FastMCP server for tracking personal expenses with MongoDB storage, enabling CRUD operations, category listing, and expense summaries.

Category
Visit Server

README

Expense Tracker MCP Server

A Python-based FastMCP server for tracking personal expenses with MongoDB storage and a fixed category/subcategory model.

Project Overview

This repository implements an expense tracker as an MCP service using fastmcp. It stores expenses in a MongoDB collection and enforces a predefined set of categories and subcategories defined in categories.json.

The server exposes the following MCP tools:

  • list_categories()
  • add_expense(amount, category, subcategory, date=None, note=None)
  • update_expense(expense_id, amount=None, category=None, subcategory=None, date=None, note=None)
  • delete_expense(expense_id)
  • list_expenses(start_date=None, end_date=None, category=None, limit=20)
  • get_expense_summary(start_date=None, end_date=None, group_by="category")

Requirements

  • Python 3.13 or newer
  • MongoDB access via connection URI
  • fastmcp
  • python-dotenv
  • pymongo

Setup

  1. Create and activate a Python virtual environment.
  2. Install dependencies:
pip install -r requirements.txt
  1. Create a .env file at the project root with:
MONGODB_URI=<your-mongodb-uri>
  1. Run the server:
python main.py
  1. The server listens on port 8000 by default and can be overridden with the PORT environment variable.

Configuration

  • main.py contains the MCP service configuration, database connection logic, and expense CRUD operations.
  • categories.json defines the allowed categories and subcategories for every expense.
  • render.yaml defines a Render deployment configuration that installs requirements and starts the service.

Expense Data Model

Each expense document includes:

  • amount (float)
  • category (string)
  • subcategory (string)
  • date (stored as a date object)
  • note (optional string)
  • created_at (UTC timestamp)

Expense IDs are stored as MongoDB _id values and returned as expense_id in serialized responses.

Usage Notes

  • Use list_categories() before adding or updating an expense so you can choose valid category and subcategory values.
  • Dates must be in YYYY-MM-DD format when provided.
  • add_expense() requires a positive amount.
  • update_expense() only changes the fields you provide.
  • list_expenses() defaults to the most recent 20 expenses and supports filtering by date range and category.
  • get_expense_summary() aggregates totals by category or by month.

Deployment on Render

The included render.yaml configures a Python web service:

  • buildCommand: pip install -r requirements.txt
  • startCommand: python main.py
  • MONGODB_URI is expected from a Render-managed secret named mongodb_uri

Category Guidance

The app uses the category definitions from categories.json, so do not invent new categories or subcategories. If you need to verify valid values, call list_categories().

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