feat(mcp): a host's app server takes its own build page and title; the hosted Worker leaves (#299)
Merged
AL
11h ago+127+127+012345678901234567890123456789-1228-1228-0123456789012345678901234567890123456789
Closes #299.
What changes
createApp()andh5p-mcp-apptakebuildandtitle, besidesite:buildis the build page's address. A chat with no card is sent there, and the card may open it as well as the site, so a play page on one site can link to a build page on another. Its default is the site's/h5p/build/, as before.titleis the name the server gives itself in a chat. Its default is "H5P Author MCP by Missing Elements", as before.- The command takes them as
--buildand--title.
- The card opens a link of the site or of the build page's origin, and no other. Its policy's
redirect_domainsnames both. apps/mcp-workerleaves this repository, withdocs/mcp-worker.mdand its lines in AGENTS.md, SECURITY.md and the design files.design/mcp.mdkeeps one line on what a host passescreateApp(). The lockfile loses wrangler and the Workers runtime.
Nothing changes for a host that passes neither option: the same site, build page and name.
Tested
tests/app.test.ts: a host's site, build page and title reach the server's name, its/answer, the card and its policy, and the no-card answer.tests/card.test.ts: the card opens the site's and the build page's links for the page, and not a third site's or a non-address. This fails without the change.- mcp: typecheck, 48 tests. Every package typechecks;
pnpm commentspasses.
To release: h5p-mcp 0.10.0, a minor for the new options.
Summary by cubic
Adds build and title options to the MCP app server so a host can send people to its own build page and name itself in a chat, and removes the hosted Cloudflare Worker from this repository.
New Features
createApp()andh5p-mcp-appaccept the new options; the command sets them with--buildand--title. Without them, behavior is unchanged: the site's/h5p/build/and "H5P Author MCP by Missing Elements".- The card now opens a link of the site or of the build page's origin, and no other; its policy's
redirect_domainsnames both. siteandbuildmust behttp:orhttps:addresses; another scheme is refused with an error.
Refactors
apps/mcp-worker, its docs, and the lockfile's wrangler and Workers runtime leave the repository. Hosts runcreateApp()themselves.