Wealthfolio Automation via Antigravity CLI (agy)

Overview

Guide for Sufyan to automate personal finance bookkeeping (bank transactions, investments, dividends) in Wealthfolio on Windows using Antigravity CLI (agy) powered by his Google AI subscription. Eliminates repetitive manual entry while keeping financial data local and secure.


1. Architecture

Wealthfolio is a local-first desktop application with an SQLite backend. It includes an embedded MCP (Model Context Protocol) server that lets AI assistants safely inspect balances and record transactions through official application APIs without risking database corruption.

┌────────────────────────────────────────────────────────────────────────┐
│                        Windows 11 (PowerShell)                         │
│                                                                        │
│  [ Prompts / Bank CSVs / Trade Confirmations ]                         │
│                           │                                            │
│                           ▼                                            │
│               [ Antigravity CLI (agy) ]                                │
│                (Google AI Subscription)                                │
│                           │                                            │
│                           ▼ (Local Loopback / Port 8639)               │
│             [ Wealthfolio Embedded MCP Server ]                        │
│                           │                                            │
│                           ▼ (Safe Validation & Calculations)           │
│                 [ Wealthfolio SQLite DB ]                              │
└────────────────────────────────────────────────────────────────────────┘

2. Prerequisites & Initial Setup

Step 1: Install & Authenticate agy in PowerShell

  1. Open PowerShell on Windows and verify agy is installed:
    agy --version
  2. Log into your Google AI Plus / Gemini subscription:
    agy auth login
    Follow the browser prompt to link your Google account.

Step 2: Enable MCP in Wealthfolio Desktop

  1. Open Wealthfolio on Windows.
  2. Go to Settings Agent / MCP Access.
  3. Toggle Enable Local MCP Server to On (default port: 8639).
  4. Click Create Personal Access Token (PAT), assign it a name (e.g., agy-cli), grant Read & Write scopes, and copy the generated token.

Step 3: Configure agy to Connect to Wealthfolio

In PowerShell, edit or create the global MCP configuration file:

  • File path: $env:USERPROFILE\.gemini\config\mcp_config.json

Add the Wealthfolio MCP endpoint:

{
  "mcpServers": {
    "wealthfolio": {
      "serverUrl": "http://127.0.0.1:8639/mcp",
      "headers": {
        "Authorization": "Bearer YOUR_COPIED_PAT_TOKEN_HERE"
      }
    }
  }
}

Fallback / Verification

Test connectivity in PowerShell by asking agy:

agy "Check my Wealthfolio connection: list my accounts and current net worth"

3. Daily Automation Workflows

Once connected, Sufyan never needs to type in transactions manually in the UI.

Workflow A: Natural Language Entry (Single Trades & Cash)

Simply launch agy in PowerShell and give plain-English instructions:

# Buying stocks/ETFs
agy "I bought 4 shares of VOO at $512.40 with $0 fees in my Fidelity account today. Record this transaction in Wealthfolio."
 
# Recording dividends
agy "Record a $24.50 dividend received from MSFT into my Charles Schwab account on 2026-09-12."
 
# Bank expense / transfer
agy "Record an expense of $145.20 from Chase Checking categorized as 'Groceries' today."

Workflow B: Bulk Bank Statements & Broker CSV Ingestion

Instead of manually typing out a monthly PDF or CSV statement:

  1. Download your broker or bank statement CSV into a working folder (e.g., C:\Finance\statements\).
  2. Run agy pointing to the file:
    cd C:\Finance\statements\
    agy "Review statement_august.csv. Parse all buy, sell, and dividend transactions, match them with my existing Wealthfolio accounts, and record them."
  3. agy will present a summary of matched items and ask for confirmation before committing them to the ledger.

4. Multi-Device & Cloud Sync (The Reality)

Why Naive Cloud Sync (GitHub / Cloud Folders) is Tricky

  • Binary SQLite Conflicts: Wealthfolio stores data in an SQLite database. Git cannot merge binary files line-by-line; pushing to GitHub will cause repository bloat and unresolvable merge conflicts.
  • Locking & Corruption: Syncing active SQLite files (.db, .db-wal) while Wealthfolio is running can corrupt the database.
  • iOS App Sandboxing: The iOS app has no terminal or background file sync; it cannot pull changes from GitHub or external scripts.

Viable Options for Phone Access:

  1. Official Wealthfolio Connect (Paid Subscription):
    • Wealthfolio’s built-in End-to-End Encrypted (E2EE) cloud service (Settings -> Sync & Connections).
    • Pairs once via QR code; automatically syncs desktop and iPhone in the background.
  2. Self-Hosted Docker Server (Free Alternative):
    • Wealthfolio provides an official free Docker container (wealthfolio/wealthfolio:latest).
    • Running this on a home server or free cloud VM allows browser/PWA access from iPhone with zero sync friction, while agy manages data via the container’s MCP port.
  3. Desktop-First (Recommended for Simplicity):
    • Treat the Windows PC as the master financial ledger maintained in seconds via agy.
    • For checking balances on the go without paying for Connect, let agy export a private read-only snapshot (e.g., Markdown or HTML dashboard) to Google Drive or iCloud.

5. Maintenance & Safety Checklist

  • Back up before big imports: Run Settings -> Exports & Backups -> Backup Database periodically to keep a timestamped .db snapshot.
  • Keep Wealthfolio running: The local MCP server runs as a background process within the desktop app; Wealthfolio should be open or minimized when agy executes commands.
  • Review before commit: For multi-line statement imports, always inspect agy’s parsed transaction table before confirming the batch commit.