Repository navigation
Add MCP server for budget and cash-flow analysis - #1
Merged
Merged
Conversation
Exposes FinanceService over stdio MCP so agents can query balance, forecasts, and a new sweepable-cash calculation (lowest forecasted balance minus a configurable safety buffer) instead of pulling raw transactions and doing the math in-context. Also generalizes the forecast from a hardcoded 90 days to an arbitrary horizon.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
cmd/mcp) that exposesFinanceServiceas tools an agent can call directly:get_balance,get_cash_flow_forecast,get_sweepable_cash,set_safety_buffer,list_upcoming_transactions,list_recurring_transactions,add_income,add_expense,set_starting_balance.safety_buffersetting andCalculateSweepableCash: sweepable amount = lowest forecasted balance over a horizon minus the safety buffer. Answers "how much free cash flow do I have" / "how much can I move to savings, investing, or debt paydown" without the agent re-deriving it from raw transactions.Calculate90DayForecastintoCalculateForecast(ctx, balance, days)so forecasts aren't limited to 90 days (ripples through the HTTP API's?days=param and the CLI).make build-mcp/make run-mcptargets.Test plan
go build ./...,go vet ./...,go test ./...all passbin/currentz-mcpand drove it end-to-end via a real MCP client (stdio JSON-RPC): all 9 tools list correctly with auto-inferred schemas, calls round-trip, errors propagate cleanlygoose/createdbnot being installed) and sanity-checkget_sweepable_cashmath against a known scenario before relying on it for real decisionsclaude mcp add currentz --scope user -e DB_URL=... -- ./bin/currentz-mcpand try it from a live Claude Code session🤖 Generated with Claude Code