One Connector, N Tenants: A Multi-Tenant Hosting Architecture for the Model Context Protocol with Per-Product Audience Binding
Abstract Large language model (LLM) hosts — Claude, ChatGPT, Mistral, and emerging open hosts — deliver tool-result content to users through a small set of fixed modalities: streaming text, static images, hand-coded interactive widgets, and (more recently) static inline iframes via the SEP-1865 MCP Apps extension. We identify a missing modality: streaming, auto-generated, interactive HTML that fills in live in the chat area as the model produces it. We present two compositional techniques that together provide this modality without requiring any change to LLM host code, and without writing per-endpoint UI: Auto-generated UI from JSON shape detection — a server-side engine reads a configuration declaring "wrap these N REST endpoints as Claude tools", and at each tool call fetches the endpoint, classifies the JSON response shape, selects a renderer (KPI grid / horizontal bar chart / SVG sparkline / data table / definition list / fallback), produces a self-contained HTML document, writes it to a temporary buffer, and returns the ui:// resource URI for the host to fetch and render in an inline sandboxed iframe. No UI code is written for any specific endpoint. Streaming HTML into the chat area via partial-input subscription — the host's existing ontoolinputpartial SDK callback delivers progressively-healed partial JSON of the tool arguments to the iframe view code. View code subscribes, reads the html argument on each frame, and assigns it to iframe.srcdoc at a 60-millisecond throttle. The result is a fill-in-live preview in the chat area, completing approximately 200–500 milliseconds before the tool call itself has returned. We characterise the design space these techniques open, present a six-shape JSON classifier and matching server-side HTML renderers, describe a working reference implementation deployed against a multi-tenant MCP platform behind a single Cloudflare tunnel, and identify three immediate UX consequences: (a) conversational interfaces can now display real-time visualisations of any REST API without per-endpoint UI investment, (b) the perceived latency of tool calls drops because users see useful output before the tool returns, and (c) the same primitive supports generated dashboards, drafted documents, and exploratory data views — categories that previously required either custom host code or post-hoc text-to-image rendering. We discuss the empirical envelope (bundle size, throttle range, shape-detection accuracy), the security model (CSP sandboxing on the iframe), and the spec contributions we propose to formalise the pattern. This paper is a companion to the architectural work One Connector, N Tenants [16] which describes the multi-tenant MCP hosting platform on which this UI primitive runs. The reference implementation is available under CC BY 4.0 (see Appendix A).
Paper
The full text of this publication is not hosted on 44B due to licensing.
Read it at OpenAlex