← Back to Dashboard
1. Resource Fundamentals2. Resource Templates3. Pagination & Subscriptions
Resource Templates
Dynamic Parameterized URIs (RFC 6570)
When an MCP server exposes massive or unbounded datasets (such as hundreds of thousands of customer support tickets, database rows, or Git commits), statically enumerating every item in resources/list is infeasible. The Model Context Protocol solves this through Resource Templates.
How Resource Templates Operate
- Template Registration: The server registers an RFC 6570 URI template (e.g.,
jira://projects/{projectKey}/issues/{issueId}). - Discovery: The client queries
resources/templates/listduring handshake initialization to understand available URI patterns and argument parameter schemas. - Dynamic Resolution: When an LLM determines it needs issue
ENG-4092, the host constructs the concrete URIjira://projects/ENG/issues/ENG-4092and issues aresources/readrequest, which the server unpacks into strongly typed parameters.
import { McpServer, ResourceTemplate } from "@modelcontextprotocol/sdk/server/mcp.js";
const server = new McpServer({ name: "jira-mcp", version: "1.0.0" });
server.resource(
"jira-ticket",
new ResourceTemplate("jira://projects/{projectKey}/issues/{issueId}", { list: undefined }),
async (uri, { projectKey, issueId }) => {
const issueData = await fetchJiraTicket(projectKey, issueId);
return {
contents: [{
uri: uri.href,
mimeType: "application/json",
text: JSON.stringify(issueData, null, 2)
}]
};
}
);⌨ HANDS-ON LABInspect Dynamic Resource Templates
⭐ +125 XPInspect parameterized URI templates exposed by an MCP resource provider.
1List resource templates using inspector CLI on server-everything.
OBJECTIVE 1 / 1 — type "hint" if stuck
🧪 Knowledge Check
Press 1-4 to select1 of 3
When should you use a Resource Template instead of a static Resource?
When data is smaller than 1MB.
When you have a massive or infinite parameters space (e.g., database records by ID).
When data changes every second.
When using Python instead of TypeScript.