Skip to content

plugins

kubed-io[bot] edited this page Nov 25, 2026 · 31 revisions

Plugins

How a server serves material: it registers a plugin, and this layer reads it and serves it. A loader turns an address into a local folder; the folder is read as a Claude plugin, its manifest first; and each kind it ships is served by one set of rules: skills as skill:// resources, commands as MCP prompts, agents through the agents extension. This area covers kubed/mcp/plugins.py, prompts.py and agents.py, and QuickMCP.add_plugin, add_loader and plugins.

Use cases

  • A server ships one plugin folder in its wheel and serves it with mcp.add_plugin(PLUGIN_DIR): each skill at skill://<server>/<name>/SKILL.md, its commands as prompts, its agents on agents/list.
  • A server that serves one embedded skill adds its plugin with no namespace, and the skill is skill://<server>/<name>/SKILL.md: there is no root.
  • A server that serves many plugins registers a loader for its own scheme, a git or WebDAV one, and adds each plugin under a namespace it chooses, add_plugin(address, namespace="grafana").
  • Two plugins added under one namespace serve as one; a second skill at an address already served is refused, naming the plugin that holds it.
  • A published manifest names a component path outside its plugin; the path is dropped with a warning, and the rest of the plugin serves.
  • A plugin groups its commands and agents in folders, as Claude Code reads them: commands/db/migrate.md is Claude Code's /<plugin>:db:migrate and the MCP prompt db_migrate.
  • A person picks a command in a host's prompt picker, fills in its arguments and sends it.
  • A host that implements the agents extension lists a server's agents and runs one as a subagent.

Neighbours

PLUG-1. How a skill is loaded, listed, read and offered through the Skills extension is the skills area's (SKL-2 to SKL-23), and AdvertiseLegacyExtensions is SKL-22. QuickMCP itself is the app's. A loader for a scheme other than file, and which plugins a server adds under which namespace, belong to that server.

The API

PLUG-2. mcp.add_plugin(address, *, namespace=None, manifest=None) takes a string or a path, picks the loader by the address's scheme (PLUG-7), reads the folder it materialises (PLUG-10 to PLUG-14), with manifest its marketplace entry (PLUG-42), serves every kind the plugin ships, and returns the registered Plugin.

PLUG-3. A plugin that does not load is refused with a PluginError, a ValueError, whose message is plugin <address> is not served: <reason>. It is refused when no loader answers its scheme, its loader fails, its folder is not a folder, its manifest or entry is refused (PLUG-11, PLUG-43), it would serve something already served (PLUG-18) or its namespace and another plugin's skill would nest (PLUG-76). Everything is read and checked before anything is served, so a refused plugin serves nothing and is not in mcp.plugins.

PLUG-4. mcp.plugins is the registry: a tuple of the plugins the served set holds, in the order they were added to it (PLUG-52).

PLUG-5. A Plugin is a frozen dataclass:

Field Value
name, description, version from the manifest (PLUG-11)
root the folder the loader materialised
components a Components: the paths each kind is read from, skills, commands and agents, root-relative with . for the root, and the notes (PLUG-14)
address the address as given, a path as its string
namespace the namespace as served, the server's name unless the caller named one (PLUG-15)
skills the skill:// URI of the SKILL.md of each skill served
prompts the names served
agents the names served in its set, a clashing one as <name>@<plugin> (PLUG-64)
skipped what the plugin ships and does not serve, as (path, reason) pairs (PLUG-44)
agent_files an AgentFile for each agent served in its set (PLUG-74)

read_plugin(root, manifest=None) returns the first five fields from a folder, with no namespace and nothing served.

PLUG-41. A server has one skills provider, one prompts provider and one agents extension, whatever its plugins: an EntryOnlySkillProvider (SKL-3) whose load_skills() is every plugin's skills, a FastMCP provider of every plugin's commands, and the agents extension (PLUG-27). Each reads the plugins served once per call, in the order they were added, from one set that adding a plugin replaces whole and nothing changes in place. A plugin's prompts are not the server's local prompts: a prompt the server adds itself under a plugin prompt's name is the one served, as FastMCP's local components come first.

PLUG-44. Plugin.skipped holds, in the order read, each skill folder, command file and agent file the plugin ships and does not serve: a skill FastMCP refuses (PLUG-20), a command or an agent file skipped (PLUG-25, PLUG-29, PLUG-39), and a later one at a URI or name the plugin serves already (PLUG-18), whose reason is <what> is already served by <first path>; then the agents its set skips (PLUG-64, PLUG-73). Each is the path from the plugin root, /-separated, and the reason its warning gives; a plugin that skips nothing has (). The warnings are logged as before. What the manifest or the layout got wrong is a note (PLUG-14), never a skip, and read_plugin reads no file of a kind, so its skipped is ().

