An open API service indexing awesome lists of open source software.

https://github.com/abhaysingh71/expense-tracker-mcp-server

MCP server built with FastMCP for tracking, listing, and summarizing expenses. Works with Claude Desktop or MCP Inspector for seamless expense management.
https://github.com/abhaysingh71/expense-tracker-mcp-server

claude-desktop fastmcp jsonrpc2 mcp-inspector mcp-server sqlite uv

Last synced: 3 months ago
JSON representation

MCP server built with FastMCP for tracking, listing, and summarizing expenses. Works with Claude Desktop or MCP Inspector for seamless expense management.

Awesome Lists containing this project

README

          

# Expense-Tracker MCP Server

An **MCP (Model Context Protocol) server** built with [FastMCP](https://github.com/jlowin/fastmcp) to help you track and analyze personal expenses.
This server is meant to be used with **MCP-compatible clients** such as **Claude Desktop**, and provides structured tools and resources for expense management.

---

## 🧾 Overview

The Expense-Tracker MCP server allows MCP clients to:

- **Add new expenses** (with date, amount, category, subcategory, and notes)
- **List expenses** within a given date range
- **Summarize spending** by category in a given period
- **Access predefined categories** from a JSON resource

All expense data is stored in a local **SQLite database** (`expenses.db`). Categories can be managed through the `categories.json` file.

---

## πŸ“‚ Project Structure

```
.
β”œβ”€β”€ categories.json # Predefined expense categories
β”œβ”€β”€ expenses.db # SQLite database (auto-created on first run)
β”œβ”€β”€ main_exp.py # Main MCP server
β”œβ”€β”€ demo.py # Optional demo / quick test script
β”œβ”€β”€ pyproject.toml # Project metadata & dependencies
β”œβ”€β”€ uv.lock # Lock file for uv dependencies
└── README.md # You are here
```

---

## πŸš€ Features

- **Add Expenses** β†’ Save expenses with categories, subcategories, and notes
- **List Expenses** β†’ Retrieve expenses between start and end dates
- **Summarize** β†’ Aggregate expenses by category (optionally filter by one category)
- **Dynamic Categories** β†’ Categories are loaded live from `categories.json` so you can edit without restarting
- **FastMCP-powered** β†’ Simple, declarative tools with zero boilerplate

---

## πŸ›  Setup & Run

### 1. Clone the Repository
```bash
git clone https://github.com/AbhaySingh71/Expense-tracker-mcp-server.git
cd Expense-tracker-mcp-server
```

### 2. Install Dependencies with uv
```bash
uv sync
```

### 3. Run the MCP Server
```bash
uv run main_exp.py
```

The server will start and wait for an MCP client (like Claude Desktop) to connect.

---

## πŸ–₯ Using with Claude (MCP Client)

Open your Claude Desktop configuration file (`claude_desktop_config.json`).

Add the Expense-Tracker MCP server under `"mcpServers"`. Example:

```json
{
"mcpServers": {
"expense-tracker": {
"command": "uv",
"args": ["run", "main_exp.py"],
"cwd": "C:/Users/abhay/Desktop/Expense-tracker-mcp"
}
}
}
```

Restart Claude Desktop.
You can now ask Claude things like:

- β€œAdd an expense of β‚Ή200 for Food on 2025-09-28.”
- β€œList all my expenses between 2025-09-01 and 2025-09-28.”
- β€œSummarize my expenses by category for September 2025.”

---

## πŸ” Debugging with MCP Inspector

You can also use MCP Inspector to test this server outside of Claude.

Example:

```bash
npx @modelcontextprotocol/inspector uv run main_exp.py
```

This will launch the inspector UI in your browser, where you can try tools (`add_expense`, `list_expenses`, `summarize`) and check the resource (`expense://categories`) interactively.

---

## πŸ“¬ Contributing

Pull requests and feature suggestions are welcome.
Follow the MCP design philosophy: modularity, clarity, and extensibility.

---

## πŸ›‘ License

Released under the MIT License.