-
Notifications
You must be signed in to change notification settings - Fork 64
Description
Motivation
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:
{
"name": "get_pizza_details",
"_meta": {
"ui": { "resourceUri": "ui://pizzas/{pizzaId}/details" }
}
}
2. Tool Response
The tool returns the specific ID in the structuredContent:
{
"structuredContent": { "pizzaId": "margherita-123" }
}
3. Host Action
The Host extracts the pizzaId from the tool response and reads the resource template
ui://pizzas/margherita-123/details.
4. Server
Generates the details page for margherita-123.
Goal
To simplify the developer experience by allowing "0-JS" or low-JS apps, moving the logic from the sandboxed client back to the server.
Checkout this PR to see this concretely: #296