Loaders

PLUG-6. PluginLoader is a Protocol: schemes, a tuple of the address schemes it answers, and materialise(address) -> Path, a local folder holding the plugin. A loader fetches and does nothing else: the folder is read by this layer, never by a loader. A loader that raises PluginError, OSError or ValueError refuses the plugin with the exception's message as the reason; any other exception propagates.

PLUG-7. An address's scheme is what precedes its ://, compared in lowercase. An address with none, a bare path included, is a file address.

PLUG-8. LocalLoader answers file. It takes a path, or a file:// URL whose host is empty or localhost, and serves the folder where it is, with no copy and no extra dependency. A URL naming another host is refused, and so is a path that is not a folder: <path> is not a folder.

PLUG-9. mcp.add_loader(loader) registers a loader for each of its schemes. LocalLoader is registered for file until the server adds its own (PLUG-61). A loader naming no scheme, or a scheme that already has one, is refused with a ValueError. An address whose scheme has no loader is refused with the reason no loader for <scheme>:// addresses: register one with mcp.add_loader().

The manifest

PLUG-10. A plugin's manifest is the first of .claude-plugin/plugin.json and plugin.json that is a regular file inside the plugin's root once resolved: one that is a symlink out of the root is not read. A plugin with no manifest is read from the conventions alone (PLUG-13) and named by its folder.

PLUG-11. A manifest that is not readable JSON, or not a JSON object, refuses the plugin, and so does a skills, commands or agents that is not a string or a list of strings, naming the field; a commands object map is PLUG-13's. name, description and version are read when they are strings; name falls back to the folder's name when it is not a usable name (PLUG-15). Every other field is ignored.

PLUG-12. A component path is published content, never trusted as a path. It loses a leading ./ and a trailing /, and . or ./ names the root. A path that is empty, absolute or holds a .. segment is dropped, noted <field> path '<path>' leaves the plugin root, and the field's other paths are kept. A path that does not start with ./ is kept and noted <field> path '<path>' does not start with ./. A path given twice is read once.

PLUG-13. Each kind's conventional folder, skills/, commands/ or agents/, is read when it is a folder inside the root, as Claude Code does:

  • a manifest's skills adds to the conventional skills/, which is read first;
  • a manifest's commands or agents replaces the conventional folder: only its paths are read (PLUG-38).

skills paths are folders; commands paths are folders or .md files; agents paths are .md files only, never a folder, and any other is dropped, noted agents entry '<path>' is not a .md file. A commands object map is noted commands object map is not served and serves no command.

PLUG-14. A note says what the manifest or the folder got wrong without failing the plugin. Each note is logged once, as a warning plugin <name>: <note>, when the plugin is added, and kept in Plugin.components.notes.

PLUG-38. When a manifest's commands or agents leaves that kind's conventional folder unread, the plugin notes Default <folder>/ folder is ignored because the manifest sets "<key>", Claude Code's own wording. A declared path that is the folder, a path inside it, or the root reads it, and earns no note: "agents": ["./agents/reviewer.md"] and "commands": "./commands/" are quiet. A commands object map serves nothing (PLUG-13), so it is noted too.

PLUG-36. A commands or agents folder that cannot be listed, a PermissionError on NFS for one, is a note, <kind> entry '<path>' cannot be listed: <error>, <path> that folder's from the plugin root, logged once as PLUG-14's warning, and nothing in it is served; a subfolder that cannot be listed is noted the same way, and the rest of its entry serves. The rest of the plugin is served, the other kinds and the other entries of that kind included: no folder that cannot be listed stops the plugin, or the server, from loading.

PLUG-42. manifest is the plugin's marketplace entry, a mapping, merged with its plugin.json as Claude Code merges them (its marketplace reference, "How an entry combines with plugin.json"):

  • with no plugin.json (PLUG-10), the entry is the manifest, whatever its strict says;
  • beside one, the entry's skills, commands and agents are appended to the file's, kind by kind, and a kind either declares counts as declared (PLUG-13, PLUG-38);
  • the entry's paths are published content too: PLUG-11 to PLUG-13 read and check them as the file's, with the same notes;
  • the entry's name and description win over the file's, and the file's version over the entry's. source and every other field are not read: the loader has fetched the plugin already.

