Skip to content
kubed-io[bot] edited this page Nov 27, 2026 · 11 revisions

Skills

The rules every served skill follows: how a catalogue of skills becomes resources, what is listed and what is only read, the folders as directory resources with their index files, and the Skills extension. The plugin layer applies them to the skills of every plugin it serves; a server does not call them on its own. This area covers kubed/mcp/skills.py and kubed.mcp.protocol.AdvertiseLegacyExtensions. The Skills extension is SEP-2640 (Final). A rule that carries one of its sections cites it as (SEP-2640: section).

Use cases

  • An agent connects to a bare server, reads skill://<name>/SKILL.md, and follows its skill:// links to the rest of the skill, with nothing installed on the client.
  • A host that implements the Skills extension lists the server's skills, fetches one and verifies every file against its digest.
  • A host that reads directory resources lists a skill's root and descends into references; a model behind a proxy that refuses unknown methods reads <folder>/_index.md instead.
  • A plugin's skill that FastMCP refuses is not served, and an error names the folder and the reason.
  • A skill folder that holds a .gitignore, a .git/ or a .venv/ is served without them.
  • A catalogue that depends on the request (a scope, a mode) is built per request, and its folders and indexes follow it.

Neighbours

SKL-1. FastMCP's skills API (Skill, SkillCatalogProvider, the Skills extension and its results) does what it does properly, and this area only adds to it. The names re-exported are the facade's (FAC-7). Fetching a plugin folder and deciding which of its skills are served belong to the plugin layer (PLUG-19, PLUG-20). QuickMCP has no skills method of its own (APP-4).

The catalogue

SKL-2. A catalogue maps a path to a Skill. The path's last segment is the skill's name, and the segments before it are the URI's: demo serves skill://demo/SKILL.md, and lib/folder/demo serves skill://lib/folder/demo/SKILL.md. Skills keyed by name alone are a catalogue of one-segment paths. FastMCP refuses a path that does not end in its skill's name, or that nests one skill inside another.

SKL-3. EntryOnlySkillProvider is a SkillCatalogProvider subclass serving one catalogue, given to it or returned per request by an override of load_skills(), which FastMCP calls once per MCP request. Everything SKL-6 to SKL-19 say of a skill's files, folders, titles and reserved names is derived from the catalogue served for the request, never fixed when the provider is built.

SKL-4. serve(server, skills) adds one EntryOnlySkillProvider, skills itself when it is one. The provider brings the extension (SKL-20), which FastMCP registers once however many providers bring it. A call also adds AdvertiseLegacyExtensions for the extension (SKL-22) unless one on the server declares it already, and NameTheIndex (SKL-18) unless the server has one, so a later call adds neither again.

Loading

SKL-5. load_skill(path) builds a skill with FastMCP's Skill.from_files from the folder's files, less its hidden paths (SKL-24). It makes the checks Skill.from_directory makes, with its wording, and is strict. A folder FastMCP refuses returns None, with one error naming the folder and the reason. FastMCP refuses a folder for its frontmatter, for a name that is not the folder's, for a symlink or special file outside a hidden path, or for more than 512 files or 16 MiB (SEP-2640: Limits; every other path: SKL-29). The limits are counted before any file is read, and hidden paths are not counted. A folder with no SKILL.md is no skill: None, with a warning. A loaded skill comes back without its reserved files (SKL-6).

Reserved names

SKL-6. A file named _index.json or _index.md, in any folder, and a _manifest at a skill's root, are never served: their URIs read as a folder's index (SKL-15) and as the manifest (SKL-9). without_reserved(skill) returns the skill without them, with a warning naming each, and the same skill when there are none. It drops a hidden path too (SKL-24), without a warning. A folder with such a name is named in a warning too; its files stay in the skill. A _manifest below the root is an ordinary file or folder.

SKL-7. A catalogue given to EntryOnlySkillProvider goes through without_reserved. One that load_skills() returns is served without its reserved files and its hidden paths, silently, so the warnings come once, when a skill is built, and never per request.

Hidden paths

SKL-24. A hidden path is one with a segment, below the skill's root, whose name starts with .: a file or a folder, at any depth (.env, .git/config, assets/.gitkeep). It is never served:

  • it is in no resources/list, no folder's children or index, no _manifest and no skills/list entry;
  • resources/read of its URI fails as a missing URI does;
  • a folder that holds only hidden paths is no folder (SKL-11).

A hidden path never causes its skill to be dropped. load_skill does not enter a hidden folder, so nothing under it is read, counted against the limits or judged, and a symlink in .venv/ is included in that. A hidden path is left out without a warning or an error, and a reserved name inside one is not warned of either. load_skill and without_reserved each log one DEBUG line per skill naming the hidden paths they left out. Being no file of the skill, a hidden path is in no entry's resources (SEP-2640: Resources).

