Copiloto Financeiro MCP Server

Copiloto Financeiro MCP Server

Enables AI agents to manage personal finances for Brazilian users through MCP tools, including categorizing transactions, reconciling debts, checking cash-flow projections, and adjusting budgets, with integration to Open Finance Brasil via Pluggy.

Category
访问服务器

README

Copiloto Financeiro

🇧🇷 Leia em português

Self-hosted personal finance copilot, built for Brazil. Pulls bank transaction history daily from Pluggy (Open Finance Brasil), stores it in SQLite, and answers: how much am I spending, will I be able to meet upcoming costs, and if not, what do I need to adjust. Supports a whole household — each person keeps their own bank connection and data, and debts can be explicitly shared between people.

A Bun-workspace monorepo: backend/ is the Elysia server (API + auth + cron sync + migrations), frontend/ is a Vite + React SPA, and shared/ holds the TypeScript types for the wire format between them. See ARCHITECTURE.md for how it fits together and backend/API-ARCHITECTURE.md for what belongs on which backend route. Contributing? Read CONTRIBUTING.md first.

Philosophy

Built for a specific person: a Brazilian developer who already works with AI agents every day and wants to run their own (or their family's) finances the same way — spreadsheets stopped scaling, and a SaaS budgeting app you can't change to fit how your own money actually works isn't the answer either.

Built AI-agent-first, for Brazilians. Every domain operation this app has — categorizing a transaction, reconciling a debt, checking next month's projection, adding a category rule — exists as an MCP tool (backend/src/mcp-server.ts) before it exists as a REST route with a form on top. Claude is the primary client this is built and tested against today, but the tools speak plain MCP, so any agent that can hold an MCP connection can drive the app the same way. The web UI isn't a second-class citizen — it's the same operations, the same backend functions, just reached by clicking instead of asking. And it's built on Open Finance Brasil via Pluggy from day one, not a generic budgeting tool with a Brazilian bank integration bolted on — that's the whole foundation, not a feature.

A few concrete principles that follow from that:

  • Don't like what it's showing? Change it. This ships with only the basics of personal finance — accounts, categories, bills, debts, a cash-flow projection — and deliberately isn't opinionated beyond that. It's not trying to anticipate every household's workflow with a settings screen for each one (see the notification rules above: env var + a function you edit, not a rules-builder UI). If something doesn't match how your own money works, the expectation is you fork it and change the code, not file a feature request and wait.
  • The backend is the source of truth for every number. Anything that looks like a calculation — a debt payoff date, a category breakdown, a net-worth figure — is computed once, on the server, and shipped to the frontend (and to an agent, via MCP) as a finished value. Neither one re-derives it. This was violated a few times early on (see backend/API-ARCHITECTURE.md's fix log) and every time it caused the UI to quietly disagree with itself across pages — and it's exactly what keeps the MCP tools and the REST API from ever disagreeing about what a number means, since they call the exact same functions.
  • Real data over fixtures, when it matters. Pluggy's pagination and balance-sign quirks only ever surfaced when testing against a real bank connection — a hand-rolled fixture would have happily hidden the same bug. Automated tests still run against a real (if throwaway) SQLite database rather than a mocked ORM, for the same reason.
  • Additive over rewritten. New features (household member profiles, shared debts, notification rules) were built as extensions of the existing model rather than a redesign — a shared debt is still one row, now with an optional pointer to who it's shared with, not a new subsystem.
  • No more layers than the problem needs. The backend is routes + services, not routes + services + repositories — a third layer was considered and dropped because nothing in this codebase needed the extra indirection. Add structure when duplication or a real bug demands it, not in advance of one.
  • Sized to be forked, not just used. No feature flags, no multi-tenant auth, no premature abstraction for hypothetical future users of this deployment — but the domain logic stays behind clean route/service boundaries specifically so someone running their own fork can change categorization rules, add a new resource, wire up a new MCP tool, or add a new notification provider without fighting the architecture to do it.

Setup

This app only reads from Pluggy — it doesn't handle connecting your bank accounts itself. Use meu-pluggy (Pluggy's own reference app, built on their Connect widget) to link each bank account and get the Item ID(s) you then paste in here per person.

  1. Copy .env.example to .env. The only value you actually need to set is SESSION_SECRET (any long random string, e.g. openssl rand -hex 32) — everything else in there is optional:
    • PLUGGY_CLIENT_ID / PLUGGY_CLIENT_SECRET / PLUGGY_ITEM_IDS are a one-time bootstrap only, for carrying over credentials from before household member profiles existed. Pluggy credentials normally live in the database now, entered per-person from /config after setup — leave these blank for a fresh install.
    • CRON_SCHEDULE (default 0 6 * * *) — when the daily sync runs.
    • MIN_BUFFER (default 0) — balance floor below which a projected month is flagged as a shortfall.
    • LARGE_TRANSACTION_THRESHOLD (default 500) — notification rule: flag any newly synced transaction at or above this amount (BRL).
    • PUSHOVER_APP_TOKEN / SMTP_HOST + friends — only needed if you want push notifications; see "Notifications" below.
    • PORT (default 3000) / DB_PATH (default ./data/budget.sqlite).
  2. Install dependencies (single lockfile, all three workspaces): bun install
  3. Run the dev servers: bun run dev runs backend + frontend together in one terminal (via concurrently). To run them separately in two terminals instead:
    • bun run dev:backend — backend on :3000 with hot reload (also runs DB migrations on boot)
    • bun run dev:frontend — Vite dev server, proxies /api and /public to the backend
  4. Visit the Vite dev server URL's /setup to create the admin account. Login is single-admin (one household, no signup). Once you're in, add each household member from /config — name, color, and their own Pluggy Client ID/Secret/Item IDs — and roll everyone up in the /household view.

Notifications

After every sync, a small set of rules (backend/src/services/notifications/rules.ts) checks what changed — a transaction over LARGE_TRANSACTION_THRESHOLD, a projected shortfall next month — and, the first time each one fires, creates a notification and delivers it through whichever channels you've enabled for that person from /config:

  • Pushover — set PUSHOVER_APP_TOKEN (one app-level token for the whole deployment, from pushover.net), then each person adds their own Pushover user key from /config.
  • Email — set SMTP_HOST/SMTP_PORT/SMTP_USER/SMTP_PASS/SMTP_FROM (one relay for the whole deployment), then each person adds their own destination address.

Both are tested from the same /config panel before you rely on them. Adding a new provider or rule is a code change (see the doc comments in backend/src/services/notifications/), not a UI-configurable system — this is meant to be forked and adjusted, not built as a general-purpose rules engine nobody needed yet.

Development

  • bun run dev — both dev servers together in one terminal; bun run dev:backend / bun run dev:frontend — the same two, separately
  • bun run build — build the frontend (Vite → frontend/dist), served by the backend in production
  • bun run start — run the backend from the repo root, serving the built frontend
  • bun run typecheck — type-check both backend/ and frontend/

The daily sync runs on CRON_SCHEDULE (default 0 6 * * *) and also once at startup if the last successful sync is more than 24h old. You can also trigger it manually: POST /api/sync/run (requires an authenticated session).

Deploying with Docker Compose (CasaOS)

docker compose up -d --build

This builds the image, runs migrations automatically on boot, and persists the SQLite database at ./data/budget.sqlite via a bind-mounted volume. On CasaOS, point the compose app / custom-install feature at this docker-compose.yml, and mount the volume under /DATA/AppData/copiloto-financeiro per CasaOS convention (edit the volumes: path in docker-compose.yml accordingly).

The container exposes port 3000 internally, mapped to 8080 on the host by default — adjust in docker-compose.yml if that conflicts with something else on your CasaOS box.

Exposing it to the internet (Caddy + WireGuard + Oracle Cloud)

This app does not need its own DDoS/exposure hardening — it's designed to sit behind a reverse proxy you already run elsewhere (e.g. an Oracle Cloud box running Caddy, reached from your home server over WireGuard). It only needs a login (built in) and to bind to a port Caddy can reach. Example snippet for your existing Caddyfile:

copiloto.example.com {
    reverse_proxy <wireguard-ip-of-this-box>:8080
}

Caddy handles TLS termination and sits in front of the app; the home box is never directly reachable from the internet. The app itself rate-limits the login endpoint as defense-in-depth on top of that.

推荐服务器

Baidu Map

Baidu Map

百度地图核心API现已全面兼容MCP协议,是国内首家兼容MCP协议的地图服务商。

官方
精选
JavaScript
Playwright MCP Server

Playwright MCP Server

一个模型上下文协议服务器,它使大型语言模型能够通过结构化的可访问性快照与网页进行交互,而无需视觉模型或屏幕截图。

官方
精选
TypeScript
Magic Component Platform (MCP)

Magic Component Platform (MCP)

一个由人工智能驱动的工具,可以从自然语言描述生成现代化的用户界面组件,并与流行的集成开发环境(IDE)集成,从而简化用户界面开发流程。

官方
精选
本地
TypeScript
Audiense Insights MCP Server

Audiense Insights MCP Server

通过模型上下文协议启用与 Audiense Insights 账户的交互,从而促进营销洞察和受众数据的提取和分析,包括人口统计信息、行为和影响者互动。

官方
精选
本地
TypeScript
VeyraX

VeyraX

一个单一的 MCP 工具,连接你所有喜爱的工具:Gmail、日历以及其他 40 多个工具。

官方
精选
本地
graphlit-mcp-server

graphlit-mcp-server

模型上下文协议 (MCP) 服务器实现了 MCP 客户端与 Graphlit 服务之间的集成。 除了网络爬取之外,还可以将任何内容(从 Slack 到 Gmail 再到播客订阅源)导入到 Graphlit 项目中,然后从 MCP 客户端检索相关内容。

官方
精选
TypeScript
Kagi MCP Server

Kagi MCP Server

一个 MCP 服务器,集成了 Kagi 搜索功能和 Claude AI,使 Claude 能够在回答需要最新信息的问题时执行实时网络搜索。

官方
精选
Python
e2b-mcp-server

e2b-mcp-server

使用 MCP 通过 e2b 运行代码。

官方
精选
Neon MCP Server

Neon MCP Server

用于与 Neon 管理 API 和数据库交互的 MCP 服务器

官方
精选
Exa MCP Server

Exa MCP Server

模型上下文协议(MCP)服务器允许像 Claude 这样的 AI 助手使用 Exa AI 搜索 API 进行网络搜索。这种设置允许 AI 模型以安全和受控的方式获取实时的网络信息。

官方
精选