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

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

The demo page playing a quiz in the h5p-player element: untrusted, its libraries from the site's pack, its content checked

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

Play a package on your site

A package, a .h5p file, plays from a URL or from disk. 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.
  • Packages play safely by default, whoever made them: none of their own code runs. Add trusted only for a package you made, to play it with its own code. On a site with signed-in users, keep trusted off, 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

Ask a chat for an activity: the reply plays it, and its .h5p is saved from there.

Claude, asked for a quiz on the water cycle: the reply plays it in a card with a Download .h5p button ChatGPT: a drag and drop activity on capitals playing in the reply Grok: a Course Presentation playing in the reply

Claude, ChatGPT and Grok, each with h5p-mcp-app added as a connector: a server you host at a public https address. The activity is built and played in the person's browser.

In Claude Code or another agent that runs commands, install the skill:

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.

With neither, h5p-mcp builds the file onto your disk from Claude Desktop or another MCP app, and the build page turns what a chat app wrote into the file, in your browser.

Check a package, and put it into an LMS

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.

The H5P to SCORM page with a quiz chosen, showing what its zip will hold

H5P to SCORM builds the same zip in your browser, and nothing is uploaded. The LMS records the score, each question's result and the learner's place, as far as the content and SCORM allow (what is recorded). For a cmi5 unit, there is h5p-cmi5.

Play offline, and in your editor

The offline app playing an interactive video from a .h5p file H5P Preview: a quiz playing in a VS Code editor tab, with the Explorer beside it

The offline app installs from the browser and plays .h5p files with no network. H5P Preview plays them in VS Code, and from Open VSX in Cursor and VSCodium.

The tools

Tool What it does Agent skill
h5p-offline-player The <h5p-player> web component h5p-player-setup
h5p-runtime The H5P core, which runs the content in the player's frame. GPL-3.0, so a package of its own
h5p-libraries The library pack: the libraries of every content type the H5P hub serves, for exports that lack theirs
h5p-embed The player as a site for a separate domain, embedded by iframe; --scorm writes a SCORM zip h5p-player-setup, h5p-to-scorm
h5p-cmi5 A page holding the player as a cmi5 unit
h5p-author A package from a short JSON source, and a package back to one h5p-author
h5p-mcp Builds, reads and checks packages from Claude Desktop and other MCP apps on your computer
h5p-mcp-app Plays an activity in a chat app's reply
h5p-verify Checks that a package plays, or previews it in your browser h5p-verify
h5p-normalize Rewrites a package so that its video can start at once, not after a full download h5p-normalize
H5P Preview Plays a .h5p in a VS Code editor tab

The tools named h5p-… are on npm as @missing-elements/h5p-…. The skills 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.

Why this one

  • Safe by default. Every package plays as data: none of its own code runs on your site, and its content is checked as an H5P plugin checks an upload. trusted is the exception, for packages you made.
  • 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.
  • 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).
  • Kept current. 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. The player, h5p-embed and h5p-verify are at version 2 and the other npm packages at 1, except h5p-mcp, h5p-mcp-app and H5P Preview, which are 0.x; Compatibility says what a version number promises.

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.

Documentation

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