PLUG-43. Beside a plugin.json, an entry with strict: false that names any of skills, commands, agents, hooks, outputStyles or themes refuses the plugin (PLUG-3), as Claude Code fails to load it: conflicting manifests: both plugin.json and the marketplace entry specify components, and the entry is strict: false. One that names none is ordinary, and strict other than false is the default, true. An entry that is not a mapping refuses the plugin with the marketplace entry must be a JSON object.

Namespaces

PLUG-15. A namespace of None is the server's own name, the name its QuickMCP was built with: a plugin added with none is the server's own, and its skills are named folders under skill://<server>. There is no root: a skill is always a named folder under a namespace, and an empty or blank namespace ("", " ", /) is refused with a ValueError. Any other namespace is the caller's choice, such as a library, and loses its leading and trailing /. Each / segment of a namespace must be a usable name, which is not . or ... A usable name is one non-empty token with no whitespace, no control or other invisible character, no /, no @ and no :, Claude Code's segment separator (kb PLG-21, AGT-6). A namespace that breaks this, the server's name included when it is the default, is refused with a ValueError, before anything is read.

PLUG-16. A skill is served at skill://<namespace>/<name>/SKILL.md, <name> being its folder's name, one level below the skills folder it was found in (PLUG-19). So on a server named selenium-flow, skills/lint/ is skill://selenium-flow/lint/SKILL.md by default and skill://kit/lint/SKILL.md under kit. A declared skills folder that is a skill itself is its own name. A skill's sections, resources and helpers are files in its own folder, read through its SKILL.md.

PLUG-17. A prompt's and an agent's name is its own (PLUG-37) under the server's name: a host already reads both from one server. Under any other explicit namespace it is prefixed with the namespace's first segment and a _ (PLUG-63): greet under kit/tools is kit_greet. Two plugins under the server's name share prompt and agent names, and a name both serve clashes (PLUG-18).

PLUG-18. Plugins added under one namespace merge: their skills, prompts and agents are served side by side, and a plugin whose namespace sits inside another plugin's skill is refused as PLUG-76 says. A skill URI, or a prompt's name or address (PLUG-66), that an earlier plugin serves refuses the new plugin (PLUG-3), with the reason <what> is already served by plugin <name>; an agent name that an earlier plugin serves is renamed or skipped as PLUG-64 says, never refusing the plugin. Within one plugin the first in path order is served and a later one with the same URI or name is skipped, with a warning: so agents/review/security.md (review_security) wins over agents/review_security.md. For a prompt or an agent the warning names both files: agent <name> is already served by <first path>; <second path> is skipped, and likewise prompt <name> ....

PLUG-76. A plugin's namespace never sits inside another plugin's skill. A skill's key is <namespace>/<name>, the path of its folder skill://<namespace>/<name> (PLUG-16). When a plugin enters a set (add or keep, PLUG-50, and so add_plugin), it is refused (PLUG-3) when, against a plugin already in the set:

  • its namespace is, or lies below, a skill key that plugin serves: namespace <namespace> is inside skill skill://<key> of plugin <name>;
  • a skill key it serves is, or lies above, the namespace that plugin is served under: skill skill://<key> holds namespace <namespace> of plugin <name>.

The plugins already in the set are checked in the order they entered it, the first direction before the second for each. Paths compare by whole / segments, so superpowers/tidying is not inside superpowers/tidy. So when one plugin under superpowers serves the skill tidy, it and a plugin under superpowers/tidy or superpowers/tidy/more never share a set: whichever enters it second is refused, whether or not the second serves a skill. A nested skill's files are supporting files of the skill around it (SEP-2640), so one plugin's skills would otherwise become part of another's. prompts:// and agents:// folders merge across plugins, and their files are claimed one address at a time (PLUG-66), so they refuse no namespace.

Skills

PLUG-19. A plugin's skills are, in each of its skills folders, every folder directly in it holding a SKILL.md, in name order: one level only, as Claude Code loads them. A skill owns everything under its folder, so no folder below one is searched, and a dot folder is never searched. A declared skills path that is not a folder inside the root is noted skills entry '<path>' is not a folder in the plugin.

PLUG-40. A SKILL.md deeper in a skills folder, skills/group/nested/SKILL.md, is not served, and noted <path> is not served: a skill is one folder below its skills folder, its path from the plugin root. One that another skills folder serves, a declared . reading skills/x/ say, is not noted.

PLUG-20. Each skill is loaded strictly with load_skill (SKL-5): one FastMCP refuses is not served, with an error naming its folder and the reason, and the rest of the plugin is served. The skills every plugin serves are one catalogue, keyed by their paths (PLUG-16), served by one provider (PLUG-41) through serve() (SKL-4). It is added with the first plugin that serves a skill, so a server whose plugins serve none has no skills provider and no Skills extension.

PLUG-75. A skill's file other than its SKILL.md reads as UTF-8 text when it is a text file: it is text-like and its bytes are UTF-8. Any other file reads as a blob of its bytes, a text-like file that is not UTF-8 included. A file is text-like when its extension, compared in lowercase, is in the table below, or when its media type is text/*, application/json, application/xml, application/yaml, application/x-yaml, application/javascript, application/x-sh or application/toml, or ends in +json, +xml or +yaml.

Extension Media type
.md text/markdown
.txt, .ini, .cfg text/plain
.csv text/csv
.json application/json
.yaml, .yml application/yaml
.toml application/toml
.xml application/xml
.sh, .bash application/x-sh
.py text/x-python
.js text/javascript
.ts text/x-typescript

A file's media type is the table's for its extension, else the one Python's mimetypes guesses, else application/octet-stream. It is the mimeType of the file's read, of its row in its folder's _index.json and in resources/directory/read (SKL-12, SKL-15). A text file's text encodes back to its bytes, so the digest and size in _manifest and skills/list (SKL-23) are those of the bytes served. It holds for every skill a build serves, rewritten ones included (PLUG-56), and for a catalogue a server serves with serve() (SKL-4). A rewriter, to_mcp_form and the gateway's prefix (GW-5) see a skill's .json, .yaml and script files too (PLUG-58).

Layout and names

PLUG-37. A plugin is laid out and named as Claude Code reads it with --plugin-dir (material delivery F63), and an MCP name is Claude Code's local name with its : segment separator written _, kb's translation (kb PLG-25, PRM-41 to PRM-44, AGT-5 to AGT-8). The plugin segment of the local name is the namespace: no prefix under the server's own, <first segment>_ under another (PLUG-17, PLUG-63).

Kind In the plugin Claude Code, locally MCP name MCP address
skill skills/<name>/SKILL.md, one level only <plugin>:<name> the skill's name skill://<namespace>/<name>/SKILL.md
command commands/<a>/…/<stem>.md, any depth /<plugin>:<a>:…:<stem> <a>_…_<stem> a prompt
agent agents/<a>/…/<file>.md, any depth <plugin>:<a>:…:<name> <a>_…_<name>, <name> the frontmatter's, else the stem agents/list, agents/get

So commands/db/migrate.md is the prompt db_migrate, kb_db_migrate under kb, and agents/review/security.md named security is the agent review_security. One name follows Copilot, not Claude Code: a command file x.prompt.md, which Claude Code runs as /<plugin>:x.prompt, is the prompt x (PLUG-62).

PLUG-39. Every segment of a command's or an agent's name, and the name they join into, must be a usable name (PLUG-15). A file whose name is not, agents/x@y/r.md, is skipped with a warning naming the file and agent name '<name>' is not a usable name, or prompt name '<name>' … for a command, and never claims the name: a later file with a usable one is served under it.

Commands as prompts

PLUG-21. A plugin's command files are the *.md files at any depth in each of its commands folders, in path order, and each .md file its manifest lists. A dot folder or dot file below the folder is not read. A listed file that is not a regular file inside the root is noted commands entry '<path>' is not in the plugin, and a listed folder that is not a folder inside it commands entry '<path>' is not a folder in the plugin. A file that resolves outside the root is not read.

PLUG-22. A command is served as an MCP prompt named as PLUG-37 says: the folders between its commands folder and the file, then its file name without .md and one trailing .prompt (PLUG-62), joined with _. A listed file is its last segment alone. Commands take no name frontmatter.

PLUG-23. A command file is YAML frontmatter and a body. The header opens only on a first line that is exactly ---, trailing whitespace allowed, and ends at the next such line, so a --- inside a value is no end. The keys read are description, its whitespace collapsed and none when empty, and arguments: a list of mappings, each with a name and optionally description, required (default false) and default. Every key is kept as authored on the prompt, FilePrompt.frontmatter, the invocation keys Claude Code reads (disable-model-invocation, user-invocable, argument-hint) included; the MCP prompt ignores them.

PLUG-24. A placeholder is {{ name }}, spaces optional, name being a letter or _ and then letters, digits or _. Single braces are text, so ${param} and a JSON example render as written.

PLUG-25. A command file is skipped, with a warning prompt <path> is skipped: <reason>, when it cannot be read as UTF-8; it has no frontmatter or an unterminated one; its YAML does not parse or is not a mapping; arguments is not a list, or an item is not a mapping with a name; an argument is both required and has a default; or its body has a placeholder no argument declares (placeholders with no argument: <names>). The plugin's other commands are unaffected.

PLUG-26. A prompt renders as one user text. A value of None or "" counts as not given. A placeholder renders as the given value, else the argument's default, else the empty string. A required argument not given fails with Missing required arguments: <names>.

Agents

PLUG-27. Once a server has a plugin, whatever its plugins hold, it declares io.modelcontextprotocol/agents with {"listChanged": false} and binds agents/list and agents/get. FastMCP declares it on server/discover, and AdvertiseLegacyExtensions (SKL-22) adds it to a legacy initialize. The methods answer any caller. A server with no plugin binds neither: they fail with Method not found. No notifications/agents/list_changed is sent.

PLUG-28. A plugin's agent files are the *.md files at any depth in its agents/ folder, in path order, read as commands' are (PLUG-21), or else the .md files its manifest lists (PLUG-13). An agent's name is the folders between agents/ and the file, then its frontmatter name, else its file stem, joined with _ (PLUG-37); a listed file takes no folder segment. The name replaces only the file's segment. There is no folder form: agents/explorer/AGENT.md named explorer is the agent explorer_explorer, and with no name it is explorer_AGENT. An agent is never a resource, a prompt or a tool: the server serves definitions, and the host runs them.

PLUG-29. An agent file is skipped, with a warning agent file <path> is skipped: <reason>, when it cannot be read as UTF-8; it has no frontmatter, one whose YAML does not parse, or one that is not a non-empty mapping; its frontmatter does not survive a trip through JSON; its name is set but not a non-empty string; the name it builds is not usable (PLUG-39); or it has no non-empty string description. The plugin's other agents are unaffected.

PLUG-30. agents/list returns {"resultType": "complete", "ttlMs": 0, "cacheScope": "private", "agents": [...]}, a card for every agent of every plugin, in name order: name (PLUG-17); description, its whitespace collapsed; and capabilities, the frontmatter's when it is a list of strings, else []. It has one page: any cursor fails with -32602 and Invalid agents cursor.

PLUG-31. agents/get takes a required, non-empty name and returns the same envelope with:

Field Value
agent the name
instructions the body, its line endings \n, stripped; absent when blank
modelRoutingHint from model (PLUG-32); absent when none applies
tools always []: the extension allows only the answering server's tools, and an agent's are the host's to grant
_meta {"io.kubed/agent": {"frontmatter": …, "skills": {…}}} (PLUG-33), and the server's own keys beside it (PLUG-73)

An unknown name fails with -32602, Agent not found and data: {"reason": "agent_not_found"}. Each result is a deep copy.

PLUG-32. model is lowercased and split into runs of letters and digits. The first run that is opus, sonnet or haiku gives {"role": "large"}, "medium" or "small", with "vision": false. inherit, a model naming none of them, and one that is not a string give none.

PLUG-33. _meta["io.kubed/agent"] is the shape every kubed server shares. frontmatter is the header as written. skills maps each name in the frontmatter's skills list that names a skill its plugin serves to that skill's SKILL.md URI (PLUG-16); other names are left out, a skills that is not a list of strings counts as none, and the value is {} when none resolve. A server's own keys (PLUG-73) sit beside it and never replace it.

PLUG-34. An agent's instructions are its body as written, after the server's rewriters (PLUG-56); nothing else rewrites them.

What is not served

PLUG-35. A plugin's hooks, its .mcp.json and mcpServers, its output styles, a marketplace beside it, and any file outside its skills, commands and agents are not served.

Plugin sets

PLUG-50. mcp.plugin_set() returns a new, empty PluginSet, not yet served. staging.add(address, *, namespace=None, manifest=None) reads and checks a plugin as add_plugin does (PLUG-2, PLUG-3) and returns it. A refused plugin raises its PluginError and leaves the set unchanged. staging.keep(plugin) carries a plugin the server serves now into the set without reading it again. A clash (PLUG-18, PLUG-64, PLUG-76) is checked against the plugins already in the set.

PLUG-51. mcp.serve(staging) makes the set the one served, in one assignment, and moves mcp.generation, an int, on by one. A plugin left out of the set is no longer served: removing a plugin is serving a set without it. Served state is never rewritten in place. A request reads the served set once and keeps it to its end, so every read in it answers from one set.

