feat(mcp): a host's app server takes its own build page and title; the hosted Worker leaves (#299)

Merged
AL
11h ago
+127-1228

Closes #299.

What changes

  • createApp() and h5p-mcp-app take build and title, beside site:
    • build is 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.
    • title is 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 --build and --title.
  • The card opens a link of the site or of the build page's origin, and no other. Its policy's redirect_domains names both.
  • apps/mcp-worker leaves this repository, with docs/mcp-worker.md and its lines in AGENTS.md, SECURITY.md and the design files. design/mcp.md keeps one line on what a host passes createApp(). 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 comments passes.

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() and h5p-mcp-app accept the new options; the command sets them with --build and --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_domains names both.
  • site and build must be http: or https: 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 run createApp() themselves.