agent-budget
Budget management and cost tracking MCP server for autonomous agents, enabling budget creation, cost recording, spending projections, and alert rules.
README
Agent Budget
MCP server + CLI for autonomous agents to manage budgets, track expenses, control spending, set savings goals, and enforce spending rules.
Features
v0.2.0
- Savings Goals — Track progress toward savings targets with auto-completion
- Budget Rollover — Carry unspent budget forward to the next period
- Spending Rules — Block, warn, or require approval for expenses
- Expense Updates — Modify existing expenses (amount, vendor, receipt, status)
- Expense Receipts — Attach receipt URLs, mark expenses as reimbursable
- Alert Threshold Updates — Customize budget alert thresholds
- Deprecation Fixes —
datetime.utcnow()→datetime.now(timezone.utc)
v0.1.0
- Budget Management — Create, update, delete budgets with spending limits
- Expense Tracking — Log expenses with categories, tags, and vendor info
- Recurring Expenses — Schedule recurring payments (daily/weekly/monthly/quarterly/yearly)
- Budget vs. Actual — Compare spending against budget limits
- Spending Forecasts — Project future spending based on history
- Alert System — Automatic alerts at configurable thresholds
- Multi-Currency — Support for 15+ currencies
- Data Export — Export to JSON, CSV, or Markdown
Installation
pip install agent-budget
Or with uv:
uv pip install agent-budget
Quick Start
CLI
# Create a monthly budget
agent-budget budget create "API Costs" --limit 500 --period monthly --category api
# Create a budget with rollover
agent-budget budget create "Infrastructure" --limit 1000 --period monthly --rollover --rollover-cap 200
# Log an expense
agent-budget expense add 25.50 --category api --description "OpenAI GPT-4 call" --vendor "OpenAI"
# Log a reimbursable expense with receipt
agent-budget expense add 99.00 --category saas --vendor "GitHub" --reimbursable --receipt-url "https://receipts.example.com/gh-001"
# Update an expense
agent-budget expense update EXP-ABC12345 --amount 125.00 --vendor "AWS"
# Check budget status
agent-budget budget status
# Process budget rollovers
agent-budget budget rollover
# Create a savings goal
agent-budget savings create "Emergency Fund" --target 10000 --target-date 2027-01-01
# Contribute to a savings goal
agent-budget savings contribute SAV-ABC12345 --amount 500 --note "Monthly deposit"
# Withdraw from a savings goal
agent-budget savings withdraw SAV-ABC12345 --amount 200 --note "Emergency repair"
# Add a spending rule
agent-budget rule add "API Cap" --category api --action block --threshold-amount 500
# Add an approval rule
agent-budget rule add "Large Expenses" --category infra --action block --approval-above 100
# Check if an expense would violate rules
agent-budget rule check --amount 150 --category infra
# Set up a recurring expense
agent-budget recurring add "AWS Hosting" --amount 99 --category infra --frequency monthly
# Get spending summary
agent-budget summary --this-month
# Get spending forecast
agent-budget forecast --months 3
# Check alerts
agent-budget alerts
# Export data
agent-budget export --format json
MCP Server
Start the MCP server for integration with AI agents:
agent-budget serve
Or use it programmatically:
from agent_budget.mcp_server import mcp
mcp.run()
MCP Tools
Budget Tools
create_budget— Create a new budgetlist_budgets— List all budgetsget_budget— Get budget detailsupdate_budget— Update a budget's settingsdelete_budget— Delete a budgetprocess_budget_rollover— Carry unspent budget forwardget_budget_status— Check actual vs. budgeted spendingcompare_budget_actual— Detailed budget comparisonupdate_alert_thresholds— Customize alert thresholds
Expense Tools
add_expense— Log a new expenseupdate_expense— Update an existing expenselist_expenses— List expenses with filters (category, vendor, reimbursable, etc.)get_expense— Get expense detailsdelete_expense— Delete an expense
Savings Goal Tools
create_savings_goal— Create a savings targetlist_savings_goals— List savings goalsget_savings_goal— Get goal details with progresscontribute_to_savings— Add a contributionwithdraw_from_savings— Withdraw from a goalupdate_savings_goal— Update a goaldelete_savings_goal— Delete a goal
Spending Rule Tools
create_spending_rule— Create a spending control rulelist_spending_rules— List spending rulescheck_expense_rules— Check if an expense would violate rulesupdate_spending_rule— Update a ruledelete_spending_rule— Delete a rule
Recurring Expense Tools
add_recurring_expense— Set up a recurring expenselist_recurring_expenses— List recurring templatesprocess_recurring_expenses— Generate expenses from due templates
Analysis Tools
get_spending_forecast— Project future spendingget_spending_summary— Spending by categoryget_alerts— Check budget alertsclear_alerts— Clear alertsexport_data— Export all datalist_currencies— List supported currencies
Python API
from agent_budget.service import BudgetService
from agent_budget.store import BudgetStore
from agent_budget.models import BudgetPeriod, RecurringFrequency, SpendingRuleAction
# Initialize
svc = BudgetService(BudgetStore())
# Create a budget with rollover
budget = svc.create_budget(
name="API Costs",
limit=500,
period=BudgetPeriod.MONTHLY,
category="api",
rollover_enabled=True,
rollover_cap=100,
)
# Add an expense
expense = svc.add_expense(
amount=25.50,
category="api",
description="OpenAI GPT-4 call",
vendor="OpenAI",
budget_id=budget.id,
)
# Update an expense
svc.update_expense(expense.id, amount=30.00, receipt_url="https://receipt.example.com/123")
# Create a savings goal
goal = svc.create_savings_goal(
name="Emergency Fund",
target_amount=10000,
target_date=date(2027, 1, 1),
)
# Contribute to the goal
goal = svc.contribute_to_savings(goal.id, amount=500, note="Monthly deposit")
# Create a spending rule
rule = svc.create_spending_rule(
name="API Cap",
category="api",
action=SpendingRuleAction.BLOCK,
threshold_amount=500,
)
# Check budget status
status = svc.get_budget_status(budget.id)
print(f"Used {status.percent_used}% of budget")
# Process budget rollovers
results = svc.process_all_rollovers()
# Get spending forecast
forecasts = svc.get_spending_forecast(months=3)
Data Storage
All data is stored in JSON files under ~/.agent-budget/ (or the directory specified by the AGENT_BUDGET_DIR environment variable). No external database required.
Supported Currencies
USD, EUR, GBP, JPY, CAD, AUD, CHF, CNY, INR, BRL, KRW, MXN, SGD, SEK, NZD
License
MIT
Recommended Servers
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.
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.
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.
VeyraX MCP
Single MCP tool to connect all your favorite tools: Gmail, Calendar and 40 more.
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.
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.
E2B
Using MCP to run code via e2b.
Neon Database
MCP server for interacting with Neon Management API and databases
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.
Qdrant Server
This repository is an example of how to create a MCP server for Qdrant, a vector search engine.