PLUG-52. mcp.add_plugin(...) is a new set of the served plugins and the new one, served (PLUG-51). mcp.plugins is the served set's plugins, in the order they were added (PLUG-4).

Views

PLUG-53. mcp.plugin_view(fn) sets the server's view. fn() runs once per MCP request, inside it, so it can read the request (request_values(), FAC-9). It returns a View: a key, any hashable value, and admits(plugin) -> bool. A server with no view has one key and admits every plugin. A request with no HTTP request, on stdio, calls fn() the same way, and request_values() answers there as FAC-9 says. View(key, admits) is a frozen dataclass; admits runs only when a build is made (PLUG-55), so the key must decide it. A fn() that raises, or a build that fails, fails the request with its error. A request made inside a request, a tool's ctx.read_resource, shares its pin.

PLUG-54. For one request every skill, folder, index, manifest, entry, prompt and agent comes from the plugins the view admits. A plugin the view does not admit is absent for that request: not listed, and a read, skills/get, prompts/get or agents/get of its address or name fails as an absent one does, with the same code and message.

PLUG-55. What a request is served is built once per (generation, view key) and reused: at most 64 such builds are kept, the least recently used dropped first. Behind a gateway the key also holds the request's prefix (GW-6). A new generation never reuses an older one's build.

Rewriting

PLUG-56. mcp.add_rewriter(fn) adds fn(site, text) -> str to an ordered list. The rewriters run in the order added over every text file a build serves (PLUG-55): a skill's text files, each command file and each agent file. They also run over each folder's _index.md and _index.json, which the layer renders for the build from what the build serves, whatever their media type (PLUG-58); an index has no digest. They run when the build is made, never on a read, so a skill's _manifest, its skills/list entry and its reads give the digest and size of the rewritten bytes. With no rewriter, a build serves the files as read.

PLUG-57. A Site is a frozen dataclass:

Field Value
plugin the Plugin the file is in
namespace the namespace it is served under
kind skill, command, agent or index
path the file's path in its plugin, root-relative; for an index, its folder's
uri the address it is served at: its skill://, prompts:// or agents:// URI; for an index, the index's own
view the view's key, None without a view
admitted the plugins the view admits, in the order served
skills each skill folder plugin serves, its root-relative path ("" for the root itself) to the folder's skill:// URI

PLUG-58. A text file is one PLUG-75 reads as text. Any other file is served as it is, and no rewriter sees it.

PLUG-59. A rewriter that raises fails what it was rewriting: that skill, prompt or agent is not served for that view, with an error naming the rewriter, the file and the reason. So does one that returns anything but a string, and a rewrite after which the file no longer reads as the skill, command or agent it was, under the same name. An index that fails is not served for that view: a read of it fails as a missing URI's does. The rest of the build is served.

PLUG-60. kubed.mcp.plugins.to_mcp_form is a rewriter that writes a plugin's local forms as the addresses it is served at: ${CLAUDE_PLUGIN_ROOT}/<path> and ${CLAUDE_SKILL_DIR}/<path> inside a skill as the skill:// URI of that file, and a qualified name, <plugin>:<skill>, of an admitted plugin's skill as its SKILL.md URI. A form that names nothing served stays as written. A server adds it as any rewriter. ${CLAUDE_PLUGIN_ROOT}/<path> is rewritten when <path> is at or below a skill folder the plugin serves, the deepest winning, and keeps the rest of the path. A qualified name resolves in the first admitted plugin of that manifest name serving the skill, and /<plugin>:<name>, a command, stays.

Loaders, again

PLUG-61. A loader the server adds for file replaces the built-in LocalLoader (PLUG-8). Any other scheme a loader already answers refuses a second loader for it (PLUG-9). This replaces PLUG-9's refusal for file.

Readers and names

PLUG-62. mcp.command_reader(fn) reads the commands of every plugin read from then on, and returns fn. fn(text, path, name, plugin) is given the command file's text as served, its path from the plugin root, /-separated, the name it is served under (PLUG-22, PLUG-63) and the Plugin it is in, and returns a FastMCP Prompt to serve, or a string: the reason the command is skipped. It runs:

  • once when the plugin is read, on the text as read: a string, a raise or any other result skips the command (PLUG-44) with the warning prompt <path> is skipped: <reason>, and a Prompt claims the name (PLUG-18);
  • again in each build (PLUG-55) whose text for the command differs from the text read, on that text: there a skip fails the prompt for that build, as a rewriter does (PLUG-59);
  • never otherwise: with no rewriter, or text a build leaves unchanged, the first Prompt is served.

