← Back to Dashboard
1. Resource Fundamentals2. Resource Templates3. Pagination & Subscriptions

Resource Templates

📚 Resources⏱ 7 min⭐ 80 XP⌨ Hands-on lab

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/list during 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 URI jira://projects/ENG/issues/ENG-4092 and issues a resources/read request, 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 XP

Inspect parameterized URI templates exposed by an MCP resource provider.

1List resource templates using inspector CLI on server-everything.
lab-sandbox — simulated environment
INFINITY LAB SANDBOX v2.6 — simulated shell
Type the command for the current objective. Helpers: "hint", "solution", "clear".
$
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.