feat(mcp): both servers serve the h5p-author skill over MCP, and the skill builds with their tools (#280)
Closes #280.
The h5p-author skill, shared everywhere: both MCP servers now serve it, and wherever the skill sits beside their tools it builds with them.
What changes
- Both servers serve the skill over MCP.
h5p-mcp,h5p-mcp-appand so the Worker declareio.modelcontextprotocol/skills(SEP-2640, Final), answerskills/listandskills/get, and serveskill://h5p-author/:SKILL.md,LICENSEand the.mdfiles underreferences/, as the author package ships them, and nothing else of the package. It's the SDK'sSkillsExtensionover files read once at start (skillCataloginanswers.mjs). A chat without the extension sees no change: the instructions andh5p_typesstay. - Route 0 in the skill (
references/build/tools.md). Where the chat hash5p_buildorh5p_play, those tools build. The tool's answer is the hand-over: no command, no npm check, no step 4. Step 1 reads an unlisted type's fields withh5p_typeswhere it's there. Step 3's early npm check now says "unless route 0's tools build". - The Worker carries the skill.
stage.mjscopiesSKILL.mdandLICENSEbesidereferences/, andwrangler.jsoncadds them to the Text rules. LICENSE has no extension, so it's named exactly. - Docs:
design/mcp.mdanddesign/author.md(the rules, with the numbers below), plus a paragraph in the mcp README.
The hybrid pattern
This gives the hybrid pattern in full:
- the logic stays in the MCP servers;
- the skill reaches an agent in two ways: installed by
npx skills add missing-elements/h5p-toolkit --skill h5p-author(.agents/skills/for Codex, Gemini CLI, Cursor, Copilot and others,.claude/skills/for Claude Code), or served by the server it's connected to; - route 0 keeps either copy from bypassing the tools.
How it was tested
-
SDK client:
server.test.ts:skills/listgivesskill://h5p-author/SKILL.md, andreferences/build/tools.mdreads.app.test.ts: the capability is declared.skills/listis fetched raw. The resource list equalsLICENSE,SKILL.mdand every reference.md.SKILL.mdreads equal to the package's, andpackage.jsonis refused. A host'sreferencesmust haveSKILL.mdbeside it or it's rejected.- mcp: 44/44 tests, and the typecheck passes.
-
Worker:
skills/listand every skill resource read equal the local server's (7/7). -
Skills project: 82/82, front matter included.
-
Haiku in Claude Code, with the skill as files beside a server's tools (the local server's
h5p_buildor the app server'sh5p_play), asked for a True/False question:Case Skill before route 0 With route 0 Not told to use the skill used the tools without opening the skill, 3 of 3 same, 5 of 5 Told to use the skill ran npx, tools unused, 3 of 3, $0.007built with the tools, 9 of 9, $0.004 Two of the first five route-0 runs also ran the npm check first. After the "unless route 0's tools build" wording, none of the next four did.
-
Not seen in a chat yet. Claude Code 2.1.331 has an MCP skills client, but it never called
skills/list, on the 2025 protocol or 2026-07-28, on Haiku, Sonnet or Opus. It's behind an internal switch. This is checked again when a chat turns it on.
After merging
- Redeploy the Worker.
- Releases, when asked:
- h5p-author, so the package ships route 0;
- h5p-mcp, which serves what the installed author package holds.
npx skills update -gfor global copies.
Summary by cubic
Both MCP servers now serve the h5p-author skill over MCP, and the skill builds with the servers' tools instead of running npm when those tools are present.
- The local server, the app server, and the Worker serve the skill as the author package ships it —
SKILL.md,LICENSE, andreferences/— via the Skills extension (SEP-2640); chats without the extension see no change. - The skill gains route 0: where the chat has
h5p_buildorh5p_play, those tools build and their answer is the hand-over, with no command, npm check, or step 4. - The skill's files are read once at start, without following links; a missing package means no skill is served, while a host's missing
SKILL.mdis said at start. - Haiku in Claude Code, told to use the skill, now built with the tools in 9/9 runs instead of running
npx(3/3 before, at double the cost).