/projects/Jan 15, 2026
T4A AI Chat Platform
Production internal AI chat at chat.time-4-action.com. Next.js + Vercel AI SDK + Auth0, MongoDB token tracking reconciled against Anthropic billing. FastMCP server over SSE.
next.jsmcpauth0anthropic
The shape of the problem
The company needed a chat surface that could reach into its own systems — product data, order status, partner permissions — without shipping that data to a third party. It also needed to track who spent what, because Anthropic bills in tokens and finance bills in euros.
What I built
A Next.js app that speaks the Vercel AI SDK to Claude on one end and to a FastMCP server over SSE on the other. Auth0 handles identity; MongoDB keeps per-user token ledgers that reconcile against the Anthropic invoice at month close.
Lessons
- Reconciliation is the feature. The chat is just the UI.
- MCP over SSE is faster to ship than MCP over stdio for web workloads, but the reconnection semantics need care.
- Token accounting should be done server-side, at tool-call boundaries, not guessed from prompt length.