Broc Everywhere
Officialby broc-fi
README.md
# Broc Everywhere — Universal AI Chat & MCP Server (`@broc-fi/broc-mcp`)
> **Where financial noise becomes peace.** Standalone product bringing Broc's Multi-Bank CSV Analyzer (**Clara**), Irish Price & Yield Strategist (**Clive**), Sankey Cash Flow Mapper, and platform knowledge directly inside the chat window of **any LLM interface** — with **zero local plugin install required**.
>
> **Session Handoff & Go-Live Checklist**: See [HANDOFF.md](./HANDOFF.md) for current Cloud Run status, architecture decisions, `mcp.broc.fi` domain mapping, and directory submission steps.
---
## How Any LLM Interface Accesses Broc (No Custom Plugin Install Needed)
Once deployed to a public HTTPS URL (e.g. `https://mcp.broc.fi` on Google Cloud Run), every major AI chat interface is covered across three zero-install layers:
| Target LLM Interfaces | How Users Access It (Zero Local Install) | How CSVs in the Chat Window Are Processed |
| :--- | :--- | :--- |
| **Any LLM** (Gemini, Perplexity, Microsoft Copilot, Grok, Mistral Le Chat, DeepSeek, vanilla ChatGPT & Claude) | **1-Click Launchpad (`/launch`) or Universal Skill URL (`/skill.md`)** — user clicks *"Open in..."* or pastes `Read https://<host>/skill.md` alongside their attached CSV | LLM fetches `/skill.md`, runs Clara's embedded zero-dependency Python auditor (`clara_audit.py`) on the attached CSV inside its built-in sandbox, benchmarks against Clive's live Irish tariff table (or `GET /api/v1/price-compare`), and explains Broc's purpose |
| **ChatGPT (All Free & Plus Users)** | **Public Custom GPT Link** (`chatgpt.com/g/...`) backed by `/openapi.json` | Native **`openaiFileIdRefs`** support: ChatGPT passes signed `download_link` URLs for up to 10 attached CSVs directly to `POST /api/v1/csv/analyze` — parsing 10,000+ rows in milliseconds with zero LLM token truncation |
| **Claude.ai, ChatGPT Connectors, Le Chat, Cursor, LibreChat, TypingMind, Open WebUI** | **Paste 1 Remote MCP URL (`/mcp`)** in Settings → Integrations / Connectors | Streamable HTTP MCP (`analyze_bank_csv` accepting `csvText`, `csvBase64`, `csvUrl`, `csvFiles`) + inline interactive HTML dashboards (`text/html;profile=mcp-app` & `text/html+skybridge`) |
---
## Security & Multi-User Isolation
- **Per-Connection MCP Isolation**: Every `/mcp` and `/sse` connection receives a unique 128-bit cryptographic namespace (`mcp_<32-hex>`). Concurrent users can never read, overwrite, or clear each other's statement sessions, and sessions are purged automatically on disconnect.
- **128-Bit Opaque REST Session Tokens**: Stateless HTTP endpoints (`/api/v1/csv/*` and `/widgets/*`) never accept predictable session names like `"default"`. Every upload mints a fresh `broc_sess_<32-hex>` token with **30-minute idle TTL** (`BROC_SESSION_TTL_MS`), LRU capacity cap (`BROC_MAX_SESSIONS=500`), and `Cache-Control: no-store` + `Referrer-Policy: no-referrer`.
- **SSRF & Encoding Hardening**: Remote CSV attachment downloads (`openaiFileIdRefs` / `csvUrl`) enforce HTTPS-only, DNS resolution checks blocking all private/loopback/link-local/Cloud-Run-metadata (`169.254.169.254`) IPs across redirects, a 10 MB byte cap, and automatic UTF-8 / UTF-16 / Windows-1252 (`€`) decoding. Server local filesystem reads (`filePath`) are disabled by default (`BROC_DISABLE_LOCAL_FILE_READ=1`).
---
## Included Capabilities
| Pillar | MCP Tools | HTTP / OpenAPI Endpoints |
| :--- | :--- | :--- |
| **1. CSV Statement Analyzer & Sankey Cash Flow (Clara)** | `analyze_bank_csv`, `get_sample_spending_analysis`, `get_cash_flow_sankey`, `query_imported_transactions`, `clear_statement_session` | `POST /api/v1/csv/analyze` (JSON, `openaiFileIdRefs`, `csvBase64`, `csvUrl`, or raw `text/csv`), `GET /api/v1/csv/sample`, `POST /api/v1/csv/sankey`, `GET /api/v1/csv/transactions`, `DELETE /api/v1/csv/session` |
| **2. Irish Price Compare — Help Me Shop (Clive)** | `compare_prices`, `list_price_compare_categories` | `GET` & `POST /api/v1/price-compare`, `GET /api/v1/price-compare/categories` |
| **3. Universal Zero-Install LLM Kit** | — | `GET /launch`, `GET /skill.md`, `GET /clara-audit.py`, `GET /.well-known/mcp.json` |
| **4. Broc Purpose, Docs & Blog** | `get_broc_docs`, `list_blog_posts`, `get_blog_post`, `broc://docs/*` | `GET /api/v1/docs`, `GET /api/v1/blog/posts`, `GET /llms.txt`, `GET /llms-full.txt` |
### Supported Bank Statement CSV Formats
- **Revolut** (Standard export, Consolidated Statement v2, Revolut Instant Access Savings)
- **AIB** (Current Account, Online Saver / Savings, Credit Card, plus 7/9/12-column headerless exports)
- **Bank of Ireland** & **PTSB / Open24** (headered and 5-column headerless exports)
- **N26**, **Bunq**, **Monzo**, **Nationwide**, and generic `,` / `;` / `\t` CSVs (with EU & Anglo decimal parsing, UTF-8/UTF-16/Windows-1252 decoding, and multi-currency FX conversion to EUR).
---
## Quick Start (Local Development & Verification)
```bash
npm install
npm test
npm start
```
- **Universal Launchpad**: `http://localhost:8080/launch`
- **Zero-Install LLM Skill**: `http://localhost:8080/skill.md`
- **Streamable HTTP MCP**: `http://localhost:8080/mcp`
- **OpenAPI 3.1 Spec**: `http://localhost:8080/openapi.json`
## Deploying to Google Cloud Run
```bash
gcloud run deploy broc-mcp \
--source . \
--region europe-west1 \
--allow-unauthenticated \
--port 8080 \
--memory 512Mi
```
*(After deploying, optionally map a clean custom subdomain like `mcp.broc.fi` or `ai.broc.fi` and set `PUBLIC_BASE_URL=https://mcp.broc.fi`.)*
## Setup Guides
- **ChatGPT (Custom GPT Store + Launch Link + MCP)**: [chatgpt/connector-setup.md](./chatgpt/connector-setup.md)
- **Claude (`claude.ai` Launch Link + Remote MCP)**: [claude/connector-setup.md](./claude/connector-setup.md)
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues