Get the number of currently loaded extensions.
Get all loaded extension instances for inspection or testing.
Read-only array of loaded extensions with their driver class names.
The shared service registry for cross-extension service lookup and registration.
Run health checks on all loaded extensions.
Each extension's HealthCheck() is called independently. If one extension's
health check throws, it is reported as unhealthy without affecting others.
Array of health results, one per loaded extension.
Load and initialize all enabled extensions from config.
Extensions that fail to initialize are logged and skipped — they do not prevent other extensions from loading. This ensures one broken extension doesn't take down the entire server.
Express application for route registration.
Array of extension configs from mj.config.cjs.
Optionaloptions: LoadExtensionsOptionsPhased loading, HTTP server, and URL options.
Notify all loaded extensions across all phases that all extensions have been mounted.
Calls OnAllExtensionsMounted(context) on each extension that implements it.
Optionaloptions: {Shut down all loaded extensions gracefully.
Called during MJServer's shutdown sequence (SIGTERM/SIGINT). Extensions are shut down in reverse order of loading. Errors during shutdown are logged but do not prevent other extensions from shutting down.
Discovers, initializes, and manages the lifecycle of server extensions.
Called by MJServer's
serve()function during startup. The loader receives the merged extension list (Open App–discovered configs overlaid by hostmj.config.cjsserverExtensions[]), uses MJ'sClassFactoryto find registered extension classes, and callsInitialize()on each.Supports phased loading (pre-auth ahead of JWT middleware, post-auth behind it) and cross-extension service lookup and registration.