expense-mcp-server

expense-mcp-server

Enables AI assistants to track and manage expenses, including adding, viewing, and summarizing expenses by category, date, or amount, with persistent local storage.

Category
Visit Server

README

Expense Tracker MCP Server

A Model Context Protocol (MCP) server for tracking and managing expenses. This server enables AI assistants to help you manage your finances through natural language interactions.

Overview

The Expense MCP Server implements the Model Context Protocol to provide expense tracking capabilities to AI tools like Claude Desktop, Cursor, and other MCP-compatible clients. Track expenses, categorize spending, and get insights into your financial habits through conversational AI.

Features

  • Add Expenses: Record expenses with categories, amounts, and descriptions
  • View Expenses: Retrieve and filter expenses by date, category, or amount
  • Expense Summaries: Get spending summaries and financial insights
  • Member Management: Track expenses for multiple members or groups
  • Persistent Storage: All data is stored locally in JSON format

Prerequisites

  • Python 3.10 or higher
  • uv (Python package manager)

Installation

1. Install uv

If you haven't already installed uv:

macOS/Linux:

curl -LsSf https://astral.sh/uv/install.sh | sh

Windows:

powershell -c "irm https://astral.sh/uv/install.ps1 | iex"

2. Clone the Repository

git clone https://github.com/shivamprasad1001/expense-mcp-server.git
cd expense-mcp-server

3. Install Dependencies

uv sync

Finding Your uv Path

To avoid configuration errors, you'll need the absolute path to your uv executable.

macOS/Linux:

which uv

Windows (PowerShell):

where.exe uv

The command will output something like:

  • macOS: /Users/yourusername/.local/bin/uv or /opt/homebrew/bin/uv
  • Linux: /home/yourusername/.local/bin/uv
  • Windows: C:\Users\YourUsername\.local\bin\uv.exe

Configuration

For Claude Desktop

Add this configuration to your Claude Desktop config file:

macOS: ~/Library/Application Support/Claude/claude_desktop_config.json
Windows: %APPDATA%\Claude\claude_desktop_config.json

{
  "mcpServers": {
    "expense-tracker": {
      "command": "/ABSOLUTE/PATH/TO/uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/expense-mcp-server",
        "run",
        "expense-mcp-server"
      ]
    }
  }
}

Example (macOS):

{
  "mcpServers": {
    "expense-tracker": {
      "command": "/Users/johndoe/.local/bin/uv",
      "args": [
        "--directory",
        "/Users/johndoe/projects/expense-mcp-server",
        "run",
        "expense-mcp-server"
      ]
    }
  }
}

Example (Windows):

{
  "mcpServers": {
    "expense-tracker": {
      "command": "C:\\Users\\JohnDoe\\.local\\bin\\uv.exe",
      "args": [
        "--directory",
        "C:\\Users\\JohnDoe\\projects\\expense-mcp-server",
        "run",
        "expense-mcp-server"
      ]
    }
  }
}

For Cursor

Add this to your Cursor MCP configuration at ~/.cursor/mcp.json:

{
  "mcpServers": {
    "expense-tracker": {
      "command": "/ABSOLUTE/PATH/TO/uv",
      "args": [
        "--directory",
        "/ABSOLUTE/PATH/TO/expense-mcp-server",
        "run",
        "expense-mcp-server"
      ]
    }
  }
}

For Other MCP Clients

Refer to your MCP client's documentation for configuration. Generally, you'll need to specify:

  • Command: Absolute path to uv (e.g., /Users/username/.local/bin/uv)
  • Args: ["--directory", "/absolute/path/to/expense-mcp-server", "run", "expense-mcp-server"]

Usage

Once configured, restart your AI assistant (Claude Desktop/Cursor) to load the MCP server. You can then interact with the expense tracker through natural language:

Example Interactions

  • "Add a $50 expense for groceries"
  • "Show me all my expenses this month"
  • "How much did I spend on restaurants?"
  • "What's my total spending this week?"
  • "Add a $25 expense for transportation"
  • "List all expenses over $100"
  • "Add a new member named John"
  • "Show me all members and their expenses"

Available Tools

The MCP server exposes the following tools for AI assistants:

  • add_expense: Record a new expense with amount, category, and description
  • list_expenses: View all expenses or filter by criteria (date, category, amount)
  • get_summary: Get spending summaries, totals, and statistics
  • add_member: Add a new member for expense tracking
  • list_members: View all members
  • delete_expense: Remove an expense by ID
  • update_expense: Modify an existing expense

Data Storage

All expense data is stored locally in members.json in the project directory. This file contains:

  • Member information
  • Expense records with timestamps
  • Categories and metadata

Data Privacy: All your data stays on your local machine. Nothing is sent to external servers.

Development

Project Structure

expense-mcp-server/
├── main.py              # Main MCP server implementation
├── members.json         # Data storage (created on first run)
├── pyproject.toml       # Project configuration
├── uv.lock             # Dependency lock file
└── README.md           # This file

Running in Development Mode

# Navigate to project directory
cd expense-mcp-server

# Run the server
uv run expense-mcp-server

Testing with MCP Inspector

You can test the MCP server using the MCP Inspector tool:

npx @modelcontextprotocol/inspector uv --directory /path/to/expense-mcp-server run expense-mcp-server

The inspector provides a web interface to test all available tools and resources.

Troubleshooting

Common Issues

"command not found: uv"

  • Make sure you've installed uv and it's in your PATH
  • Use the absolute path to uv in your configuration (see "Finding Your uv Path" section)

"No module named 'mcp'"

  • Run uv sync in the project directory to install dependencies

Changes not reflecting in Claude Desktop

  • Restart Claude Desktop completely after configuration changes
  • Check the Developer Tools in Claude Desktop (View > Developer Tools) for errors

Server not starting

  • Verify all paths in the configuration are absolute paths
  • Ensure the members.json file is writable
  • Check Python version with python --version (must be 3.10+)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

Roadmap

  • [ ] Add budget tracking and alerts
  • [ ] Export expenses to CSV/Excel
  • [ ] Support for multiple currencies
  • [ ] Recurring expense tracking
  • [ ] Category-based analytics and charts
  • [ ] Receipt image storage (with OCR)

License

This project is open source and available under the MIT License.

Support

If you encounter any issues or have questions:

About MCP

The Model Context Protocol (MCP) is an open protocol that standardizes how applications provide context to Large Language Models (LLMs). Think of MCP like a USB-C port for AI - it provides a standardized way to connect AI models to different data sources and tools.

Learn more at modelcontextprotocol.io.

Author

Created by shivamprasad1001


Important: Always use absolute paths in your MCP configuration to avoid "command not found" errors. Replace placeholder paths with your actual system paths.

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