Listing and reading

SKL-8. resources/list shows one row per skill, its SKILL.md, with the skill's description. A plugin's skills, and those of a catalogue served with skills.serve, are listed only when the request lists skills, as it does by default under mcp (DLV-8). On a FastMCP server no QuickMCP wraps, a catalogue's rows are always listed (DLV-10). No other file, no folder, no index and no manifest is listed, as a resource or as a template. Its row's name is FastMCP's (SKL-30; SEP-2640: Resource Metadata).

SKL-9. Every file of a skill reads by its exact URI, skill://<path>/<file>, as it is served: the bytes in the skill, as UTF-8 text when it is a text file (PLUG-75) and as a blob otherwise, a .md file as text/markdown with its frontmatter kept. skill://<path>/_manifest is FastMCP's file listing, every file with its size and SHA-256. FastMCP's Client.read_skill reads and verifies a whole skill through it, with or without the Skills extension. SEP-2640 names FastMCP's per-skill _manifest as diverging from its design (SEP-2640: Backward Compatibility). It is no SEP surface: a host acting on a skill uses the skill's entry. It lists the same files as the entry, with the same digests and sizes (SKL-23), and is kept for Client.read_skill and for clients under X-MCP-Via: mcp (DLV-9).

SKL-10. A file's description is the skill's description for SKILL.md; the first # heading outside a code fence for a Markdown file; and File from <name> skill for any other file, a Markdown file with no heading or that is not UTF-8 included. A read by URI and a folder listing give the same description.

Folders

SKL-11. Every folder a skill's files sit in, the root included, is a directory resource: its URI is the skill's root, skill://<path>, or skill://<path>/<folder>, with no trailing slash; its mimeType is inode/directory; its name is <path>/<folder>; its description is A folder of the <name> skill. A directory with no file under it is no folder, and neither is a folder with an index's name, any folder under one, or a _manifest folder at the root. The segments of a nested catalogue path above a skill, such as skill://lib, are no folder.

SKL-12. A folder's children are its direct files, each the Resource row resources/list would show for it (SKILL.md's is its listed row), and its direct subfolders as directory resources, sorted by URI. The manifest and the indexes are never children.

SKL-13. Folders is the contract a provider meets to have folders: an async children(uri) -> list[dict] | None, the children of the folder at uri as wire Resource dicts, or None when the provider has no folder there. EntryOnlySkillProvider meets it. The extension (SKL-21) and NameTheIndex (SKL-18) ask every provider in server.providers that has one, per request, and take the first answer that is not None.

SKL-14. resources/directory/read takes a required, non-empty uri and an optional cursor, and returns {"resultType": "complete", "resources": [...]}, a page of at most 100 children, with nextCursor while more remain. It matches uri as GW-4 leaves it: less the request's prefix, its dot segments resolved. A uri that names no folder, a file's or one with a trailing slash included, fails with -32602 and Directory not found. A cursor is the decimal offset of a child, from 1 to one less than the number of children; any other fails with -32602 and Invalid directory cursor (SEP-2640: Directory Listing).

SKL-15. Beside each folder are two files, read with plain resources/read, so they pass a proxy that refuses methods it does not know:

File Media type Body
<folder>/_index.json application/json the resources array resources/directory/read returns, every page joined
<folder>/_index.md text/markdown one <uri>: <description> line per child, in the same order, a description's newlines collapsed

SKL-16. A read of an index normalises its URI as every resources/read does, so skill://demo/x/../references/_index.md is the references index, and resources/directory/read of skill://demo/x/../references lists that folder (GW-4).

SKL-17. _manifest and the indexes answer different questions: the manifest is every file of one skill, recursive, with sizes and digests, for fetching and verifying a whole skill; an index is one folder's direct children, for browsing. Neither is a file of the skill (SKL-26).

SKL-18. A folder serves no content. resources/read of a folder URI fails as a missing URI does, -32602 with data {"uri": <uri>}, and NameTheIndex makes the message name the index: Resource not found: '<uri>'. <uri> is a folder: read <uri>/_index.md to list it. On the server, read_resource raises FolderNotFound, whose miss is what a tool that reads resources for a client says: no resource at '<uri>'. and the same hint.

SKL-19. One request loads a catalogue once, whatever it reads: a folder listing, an index, a file, a folder miss or skills/list.

The Skills extension

