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.
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.
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 reads theserverExtensionsarray frommj.config.cjs, uses MJ'sClassFactoryto find registered extension classes, and callsInitialize()on each.Discovery Flow
serverExtensions[]array frommj.config.cjsClassFactory.CreateInstance(BaseServerExtension, driverClass)Initialize(app, config)Usage