7.2 KiB
7.2 KiB
icon
| icon |
|---|
| lucide/link |
URI Contract
This page defines the canonical resource URI contract, template parameter rules, and compatibility policy.
Conventions in this document follow MCP resource semantics, URI generic syntax (RFC3986), and URI templates (RFC6570).
Canonical URI Surface
The public, preferred direct resource URIs are:
resource://catalog/skills_indexresource://catalog/skills/{skill_id}resource://skills/{skill_id}/documentresource://skills/{skill_id}/references/{ref_id}resource://docs/{path*}resource://catalog/prompts_indexresource://catalog/prompts/{prompt_id}resource://prompts/{prompt_id}/document
The public, preferred resource template URIs are:
resource://catalog/skills_index{?q,tag,capability,cursor,limit}resource://catalog/prompts_index{?q,tag,cursor,limit}
Contract intent:
- Catalog URIs are discovery surfaces.
- Skill URIs are the primary per-skill guidance surfaces.
- Catalog query templates are additive discovery helpers for filtering and pagination.
- The docs wildcard URI is a direct authored-markdown access surface under
docs/.
Best-practice alignment:
- Resource identifiers are stable and noun-oriented.
- Dynamic lookup variants are represented as RFC6570 templates.
- Resources remain read-oriented and are described with explicit MIME types.
URI Semantics
resource://catalog/skills_index
- Returns a compact list of skill records for discovery.
- Contains one entry per
skill_id. - Includes enough metadata for client-side selection, at minimum
id,name,description,tags, andcapabilities.
resource://catalog/skills/{skill_id}
- Returns one normalized record for
skill_id. - Includes the canonical document URI and declared reference ids.
- Returns not found when
skill_iddoes not exist.
resource://skills/{skill_id}/document
- Returns the canonical
SKILL.mdauthored content for that skill. skill_idmust satisfy the stable skill id rules from the content contract.
resource://skills/{skill_id}/references/{ref_id}
- Returns one reference document declared in the skill frontmatter references manifest.
ref_idis the stable public handle for that reference document.
resource://docs/{path*}
- Returns authored markdown at a normalized relative path under
docs/. - Supports nested paths via RFC6570 wildcard expansion.
- Typical examples include
index.md,usage.md,skills/<skill-id>/SKILL.md, andskills/<skill-id>/references/<file>.md.
resource://catalog/prompts_index
- Returns a compact list of prompt records for discovery.
- Contains one entry per
prompt_id. - Includes
id,name,description,tags,version, and canonical document URI.
resource://catalog/skills_index{?q,tag,capability,cursor,limit}
- Returns the same record family as
resource://catalog/skills_indexwith optional filtering and pagination. - Query parameters are optional and composable.
- Unknown query keys are ignored or rejected deterministically by server policy.
resource://catalog/prompts_index{?q,tag,cursor,limit}
- Returns the same record family as
resource://catalog/prompts_indexwith optional filtering and pagination. - Query parameters are optional and composable.
- Unknown query keys are ignored or rejected deterministically by server policy.
resource://catalog/prompts/{prompt_id}
- Returns one normalized record for
prompt_id. - Includes prompt argument metadata when declared in frontmatter.
- Returns not found when
prompt_iddoes not exist.
resource://prompts/{prompt_id}/document
- Returns the canonical prompt markdown document.
prompt_idmust satisfy lowercase kebab-case rules.
Template Parameter And Validation Rules
skill_id
- Lowercase kebab-case.
- Must satisfy the stable skill id rules from the content contract.
ref_id
- Lowercase kebab-case.
- Must be declared in the skill's references manifest.
path*
- Relative POSIX path only, expressed as URI path segments under RFC3986 path syntax.
- No leading slash.
- No
..traversal segments. - Resolves only inside
docs/. - Markdown-only in the end state, meaning
.mdfiles. - Any reserved URI characters in path segments must be percent-encoded.
prompt_id
- Lowercase kebab-case.
- Must be unique across prompt ids and must not collide with skill ids.
URI Hygiene Rules
- Use lowercase, human-readable path segments for stable discoverability.
- Keep identifiers immutable once public whenever practical.
- Keep template variables semantic (
skill_id,prompt_id,ref_id,path*) and avoid overloading one variable for unrelated meanings. - Do not include secrets, tokens, or user-identifying data in URI paths or query strings.
- Prefer additive query parameters for discovery over introducing parallel URI families, matching MCP resource-template discovery patterns.
- Return clear not-found semantics for unknown ids and invalid template resolution.
URI Versioning Policy
Default rule:
- Keep URIs unversioned by default.
- Allow URI and payload updates when they improve clarity or implementation simplicity.
Breaking-change rule:
- Breaking changes use direct replacement of the canonical URI family.
- No compatibility aliases or dual URI families are maintained.
FastMCP version metadata usage:
- Resource
versionmetadata may be used for implementation and version discovery. - URI readability and maintainability remain the primary contract.
Reference Id Compatibility Policy
ref_id is the public identifier for a reference document, separate from file path.
Rules:
- Prefer keeping
ref_idstable when practical. - File paths may change without URI churn as long as the mapped
ref_idstill resolves. - If a reference is renamed, introduce a new
ref_idand treat the old one as retired. - Avoid reusing retired
ref_idvalues for unrelated content.
Invariants
This contract guarantees:
- One canonical URI pattern per core capability surface.
- Fast, low-friction URI evolution through direct replacement of canonical URIs.
- A single canonical catalog URI family with no alias maintenance overhead.
- Reference mappings can evolve with minimal churn.
Non-Goals
This contract does not define:
- Implementation-specific transform wiring details, such as
VersionFilter, mounts, or provider composition. - Migration script mechanics for auto-generating aliases.
- Authorization policy design for URI-level access control.