Skip to main content
Glama
mcp-balanceai

mcp-balanceai

by sl5234
README.md
<p align="center">
  <img src="docs/assets/logo.svg" width="96" alt="BalanceAI logo">
</p>

# balanceai

An AI assistant for your personal finances.

## Demo

Link a bank (Plaid Sandbox), sync, ask about spending, and upload a receipt that
merges with its bank charge.

https://github.com/user-attachments/assets/8079a677-dd2d-449f-8ea0-c19ed82ca222


https://github.com/user-attachments/assets/1754dd0f-b755-4de2-a45b-848a146fb04c

## Why BalanceAI

- **Your books, kept for you.** Link your bank and add receipts; every
  transaction is classified and booked automatically, and a receipt merges with
  its bank charge so nothing is counted twice.
- **Ask in plain English.** Questions are answered from your own books.
- **Private by default.** Your data stays on your machine, nothing reaches the
  AI without your OK, and logs never store your transactions.

```text
> Sync my transactions
  Synced Acme Bank: 42 new transactions, booked to your "Personal" journal.

> Upload my receipt blue_bottle.jpg
  Read: Blue Bottle Coffee, $12.50 on Nov 3, card ending 0000.
  Matched it to the bank charge, so it's counted once.

> How much did I spend eating out this month?
  [Share 1 row with the assistant?  Accept / Decline]
  $186.40 across 9 purchases (Nov 1–30).
```

## Quickstart (about 5 minutes, with Plaid's test bank)

You'll need Python 3.12+, [Claude Code](https://claude.com/claude-code), a free
[Plaid](https://dashboard.plaid.com) account (Sandbox keys), and API keys for
[Anthropic](https://console.anthropic.com), [Gemini](https://aistudio.google.com/apikey)
and [Tavily](https://app.tavily.com). Not sure how to get one? Ask your AI
assistant, e.g. "How do I get a Plaid Sandbox API key?"

1. **Install**

   ```bash
   git clone https://github.com/sl5234/balanceai.git
   cd balanceai/src/balanceai_backend
   python3 -m venv venv && source venv/bin/activate
   pip install -e ".[dev]"
   ```

2. **Add your keys**

   ```bash
   cp .env.example ../balanceai_backend_secrets/.env
   chmod 600 ../balanceai_backend_secrets/.env
   ```

   Then fill in your keys, e.g.:

   ```bash
   # src/balanceai_backend_secrets/.env
   PLAID_CLIENT_ID=your-plaid-client-id
   PLAID_SECRET=your-plaid-sandbox-secret
   PLAID_ENV=sandbox

   ANTHROPIC_API_KEY=sk-ant-...
   GEMINI_API_KEY=your-gemini-key
   TAVILY_API_KEY=tvly-...
   ```

3. **Connect it to Claude Code** (from `src/balanceai_backend`)

   ```bash
   claude mcp add balanceai_bookkeeping -s user -- "$PWD/venv/bin/python" -m balanceai_backend.servers.bookkeeping_server
   claude mcp add balanceai_link_bank -s user -- "$PWD/venv/bin/python" -m balanceai_backend.servers.link_bank_server
   ```

4. **Try it**: start `claude` and ask:
   - "Link my bank" → in Plaid, pick any bank and log in with `user_good` / `pass_good`
   - "Sync my transactions" → put the accounts in a journal called "Personal"
   - "How much did I spend this month?"

To use your real bank, change these lines in
`src/balanceai_backend_secrets/.env`:

```bash
PLAID_CLIENT_ID=your-client-id
PLAID_SECRET=your-production-secret   # the Production secret, not Sandbox
PLAID_ENV=production
```

Then restart Claude Code and link your bank again; Sandbox test data stays in
the database until you delete `src/balanceai_backend_secrets/data/balanceai.db`.

More setup, every tool, and receipts:
[`src/balanceai_backend/README.md`](src/balanceai_backend/README.md).

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md).

## License

MIT. See [LICENSE](LICENSE).