Skip to content

About

Self-hosted H5P toolkit with no H5P server: a player web component that plays .h5p offline with xAPI, cmi5 and SCORM, and tools that build packages with AI (agent skills, MCP server), check them in a real player and preview them in VS Code.

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

11 stars

Watchers

1 watching

Forks

H5P Toolkit by Missing Elements

Play, build, check and package H5P content without an H5P server.

H5P is an open-source framework for interactive learning content (quizzes, interactive videos, presentations), shipped as .h5p files. Playing one usually takes Moodle, WordPress or Drupal with the H5P plugin, an h5p.com account, or Lumi on a desktop. This toolkit does those jobs with static files on your own site, command-line tools on your computer, and skills for your AI agent.

Live player demo · Build with AI · Offline app · H5P to SCORM · VS Code extension

What it does

To Use Agent skill
Play .h5p files on your own site, from a URL or from disk The <h5p-player> web component: h5p-offline-player with h5p-runtime h5p-player-setup
Play exports that lack their libraries h5p-libraries, the library pack
Keep the player on a separate domain and embed it by iframe h5p-embed h5p-player-setup
Put a package into an LMS h5p-embed --scorm for a SCORM zip, h5p-cmi5 for a cmi5 unit h5p-to-scorm
Build an activity from a prompt or a short JSON source h5p-author; h5p-mcp in Claude Desktop and other MCP apps; the build page in a chat app h5p-author
Check that a package plays, or preview it in your browser h5p-verify h5p-verify
Make a package's video start at once, not after a full download h5p-normalize h5p-normalize
Play .h5p files with no network, or in your editor The offline app; H5P Preview for VS Code, and on Open VSX for Cursor and VSCodium

The tools named h5p-… are on npm as @missing-elements/h5p-…, and each name links to its README.

Terms

  • Package: a .h5p file, not an npm package: a zip of the content and, usually, its libraries, the code of its content types. Exports from h5p.com and h5p.org often leave the libraries out.
  • Library pack: the libraries of every content type the H5P hub serves. With libraries="pack", the player downloads those a package lacks, and newer versions of those it carries.
  • Runtime: the H5P core, which runs the content in the player's frame. It is an npm package of its own because it is GPL-3.0 and the player is MIT.
  • untrusted: played as it is, a package's code runs as your site. untrusted runs none of it: the libraries come from the pack, or a bundle you name, and the content is checked as the H5P plugins for Moodle, WordPress and Drupal check an upload.

Quick start

Play a package on your site

With Vite or webpack 5:

npm install @missing-elements/h5p-offline-player @missing-elements/h5p-runtime
<h5p-player src="https://host.example/course.h5p"></h5p-player>
import '@missing-elements/h5p-offline-player'
import { runtime } from '@missing-elements/h5p-runtime'

const player = document.querySelector('h5p-player')
player.runtime = runtime
player.addEventListener('xapi', (e) => console.log(e.detail.statement)) // results arrive as events
  • The page must be on https:// or localhost, and a package on another origin needs CORS headers on its host.
  • An export without its libraries needs libraries="pack" on the element.
  • Play a package you did not make with untrusted. On a site with signed-in users, play every package untrusted, or embed the player from a separate domain with h5p-embed.

Setting up the player covers pages without a bundler, other bundlers, and the choice between installing and embedding. The element's API lists every attribute, property and event.

Build an activity with AI

In Claude Code or another agent that runs commands:

npx skills add missing-elements/h5p-toolkit --skill h5p-author

Then ask for an activity, such as "a five-question quiz on the water cycle, as H5P". The skill asks which content type, builds the .h5p, checks it and opens it for you to play.

Where no command can run, the build page turns what a chat app wrote into the file, in your browser, and h5p-mcp builds it onto your disk from Claude Desktop or another MCP app.

Use the command-line tools

npx @missing-elements/h5p-verify@latest course.h5p              # does it play? exit code 0 yes, 1 no
npx @missing-elements/h5p-verify@latest course.h5p --preview    # play it in your own browser
npx @missing-elements/h5p-embed@latest --scorm course.h5p       # write course.scorm.zip for an LMS
npx @missing-elements/h5p-normalize@latest course.h5p           # write course.normalized.h5p, which streams
npx @missing-elements/h5p-author@latest build quiz.json quiz.h5p  # build a package from a JSON source

They need Node 22 or later, and h5p-verify a Chromium-based browser such as Chrome or Edge. Keep @latest: without it, npm on an older Node quietly installs an old release.

Why this one

  • No H5P server anywhere. A .h5p plays from a URL on static hosting, with nothing unzipped and no backend. The comparison goes through h5p-standalone, Lumi, h5p.com and the H5P plugins.
  • It plays the files people actually have: exports without their libraries, against the library pack, and packages you did not make, untrusted.
  • What a model builds is checked. h5p-author writes a package that carries its libraries, which Moodle accepts as an upload, and h5p-verify plays it in the real H5P runtime in a headless browser before anyone hands it over.
  • Nothing you play passes through a server of ours. The packages have no account, cookies or telemetry. The library pack comes from jsDelivr unless you serve a copy, and the hosted demo counts page views, with no cookies (privacy).

It is not an editor, so content comes from the tools above or from an H5P site. It stores no results either: the player raises xAPI events, and your page decides where they go.

Agent skills

The five skills in the table are for Claude Code and other agents that read files and run commands, installed with skills; add --skill <name> for one. None needs a provider API key or an H5P server.

npx skills add missing-elements/h5p-toolkit

A chat app takes h5p-author as a zip to upload instead: download it from the page that says where it goes in each app.

Documentation

Status

Every npm package is at version 1, except h5p-mcp and the H5P Preview extension, which are 0.x; Compatibility says what a version number promises. Every week, CI rebuilds the library pack from the H5P hub and H5P's interface strings from Moodle's translations, opens a pull request when either changed, and plays every content type in the pack, trusted and untrusted.

Contributing

A pnpm workspace: see CONTRIBUTING.md and docs/development.md. AGENTS.md and design/ hold the design and the reasons behind it. Report vulnerabilities privately, as SECURITY.md describes.

Licence

Everything is MIT (LICENSE) except two npm packages:

  • h5p-runtime is GPL-3.0. It holds the H5P core from h5p-php-library and the script that boots it. The player talks to it only over HTTP and postMessage, and its NOTICE.md says what serving it entails.
  • h5p-libraries holds H5P's own libraries, each under its own licence, most of them MIT, as libraries.txt lists.

Bundled third-party code keeps its licence too: the player's Service Worker carries zip.js, BSD-3-Clause (NOTICE.md). Whether the GPL's copyleft reaches the page around the player is a legal question this README does not answer.

H5P is a trademark of H5P Group. This toolkit is made by Missing Elements and is not affiliated with or endorsed by H5P Group.

About

Self-hosted H5P toolkit with no H5P server: a player web component that plays .h5p offline with xAPI, cmi5 and SCORM, and tools that build packages with AI (agent skills, MCP server), check them in a real player and preview them in VS Code.

Topics

Resources

Code of conduct

Contributing

Security policy

Accessibility

Stars

11 stars

Watchers

1 watching

Forks

Releases

Sponsor this project

Packages

Used by

Contributors

Languages