modelcontextprotocol / modelcontextprotocol/ext-apps
[Proposal] Add support for UI Resource Templates in SEP-1865
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 2.9k
- Forks
- 387
- Avg merge
- 3h 21m
- Merged PRs (30d)
- 6
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: https://github.com/modelcontextprotocol/ext-apps/pull/296
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading the current SEP-1865 draft and the concrete approach in PR #296. Compare the proposed Resource Template flow with the existing MCP Resource Template mechanism and identify the specification decisions still needed. Done means the proposal is resolved and any agreed SEP-1865 changes are documented.
Written by the indexing model from the issue text.
Assessment
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100