Writing
Notes from things that actually shipped.
Multi-tenant architecture, MCP agents running inside real products, and how to prove a refactor changed nothing. Written in English, from production, with the client names left out.
-
Four MCP servers became one, and the reason was a bug that shipped three times
We had one MCP server per product. They were copies of the same scaffold, so a single bad SQL guard shipped as three separate bugs. Here is what we replaced them with, and how we proved it before switching anything off.
- · MCP
- · multi-tenant
- · architecture
-
One validated query, three doors: adding a CLI without adding a bypass
tenant-scoped-rag grew a second MCP transport and a clipboard-delivery CLI for local LLMs that speak neither stdio nor HTTP. The design question was not "does it work" but "does walking through the new door skip the check the old ones enforce."
- · MCP
- · RAG
- · CLI
- · architecture
-
A cell that starts with "=" is not data: sanitizing exports against formula injection
A CSV/Excel export endpoint treated every cell as text, but a spreadsheet application does not. Four leading characters turn a cell into a formula, one shared export base class fixes it for every report at once, and the test that matters checks the byte at index zero, not the string.
- · security
- · sanitization
- · CSV
- · testing
-
The database refuses: proving tenant isolation instead of asserting it
A RAG server where the RLS policy carries the isolation, not the application query. 180 cross-tenant queries, zero leakage, and a canary test that deliberately breaks isolation to prove the suite would catch it if it ever happened for real.
- · PostgreSQL
- · RLS
- · multi-tenant
- · RAG
- · MCP