A plugin is read and built by the reader set when it was read, and no build reads the disk. A Prompt named otherwise is served under the layer's name. The default reader, kubed.mcp.prompts.read_command, reads PLUG-23 to PLUG-26. Every other rule here, the name, the namespace, the clash, the gateway's prefix in what it renders (GW-7) and the resources (PLUG-66), applies to any reader's Prompt.

A command's last name segment drops one trailing .prompt: Copilot's .prompt.md is the file type, as VS Code runs x.prompt.md as /x, so commands/db/x.prompt.md is db_x, kit_db_x under kit. Only one is removed, x.prompt.prompt.md is x.prompt, and a name still not usable is skipped (PLUG-39). x.md beside x.prompt.md clash as PLUG-18 says. A plugin's prompt files outside commands/ are served by listing them, files or folders, as commands entries in the manifest the server passes (PLUG-21).

PLUG-63. Under a namespace other than the server's name, a prompt's and an agent's prefix is the namespace's first segment, _-joined: greet under kit/tools is kit_greet. This replaces PLUG-17's prefix of the whole namespace. So two plugins under grafana/loki and grafana/k6 that both serve greet clash on grafana_greet, and the later is refused (PLUG-18).

PLUG-64. An agent's served name is decided when its plugin enters a set (add or keep, PLUG-50), against the agents of the plugins already in it. One whose name is already served there does not refuse the plugin: it is served as <name>@<plugin>, <plugin> the entering plugin's name, with the warning agent <name> is already served by plugin <owner>, so plugin <plugin> serves it as <name>@<plugin>. The plugin in the set first keeps the plain name, so a plugin kept into a set its earlier owner has left serves the plain name again. A <name>@<plugin> that is served already, or that is not usable because <plugin> is not (PLUG-15), skips just that agent, with a warning and an entry in skipped (PLUG-44). The agents extension serves the renamed card and definition (PLUG-30, PLUG-31), and a build that re-parses the agent (PLUG-56) serves it under the name its set gave it, and an agent's address is claimed as PLUG-66 says. A skill URI or a prompt's name or address that clashes still refuses the plugin (PLUG-18). This replaces PLUG-18 for agents across plugins; within one plugin, the first in path order is served (PLUG-18).

PLUG-65. <name>@<plugin> is the only served name that holds @, and a file can never claim it, since a file's own name cannot hold @ (PLUG-39).

PLUG-73. mcp.agent_meta(fn) adds a server's own keys to each agent's agents/get _meta, beside io.kubed/agent (PLUG-33), and returns fn; a second call replaces the first. fn(name, plugin) runs once per agent when its plugin enters a set (PLUG-64), after the agent's name is decided, with that name and the Plugin as it enters, and never on a read. It returns a dict, or None for nothing to add. A returned io.kubed/agent key is dropped with a warning, as is a result that is not a dict or does not survive a trip through JSON. An fn that raises leaves that agent unserved in that set, with an error naming the agent and the reason and an entry in skipped. The agents/list card is unchanged. mcp-kb serves io.kubed.mcp-kb/agent through it, for talent-show's kb-agents.

PLUG-74. Plugin.agent_files holds an AgentFile(name, path, renamed) for each agent the plugin serves in its set, in path order: name the served name, path its file's from the plugin root, /-separated as skipped writes it, and renamed True when it is served as <name>@<plugin> (PLUG-64). It is filled when the plugin enters a set, so keep updates it. AgentFile is exported from kubed.mcp.plugins. mcp-kb refuses agent files by path (its AGT-3) and reports renames on /health (its AGT-14) from it.

Prompts and agents as resources

PLUG-66. Each served prompt is also the resource prompts://<namespace>/<path>, and each served agent the resource agents://<namespace>/<path>. Addresses are by file, while names are by stem (PLUG-22, PLUG-28):

  • <path> is the file's path below the commands or agents folder it was read from;
  • a file the manifest lists by name is at its path below that kind's conventional folder (commands/, agents/) when it is inside it, and below the plugin root otherwise: a listed ./extra/x.md is prompts://<namespace>/extra/x.md, the prompt x;
  • an address keeps its file's name: x.prompt.md, the prompt x (PLUG-62), is at …/x.prompt.md;
  • an agent served as <name>@<plugin> (PLUG-64) is at agents://<namespace>/<name>@<plugin>.md, its served name, and a plugin that gets the plain name back (PLUG-50) has its file's address back.

