npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

module-federation-ai-debug

v0.0.1

Published

A Module Federation runtime plugin for AI-driven local remote debugging

Downloads

26

Readme

module-federation-ai-debug

A browser Runtime Plugin that lets an AI agent redirect selected Module Federation remotes to locally running manifests without operating Chrome DevTools or requiring the Module Federation Chrome extension.

The package mounts a lightweight floating console by default. It uses native DOM and Shadow DOM, so it does not add React or another UI framework to the host. The console focuses on proxy management: add, edit, enable, remove, clear, save, and reload.

Host integration

Add the package to the host's runtimePlugins. The plugin reads the URL before the host registers its remotes and applies matching overrides from localStorage.__MF_DEVTOOLS__.

module.exports = {
  plugins: [
    new ModuleFederationPlugin({
      runtimePlugins: [require.resolve('module-federation-ai-debug')],
    }),
  ],
};

The purple MF button opens the console. Disable it when only URL automation is needed by wrapping the plugin factory with { console: false }. Programmatic users can customize its initial state and save behavior:

import aiDebugRuntimePlugin from 'module-federation-ai-debug';

aiDebugRuntimePlugin({
  console: {
    defaultOpen: true,
    reloadOnSave: false,
    zIndex: 10000,
  },
});

An AI agent can then start one remote and open the host with a generated query parameter:

const config = {
  overrides: {
    checkout: 'http://localhost:3001/mf-manifest.json',
  },
};

const url = new URL('https://host.example.com/checkout');
url.searchParams.set('__mf_devtools', JSON.stringify(config));
console.log(url.href);

URLSearchParams performs the required percent encoding. If constructing the query manually, use encodeURIComponent(JSON.stringify(config)) exactly once.

Overrides merge with saved rules by default. Add replace: true to discard all existing override rules first. Set an individual value to null to delete only that rule:

{
  "replace": true,
  "overrides": {
    "checkout": "http://127.0.0.1:3001/mf-manifest.json",
    "legacyRemote": null
  }
}

The plugin preserves unrelated DevTools settings, clears stale snapshot data, removes a successfully consumed parameter from the address bar, and resolves overrides by remote name or alias.

For safety, HTTP(S) JSON manifests on localhost and 127.0.0.1 are allowed by default. Programmatic users can explicitly allow production hosts:

import { aiDebugRuntimePlugin } from 'module-federation-ai-debug/core';

const plugin = aiDebugRuntimePlugin({
  allowedHosts: ['assets.example.com'],
});

For environments that inject before the host runtime is initialized, use registerAIDebugRuntimePlugin(globalThis). This creates the Module Federation global plugin list when necessary and registers the plugin only once.