Expense Log MCP
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Expense Log MCP
A streamable http-based MCP server providing tools for logging expenses.
✨ Features
Log a new expense to a ledger.
Delete an expense record.
Retrieve a list of all available expense categories.
Retrieve and group expenses by payer and category.
Retrieve an expense record.
Related MCP server: expense-tracker-mcp
🚀 Getting Started
Prerequisites
A PostgreSQL database
Installation & Setup
Clone the repository:
git clone https://github.com/evanxd/expense-log-mcp-py.gitCreate and activate a virtual environment:
uv venv source .venv/bin/activateInstall dependencies:
uv pip install -e .Configure environment variables:
Create a
.envfile by copying.env.exampleand updating the values:cp .env.example .envAdd server configuration to your
.envfile:DATABASE_URL="postgresql://postgres:password@localhost:5432/postgres?schema=public" BEARER_TOKEN="YOUR_BEARER_TOKEN" PORT="8000"
Start the server:
uv run python -m expense_log_mcp.mainThis command starts the server, which will listen for incoming requests on the specified
PORT(defaulting to 8000).Configure your MCP host (e.g., Gemini CLI):
Add the following configuration to your Gemini CLI settings (typically found in
~/.gemini-cli/config.jsonor similar, depending on your OS):
"mcpServers": { "expense-log-mcp": { "url": "http://localhost:8000/mcp", "headers": { "Authorization": "Bearer YOUR_BEARER_TOKEN" } } }Important: Replace
YOUR_BEARER_TOKENwith the actualBEARER_TOKENyou set in your.envfile. This tells the Gemini CLI how to connect to and authenticate with your locally running Expense Log MCP server.
🛠️ Tools
The server exposes the following tools:
add_expense
Adds a new expense record.
Parameters:
Name | Type | Description |
| string | The ID of the ledger to add the expense to. |
| string | The ID of the expense category. |
| string | A unique ID for the message to prevent duplicates. |
| string | A description of the expense. |
| number | The amount of the expense. |
| string | The name of the person who paid. |
Returns:
A JSON string confirming the expense has been added, e.g.:
{
"success": true,
"code": "OK",
"message": "Expense added successfully.",
"data": {
"expense_id": "clx...456"
}
}delete_expense
Deletes an expense record.
Parameters:
Name | Type | Description |
| string | The ID of the ledger the expense belongs to. |
| string | The unique message ID of the expense to be deleted. |
Returns:
A JSON string confirming the expense has been deleted, and including details of the deleted expense, e.g.:
{
"success": true,
"code": "OK",
"message": "Expense deleted successfully.",
"data": {
"id": "clx...123",
"description": "Lunch",
"amount": 15.75,
"created_at": "Sun Sep 07 2025"
}
}get_expense
Retrieves the details of a single expense.
Parameters:
Name | Type | Description |
| string | The ID of the ledger the expense belongs to. |
| string | The unique message ID of the expense to be deleted. |
Returns:
A JSON string confirming the expense has been retrieved, and including details of the expense, e.g.:
{
"success": true,
"code": "OK",
"message": "Expense retrieved successfully.",
"data": {
"id": "clx...123",
"description": "Lunch",
"amount": 110,
"payer": "payer1",
"created_at": "2025-09-07T00:00:00.000Z",
"updated_at": "2025-09-07T00:00:00.000Z"
}
}get_expense_categories
Retrieves the list of all expense categories.
Parameters:
None.
Returns:
A JSON string containing the list of expense categories, e.g.:
{
"success": true,
"code": "OK",
"message": "Expense categories retrieved successfully.",
"data": [
{
"expense_category_id": "clx...1",
"expense_category_name": "Transportation"
},
{
"expense_category_id": "clx...2",
"expense_category_name": "Utilities"
}
]
}get_grouped_expenses
Retrieves and groups expenses by payer and then by category name, returning the total amount for each category,
with optional filters for category IDs, payer name, and a date range.
The start_date and end_date should be ISO 8601 strings, always in UTC.
The timezone for these dates can be adjusted using the timezone_offset_hours
parameter (default: 8), which is an integer representing the UTC offset in hours.
Parameters:
Name | Type | Description |
| string | The ID of the ledger to retrieve expenses from. |
| string[] | Optional. An array of category IDs to filter by. |
| string | Optional. The name of the payer to filter by. |
| string | Optional. The start date for filtering expenses (ISO 8601 format, e.g., "2025-01-01T00:00:00Z"). |
| string | Optional. The end date for filtering expenses (ISO 8601 format, e.g., "2025-12-31T23:59:59Z"). |
| number | Optional. An integer representing the UTC offset in hours to adjust the timezone for |
Returns:
A JSON string containing the grouped expenses, e.g.:
{
"success": true,
"code": "OK",
"message": "Grouped expenses retrieved successfully.",
"data": {
"Payer1": {
"expense_categories": {
"Entertainment": 100,
"Transportation": 50
},
"total_amount": 150
},
"Payer2": {
"expense_categories": {
"Dining/Snacks": 75
},
"total_amount": 75
}
}
}🗄️ Database Schema
This project uses Prisma to manage the database schema. The schema is defined in prisma/schema.prisma and includes the following models:
Ledger: Represents a collection of expenses.ExpenseCategory: Represents a category for an expense.Expense: Represents a single expense record. A unique constraint is added onledger_idandmessage_idto prevent duplicate expenses.
All models include created_at and updated_at timestamps. IDs are generated using cuid().
🙌 Contributing
Contributions are welcome! Please feel free to submit a pull request.
📄 License
This project is licensed under the MIT License.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
This server cannot be deployed
Maintenance
Related MCP Connectors
Log, query, and edit expenses, budgets, and accounts in Ledgy from any MCP-compatible AI assistant.
Log, query, and edit expenses, budgets, and accounts in Manilo (formerly Ledgy) from any MCP-compatible AI assistant.
Log, query, and edit expenses, budgets, and accounts in Manilo from any MCP-compatible AI assistant.
Expense ledger for AI assistants: record receipts line by line, ask what you spent, export anytime.
Related MCP Servers
- FlicenseNot gradedqualityDmaintenanceEnables users to track personal expenses through natural language interactions with comprehensive category support and financial summaries. Provides both local and remote MCP server options with SQLite storage for fast expense management operations.-
- FlicenseAqualityDmaintenanceMCP server for tracking personal expenses via natural language, with tools to add, list, and summarize expenses, backed by Postgres.6-
- FlicenseNot gradedqualityDmaintenanceEnables managing and analyzing personal expenses through MCP tools, including adding expense records, listing expenses within date ranges, and summarizing spending by category, with expense categories exposed as an MCP resource.-
- FlicenseBqualityDmaintenanceEnables users to manage personal expenses by adding entries, listing them by date range, and summarizing spending by category through MCP tools, while exposing category data as a resource.3-