An address is percent-quoted as a skill's URI is, with / and @ kept. No address has a . or .. segment: PLUG-12 drops a path with .., and a . segment is no segment. Each resource reads as the file as served (PLUG-56), text/markdown, frontmatter kept: with no rewriter, or one that leaves the file's text as it was, the file's bytes as read; otherwise the rewritten text. That is the same text a local install of the plugin holds before Claude Code reads it.

An address is a claim, as a name is (PLUG-18), whatever namespace makes it. Within one plugin the first file read keeps it, and a later one is skipped whole, its prompt or agent included, with the warning naming both files and the reason <address> is already served by <first path>. Across plugins, a prompt at an address an earlier plugin in its set serves refuses the plugin (PLUG-3, PLUG-18); an agent's is skipped, as PLUG-64 skips a <name>@<plugin> that is taken. Both say <address> is already served by plugin <name>, the agent's as a warning and an entry in skipped (PLUG-44). An agent's address is claimed after its name is decided, so it never refuses the plugin (PLUG-64), and a skipped agent claims no name. A file whose address has _index.md or _index.json as a segment, its own file name included, is skipped with the reason its address <address> is its folder's index (SKL-11).

PLUG-67. These resources are listed only as delivery says (DLV-8), and by default they are not. They always read by their exact URI, under the view (PLUG-54).

PLUG-68. Every folder a served prompt or agent file sits in is a directory resource, with its children and its two index files, as a skill's folders are (SKL-11 to SKL-18). The top folder is the namespace: for grafana/loki, prompts://grafana/loki is a folder, and prompts://grafana is one only when a plugin under grafana serves a prompt. A folder's children are the files and folders directly in it, from every plugin the view admits, sorted by URI:

  • a file's row is its resource: its MCP name, its prompt's or agent's description, text/markdown, and its _meta (PLUG-69, PLUG-70);
  • a folder's row is inode/directory, named <namespace>/<path>, with the description A folder of prompts in <namespace> or A folder of agents in <namespace>.

An index is rendered and rewritten with the build (PLUG-56), as a skill folder's is. Its Site (PLUG-57) is the first admitted plugin with a file in the folder, and path is that folder's path in it: the file's root-relative folder, less one segment for each folder between the index's folder and the file.

resources/directory/read and NameTheIndex (SKL-14, SKL-18) answer for these folders from the server's first plugin, whatever its plugins serve. Whichever of the agents extension (PLUG-27) and the Skills extension (PLUG-20, or a server's own serve(), SKL-4) is registered first binds resources/directory/read, and the other does not bind it again, so it is bound once in every order. Either answers from every provider (SKL-21). Only the Skills extension declares it (directoryRead, SKL-20). A server whose plugins serve no skill answers it without declaring it, and its indexes read with plain resources/read (SKL-15).

PLUG-69. Each prompt's row has _meta["io.kubed/prompt"], both in whichever folder's _index.json holds it and in resources/directory/read. That holds:

  • the prompt's MCP name;
  • its arguments as prompts/list gives them;
  • each invocation key PLUG-23 names (disable-model-invocation, user-invocable, argument-hint) that the served file's frontmatter sets, as written.

The keys are read from the served file's frontmatter, so a reader's Prompt (PLUG-62) has them too. A file without a header that parses as a mapping adds none, and a value that does not survive a trip through JSON is left out. A reader registers every prompt by walking the namespace's folders from prompts://<namespace>/_index.json, and takes all of it from those reads.

PLUG-70. Each agent's row, in the same places, has as _meta everything agents/get gives as the agent's _meta (PLUG-31): io.kubed/agent (PLUG-33) with the agent's MCP name added, and the server's own keys (PLUG-73). A reader registers every agent by walking the namespace's folders from agents://<namespace>/_index.json.

PLUG-71. The extensions are unchanged by these resources: agents/list, agents/get and prompts/get answer as before, from the same files.

PLUG-72. prompts:// and agents:// are reserved in a server that has a plugin:

  • once the server has a plugin, mcp.resource refuses a resource or template under either scheme, compared in lowercase, with a ValueError;
  • a server that already has a resource or template of its own under either scheme cannot serve its first plugin: add_plugin and staging.add refuse it (PLUG-3), and so does mcp.serve(staging), with the reason the server has its own resource at <uri>, and prompts:// and agents:// are the plugins'.

The first plugin's check reads the server's own resources and templates, those added on mcp.server directly included. Resources that a server brings through add_provider, or adds on mcp.server once it has a plugin, are not checked: the first provider to answer an address wins.

Clone this wiki locally