Resource template (MCP)
What is Resource template (MCP)?
A resource template is how a Model Context Protocol server exposes a parameterized family of resources, such as file:///{path} for every file in a directory, as one RFC 6570 URI template rather than listing each resource individually. AdminKit's guide to securing an MCP server covers why an exposed resource list, templates included, needs the same scoping as tools.
By AdminKit team, Netbase JSC · Updated
A resource template is how a Model Context Protocol server exposes a parameterized family of resources — for example file:///{path} covering every file under a project directory — as a single URI template, defined using RFC 6570 syntax, rather than listing every concrete resource individually. A template is not itself a URI: only once its variables are filled in does it become one, in the generic syntax RFC 3986 defines. A plain resource, by contrast, already names one concrete item directly, with no variables left to fill in. A client discovers a server’s templates through a resources/templates/list request, separate from the plain resources/list call that returns already-concrete URIs, and fills in a template’s variables, often with help from the protocol’s completion API, to read a specific resource it names. In the official MCP Python SDK, declaring one takes a single decorator: the README’s minimal example server registers a function under the URI greeting://{name} and describes it as a templated resource. Because one declared template can stand in for an entire directory tree or an entire database table’s worth of concrete resources, it deserves the same deliberate access-control review as a server’s static resource list — a template that looks narrow in its definition can still expose far more than a reviewer scanning a resource list by name alone would assume.
AdminKit groups resource template (MCP) under its AI agents & MCP cluster — browse the AdminKit glossary index for other related terms.
Frequently asked questions
What syntax does an MCP resource template's URI use?
RFC 6570 URI Template syntax, which lets a single pattern like file:///{path} stand in for an entire family of concrete resources.
How does a client discover resource templates versus plain resources?
Through a separate resources/templates/list request, distinct from the resources/list call that returns already-concrete URIs.
Why can a resource template be riskier than it looks?
One declared template can stand in for an entire directory tree or database table's worth of concrete resources, exposing more than a reviewer scanning a resource list by name alone would assume.