Small FastMCP demo that tracks expenses from expenses.csv. The server registers a tool to append new rows, a read-only resource that lists the table, and a short prompt for quick summaries.
- Python 3.13+ with the dependencies from
pyproject.toml. uv sync && uv run python main.pylaunches the server.uv run fastmcp run main:mcpexposes it through the FastMCP CLI for MCP clients.
add_expense(date, category, quantity, payment_method)adds a row (creates the CSV if missing).resource://expenses.csvreturns the formatted table vialist_expenses.summarize_expensesoffers a natural-language summary prompt.
expenses.csvships with sample data; delete it to start fresh.- Keep all logic in
main.py. Add tests undertests/if you extend the project.