2.2 KiB
2.2 KiB
FastMCP Greenfield Contracts (Steps 1-5)
Step 1: End-State Content Contract
- All authored markdown lives under docs/.
- Skill docs live under docs/skills//.
- Canonical skill shape is:
docs/
skills/
<skill-id>/
SKILL.md
references/
- SKILL.md is required for every skill.
- references/ is the only place for skill-specific supporting docs.
- Skill directories are ownership boundaries.
- Skill id rules:
- lowercase kebab-case
- starts with a letter
- directory name matches skill id
- SKILL frontmatter id matches directory name
Step 2: SKILL Frontmatter and Metadata Contract
- name and description are required top-level frontmatter fields.
- Repository indexing metadata lives in x-personal-mcp.
- x-personal-mcp fields:
- required: id, version, capabilities
- optional: tags, depends_on, references
- references maps stable ref ids to skill-relative markdown paths under references/.
- metadata.yaml sidecars are not part of the canonical model.
Step 3: URI Contract and Compatibility Policy
Canonical URI surface:
- resource://catalog/skills_index
- resource://catalog/skills/{skill_id}
- resource://skills/{skill_id}/document
- resource://skills/{skill_id}/references/{ref_id}
- resource://docs/{path*}
Rules:
- skill_id and ref_id are lowercase kebab-case.
- docs path is markdown-only and cannot traverse outside docs/.
- URI families are unversioned and canonical in this phase.
- Breaking changes use direct replacement with no compatibility aliases.
Step 4: Docs Registry Loader Contract
- Loader uses importlib.resources.files(...) and Traversable APIs.
- Startup validates SKILL frontmatter schema, id invariants, reference integrity, dependency graph, and URI uniqueness.
- Registry is immutable for request-time reads.
- Invalid docs state is a hard startup error.
Step 5: Registry-Driven Resource Registration Contract
- FastMCP resources are registered from the validated registry.
- RFC6570 templates are used for parameterized routes.
- Docs resources declare explicit MIME types.
- Docs resources include readOnlyHint and idempotentHint annotations.
- Duplicate registrations fail startup via strict duplicate policy.