You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Proposal] Add support for UI Resource Templates in SEP-1865 #298
The current draft of SEP-1865 primarily focuses on static UI resources. However, the core Model Context Protocol already defines Resource Templates for dynamic URI resolution. If we support ResourceTemplates it would make Server-Side Rendering (SSR) for MCP Apps very-very powerful.
Proposed Specification Change
We should explicitly allow _meta.ui.resourceUri to be an MCP Resource Template (URI Template - RFC 6570).
Alignment: Leverage the existing MCP mechanism where tools can reference template-based URIs.
SSR Logic: Instead of the UI performing client-side data fetching, the request goes to the server for a specific resource and server the server generates the entire page (good old simple SSR).
Efficiency: This allows the server to return pre-rendered HTML specifically for this resource.
Example
1. Tool Definition (on Server)
The server registers a tool with a template URI:
The concern here is that template variables come from structuredContent — which is part of the tool response. This means the host can't resolve the resource URI until the tool fully completes. In practice that timeline looks like:
Agent streams tool input (takes time)
Tool executes on the server (takes time)
Tool response arrives — now we finally know the URI, fetch the resource, and show the app
With a static resourceUri in the tool definition, the host already knows exactly what to fetch the moment the tool call starts — so it can preload and show the app immediately, no waiting.
While the template approach is convenient for developers who want to avoid client-side JS, the latency tradeoff is hard to justify — users would have to wait significantly longer to see any UI.
@antonpk1 thanks for the explanation the preloading benefit makes sense, and I wasn't thinking of that. Mainly because from my perspective, without the tool response, the app provides little value to show.
In many cases the tool's output determines what data gets displayed (e.g., a search or lookup). In those scenarios, the client still has to wait for the tool to complete before fetching data anyway. So in practice it would look like this:
Tool response arrives — now we have actionable data
MCP App executes JS to fetch data
Only then is the app actually useful.
So the latency difference between SSR and client-side rendering becomes pretty negligible.
I think there are real tradeoffs on both sides, and one that weighs on me is developer complexity. MCP apps are exciting and data visualization would benefit end users in a lot of cases.But if the barrier to entry is too high, many apps simply won't get built at all.
Given that, would it make sense to support both approaches and let MCP App developers choose based on their use case?
Happy to hear if there are other considerations I might be missing.
@rinormaloku thanks for the proposal!
To add to @antonpk1’s performance considerations, there are also auditing and security concerns on the host side.
In the original MCP-UI, it was possible to return dynamic resources, which was great for development, but it meant hosts couldn’t easily audit, verify, or cache resource contents and assets (btw, this is also a requirement in the Apps SDK).
The “hardened” requirement for static, predefined resources was also driven by these constraints, particularly from larger hosts.
It's a very good point and a common request, and this may be loosened in the future (especially if we allow rendering arbitrary inner iframes), the current considerations/requests that drove it were around auditing, caching, and performance. I 100% agree we need to keep DX as a main consideration, and definitely not get to a point where "apps won't be built" because of this.
Activity
antonpk1 commentedon Jan 20, 2026
Thanks for the proposal!
The concern here is that template variables come from
structuredContent— which is part of the tool response. This means the host can't resolve the resource URI until the tool fully completes. In practice that timeline looks like:With a static
resourceUriin the tool definition, the host already knows exactly what to fetch the moment the tool call starts — so it can preload and show the app immediately, no waiting.While the template approach is convenient for developers who want to avoid client-side JS, the latency tradeoff is hard to justify — users would have to wait significantly longer to see any UI.
rinormaloku commentedon Jan 21, 2026
@antonpk1 thanks for the explanation the preloading benefit makes sense, and I wasn't thinking of that. Mainly because from my perspective, without the tool response, the app provides little value to show.
In many cases the tool's output determines what data gets displayed (e.g., a search or lookup). In those scenarios, the client still has to wait for the tool to complete before fetching data anyway. So in practice it would look like this:
Only then is the app actually useful.
So the latency difference between SSR and client-side rendering becomes pretty negligible.
I think there are real tradeoffs on both sides, and one that weighs on me is developer complexity. MCP apps are exciting and data visualization would benefit end users in a lot of cases. But if the barrier to entry is too high, many apps simply won't get built at all.
Given that, would it make sense to support both approaches and let MCP App developers choose based on their use case?
Happy to hear if there are other considerations I might be missing.
liady commentedon Jan 21, 2026
@rinormaloku thanks for the proposal!
To add to @antonpk1’s performance considerations, there are also auditing and security concerns on the host side.
In the original MCP-UI, it was possible to return dynamic resources, which was great for development, but it meant hosts couldn’t easily audit, verify, or cache resource contents and assets (btw, this is also a requirement in the Apps SDK).
The “hardened” requirement for static, predefined resources was also driven by these constraints, particularly from larger hosts.
It's a very good point and a common request, and this may be loosened in the future (especially if we allow rendering arbitrary inner iframes), the current considerations/requests that drove it were around auditing, caching, and performance. I 100% agree we need to keep DX as a main consideration, and definitely not get to a point where "apps won't be built" because of this.