Local-MCP-server-basics

raajshekhar19/Local-MCP-server-basics

3.2

If you are the rightful owner of Local-MCP-server-basics and would like to certify it and/or have it hosted online, please leave a comment on the right or send an email to dayong@mcphub.com.

This is a simple expense tracker server built using FastMCP, designed to manage and track expenses efficiently.

Tools
3
Resources
0
Prompts
0

Expense Tracker MCP Server

This is a simple expense tracker server built using FastMCP. It allows you to add, list, and summarize expenses, as well as manage expense categories.

Features

  • Add new expenses with details like date, amount, category, subcategory, and notes.
  • List expenses within a specific date range.
  • Summarize expenses by category.
  • Manage categories via a JSON resource.

Setup Instructions

  1. Clone the repository:

    git clone https://github.com/raajshekhar19/Local-MCP-server-basics.git
    cd expense-tracker-mcp-server
    
  2. Create and activate a virtual environment:

    python -m venv .venv
    .venv/Scripts/activate
    
  3. Install dependencies:

    pip install -r requirements.txt
    
  4. Run the server:

    python main.py
    

Usage

Add an Expense

Use the add_expense tool to add a new expense:

{
  "date": "2023-10-01",
  "amount": 50.0,
  "category": "Food",
  "subcategory": "Groceries",
  "note": "Weekly shopping"
}

List Expenses

Use the list_expenses tool to retrieve expenses within a date range:

{
  "start_date": "2023-10-01",
  "end_date": "2023-10-31"
}

Summarize Expenses

Use the summarize tool to get a summary of expenses by category:

{
  "start_date": "2023-10-01",
  "end_date": "2023-10-31",
  "category": "Food"
}

Manage Categories

Access the expense://categories resource to view or edit categories.

Notes

  • The database file (expenses.db) and categories file (categories.json) are stored in the project directory.
  • Ensure the categories.json file exists and is properly formatted before running the server.

run the command:-> .venv/Scripts/activate