SKL-20. SkillsExtension is FastMCP's Skills extension (io.modelcontextprotocol/skills) with only what it lacks. It declares {"directoryRead": true}, binds FastMCP's own skills/list and skills/get handlers for every protocol version, and adds resources/directory/read, unless an extension registered on the server before it binds it already (the plugin layer's agents extension, PLUG-68). Its clone() is the same class, so a server that mounts one serving skills registers this extension, not FastMCP's. Each addition goes when FastMCP ships it (SEP-2640: Capability Declaration).

SKL-21. resources/directory/read answers from the server's providers (SKL-13), inside a FastMCP Context, so a catalogue loaded per request is loaded once for it.

SKL-22. AdvertiseLegacyExtensions(declared) is a middleware that adds each extension in declared to a legacy initialize reply's capabilities.extensions, beside any already there. FastMCP declares extensions only in server/discover, though it answers their methods in both eras (SEP-2640: Capability Declaration).

SKL-23. The entries, their results and their caching are FastMCP's: an entry names every file of a skill, SKILL.md included, with its sha256: digest and size, and is offered only while every file it names reads, for this caller, as the file it lists. skills/list returns {"resultType": "complete", "ttlMs": 0, "cacheScope": "private", "skills": [...]}, sorted by URI, and pages as FastMCP pages every list, the plugins' skills capped first as DLV-17 says. skills/get returns the same envelope with skill, and any URI that is not, as GW-4 leaves it, an entry's SKILL.md fails with -32602 and Unknown skill URI: <uri>. Each rule carries the SEP section it comes from:

  • Every entry names each file once, SKILL.md included (SEP-2640: Resources).
  • A digest is sha256: and 64 lowercase hex characters, and both it and size are over the bytes resources/read returns (SEP-2640: Integrity and verification).
  • frontmatter is the SKILL.md header verbatim, every field kept: license, metadata, allowed-tools and any other. A header that JSON cannot hold verbatim, such as a bare YAML date or .nan, refuses the skill (SKL-5), so no entry renders one otherwise (SEP-2640: Frontmatter).
  • skills/get answers for a skill no listing names, as under mcp and local (DLV-9, DLV-10) (SEP-2640: Retrieval via skills/get).
  • The envelope is SEP-2640: Enumeration via skills/list's, and its paging is SKL-28.
  • Behind a gateway an entry's URIs are structured and never prefixed (GW-8, #82).

SEP-2640 conformance

SKL-25. Every entry's resources is an array naming every file the skill serves. No entry is "dynamic": every skill served is a fixed set of files, built before it is served (SEP-2640: Resources).

SKL-26. <folder>/_index.md, <folder>/_index.json and skill://<path>/_manifest are views for clients under X-MCP-Via: mcp (DLV-9). They are found by exact URI and are not files of the skill, so they are in no entry's resources (SKL-6, SKL-12). A host acting on a skill treats a read of an unlisted file as a verification failure, equal to a digest mismatch (SEP-2640: Integrity and verification), so it refuses these reads. A skill's SKILL.md must not link to them. NameTheIndex's hint (SKL-18) and a server's instructions that name a _manifest are for clients under X-MCP-Via: mcp (DLV-9) and for proxies that refuse unknown methods.

SKL-27. A catalogue never nests one skill inside another (SKL-2). A SKILL.md in a folder below a skill's root is an ordinary file of that skill, listed in its entry's resources, and has no entry of its own: skills/get of its URI fails as SKL-23 says (SEP-2640: Nested skills).

SKL-28. A known deviation. skills/list is FastMCP's handler, and with no list page size set it is one page and ignores any cursor. The base protocol says an invalid cursor SHOULD fail with -32602. With list_page_size set it pages, a nextCursor round-trips, an entry is never split, and an invalid cursor fails with -32602. It is FastMCP's to change, and this package does not replace the handler (SEP-2640: Enumeration via skills/list).

SKL-29. No served skill exceeds 512 files or 16 MiB (SEP-2640: Limits). load_skill counts them before reading and never counts hidden paths (SKL-5, SKL-24). FastMCP's Skill constructors (Skill.from_files, Skill(...) and Skill.from_directory) build every other skill: a catalogue's, a per-request one's and a rewritten one's. They refuse one over the limits with the same wording, counting every file given, hidden paths included, which are then left out (SKL-24). A rewrite that takes a skill over a limit fails it as PLUG-59 says. Reserved files are counted, then dropped (SKL-6).

SKL-30. FastMCP's SKILL.md row (SKL-8) is named <path>/SKILL.md, the skill's path in its catalogue (for example demo-skill/SKILL.md), not the frontmatter name that SEP-2640's Resource Metadata says it SHOULD be. The row is FastMCP's and is kept.

Clone this wiki locally