Appearance
0041: An account home, usage recording and an owners' view
Context
Rob (director) found /start confusing. One page mixed sign-up, the terms, connecting Xero, the subscription and the steps to add the Claude connector; he could not tell whether he had to subscribe or where to go next, and there was no home on the web to come back to. Separately, the owners of Get My Books Ltd cannot tell whether anyone uses the product, which a buyer will ask (goal: ready to sell).
docs/not-doing.md said "Dashboard or chat UI of our own: Claude is the interface". The reason still holds for the books: the checks, the findings and every change are made in Claude. It does not need to rule out a page about the account itself.
Decision
- An account home at
/on mcp.getmy.group (SPEC-018). It shows each of the person's companies: Xero connected, profile set, subscription status, Manage billing, and this month's use (counts only); whether Claude is connected, or the steps to connect it; and the account links./startkeeps only sign-up and accepting new terms, and everything else lands on/. No figure from any company's books is shown. - Usage recording. After every MCP
tools/call, the server records the tool's name, whether it worked, who called it and which company (when the call named one this person can see) inusage_event.- Recorded: principal, company (or none), time, tool name, outcome (
okorerror). - Never recorded: the arguments, the result, figures, file names, findings, anything said in Claude, or any other books content. This keeps ADR 0036 rule 1: staff never see a customer's books.
- Recording is not awaited and its failure is only logged, so it never slows or changes a tool call.
- Row-level security: a person adds only their own rows, for no company or a company they have access to, and reads the rows of their companies and their own rows with no company. The app cannot change or delete a row.
- Retention: 13 months, so a year can be compared with the year before.
delete_old_usage_events()deletes older rows from the 15-minute sweep. Deleting a company or an account deletes its rows at once (the foreign keys cascade). The privacy notice lists the records: Get My Books Ltd is controller, on legitimate interests (running, supporting and improving the service).
- Recorded: principal, company (or none), time, tool name, outcome (
- An owners' view at
/admin, for the two operators only, showing aggregates: counts, the sign-up funnel, weekly active companies, per-tool use and errors, a per-company list (company names, not people) and the monthly revenue: the sum of what active, non-comped subscriptions charge after discounts, in pence, recorded by the webhook (migration 0022,admin_revenue(); amended 2026-10-15). No books data, no Xero tokens or tenant ids, no Stripe ids and no emails. - The owners' view's security model.
- Cloudflare Access has a separate path application on
mcp.getmy.group/adminthat admits only the two operators through the "GetMy (getmy.group)" Entra login with MFA (ADR 0020's operator policy). Its tokens carry their own AUD, which the app receives asCF_ACCESS_ADMIN_AUD(optional: without it/adminanswers 503). - The app verifies the
Cf-Access-Jwt-Assertiontoken against that AUD, with a second verifier, and checks the email against a fixed list of the two operators insrc/web/admin.ts(fraser.duncan@feaw.co.uk,rob.duncan@feaw.co.uk). A customer's token (the main AUD) is refused with 401; a valid admin token for anyone else, with 403. Refusals are logged without the email. - The data comes from
public.admin_overview(), a security definer function owned by the owner role, with a fixedsearch_path(pg_catalog, pg_temp) and schema-qualified names, executable only by the app role (revoked from public). The app role is under row-level security and cannot read across companies, so this function is the one place that can. It returns aggregates and company names only. The app role can call it, so the gate on who sees its result is the Access path application plus the operator check, both in front of the one route that calls it. No MCP tool calls it.
- Cloudflare Access has a separate path application on
- The not-doing line narrows to "Dashboard of the books themselves": the account home and the owners' view are allowed; the books stay in Claude.
Consequences
- People land on one page that says what to do next;
/startis short. SPEC-017 S2, S6 and S19 are amended by SPEC-018. usage_eventgrows by one row per tool call; 13 months at today's volume is small. The (entity, time) and (principal, time) indexes serve the home.- Anyone who can run code as the app role can call
admin_overview()and read the aggregates (company names and counts). That is the same trust boundary as the rest of the app: the app role already holds every customer's encrypted Xero tokens. - The Product Owner creates the
/adminAccess application and setsCF_ACCESS_ADMIN_AUDin Dopplerprd; until then/adminanswers 503.
Notes
2026-11-04, accepted residual risks from the codebase review (#297; Decided by: Product Owner):
- The approval token in the preview's
_meta. A Xero write preview puts its one-time approval token in the tool result's_meta(src/mcp/approval-card.ts). The MCP Apps spec keeps_metafrom the model: the host hands it to the approval card, not to Claude, and thewrite_preview_decidetool the card calls is app-only. Approve is pressed by the owner in the card. The token is 32 random bytes, and only its SHA-256 is stored (src/banks/write-preview.ts). It is tied to one preview: it is accepted only with that preview's ID, for the person and company that made the preview, while the preview is live (not yet approved, declined or written, and within its 60 minutes), and the one statement that approves the preview also claims it, so it works once. This depends on the host keeping_metafrom the model; it is accepted as is, with no further server-side binding. - The shared statements folder. The local server reads statement files from one folder shared by every company on that server; each tool that takes
statementFilesrefuses them unless the owner has confirmed the file names and dates (filesConfirmedByOwner). Accepted for the local server until deploy hardening's DH-6 and DH-8 (decided 2026-11-04) replace it with CSV content passed per company through the deployed endpoint.
Owner actions (Cloudflare and Doppler)
| Where | Setting |
|---|---|
| Cloudflare Access, new self-hosted application | Name "GetMy Books owners' view"; domain mcp.getmy.group, path admin; session 8h |
| Its policy | Allow; Include the two operators' emails; Require login method "GetMy (getmy.group)" Entra (with MFA, as ADR 0020) |
Doppler prd | CF_ACCESS_ADMIN_AUD = that application's AUD tag; then redeploy |