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

@leonio/kern-ux-mcp

v1.1.0-5

Published

Model Context Protocol (MCP) language server providing Kern UX component generation and strict accessibility validation.

Readme

Kern UX MCP Server

TypeScript MCP server that exposes Kern UX component tools (get_*), recursive composition rendering (render_composition), and strict accessibility validation (validate_html).

The repo has two main flows:

  1. Build a static component registry from kern-ux-plain sources plus reviewed overlay guidance.
  2. Use that registry to decide which MCP tools exist, then publish each tool's Zod input schema as JSON Schema for MCP clients.

Prerequisites

  • Node.js 24.16.0+

How It Fits Together

flowchart LR
  subgraph Build_Time
    A[kern-ux-plain stories + docs]
    B[docs/guidance-overlay.json]
    C[tools/manifest/build-manifest.ts]
    D[src/ux/registry.json]
    A --> C
    B --> C
    C --> D
  end

  subgraph Runtime
    D --> E[src/server.ts]
    E --> F[src/ux/tools.ts]
    F --> G[src/ux/tool-builders]
    G --> H[src/ux/schemas]
    G --> I[src/ux/templates]
    F --> J[src/ux/json-schema.ts]
    I --> K[src/ux/validate.ts]
  end

At runtime the registry decides which tools and component metadata are exposed. The tool builders bind that metadata to Zod schemas from src/ux/schemas, and src/ux/json-schema.ts converts those Zod schemas to JSON Schema for MCP tool discovery.

Use In MCP Clients

The published package is a stdio MCP server. The default install path for end users is npmjs:

{
  "mcpServers": {
    "kern-ux": {
      "command": "npx",
      "args": ["-y", "@leonio/kern-ux-mcp"]
    }
  }
}

If you prefer a global install, install the package once and reference the binary directly:

npm install -g @leonio/kern-ux-mcp
{
  "mcpServers": {
    "kern-ux": {
      "command": "kern-ux-mcp"
    }
  }
}

GitHub Packages is also published, but it is not the zero-friction default because it requires GitHub Packages authentication and scope routing in .npmrc.

If you want to install from GitHub Packages instead of npmjs, add this to your user or project .npmrc:

@leonio:registry=https://npm.pkg.github.com
//npm.pkg.github.com/:_authToken=YOUR_GITHUB_PAT

Then the same MCP client config works:

{
  "mcpServers": {
    "kern-ux": {
      "command": "npx",
      "args": ["-y", "@leonio/kern-ux-mcp"]
    }
  }
}

For GitHub Packages installs, your token needs package read access.

Development Install

npm install

Run From Source (stdio)

npm run dev

The server is runtime-decoupled from Kern UX source files and loads component metadata from the generated manifest:

Key Pieces

Common Commands

Install dependencies:

npm install

Regenerate the registry after changing manifest inputs:

npm run generate-manifest

Run the server from source:

npm run dev

Build production output:

npm run build

Run tests, lint, and typecheck:

npm run test
npm run lint
npx tsc --noEmit

Generate a CycloneDX SBOM and run a local Grype scan:

npm run sbom:generate
npm run scan:vulns

Fail the local Grype scan on high-or-greater findings:

npm run scan:vulns:high

Build and inspect the package tarball with the generated SBOM included:

npm run pack:inspect

These commands expect local syft and grype binaries on PATH.

Registry Build

Use the shipped src/ux/registry.json if you are only running or packaging the server. Regenerate it when you change any of the contributor-facing inputs:

The build script already regenerates the manifest through prebuild, so npm run build is enough for a normal package build.

For release packaging, use npm run pack:release to build, generate sbom.cyclonedx.json, and create the npm tarball with the SBOM embedded.

Optional source override for generation:

  • KERN_UX_PLAIN_ROOT=/path/to/kern-ux-plain npm run generate-manifest

Dev Loop (Windows / PowerShell)

Use the loop scripts when you want a fast sample-app workflow with samples/basic-layout:

  • npm run loop:start: sample app only
  • npm run loop:full: sample app + test watch + TypeScript watch + open sample workspace
  • npm run loop:stop: stop loop processes

The sample app itself can also be started directly:

npm run sample:dev

More Docs

Contributor Workflow

Troubleshooting

  • Registry missing at runtime: run npm run generate-manifest or npm run build.
  • Manifest generation finds too few components: point KERN_UX_PLAIN_ROOT at the correct kern-ux-plain checkout.
  • Overlay validation fails: fix docs/guidance-overlay.json, then rerun npm run validate-guidance-overlay and npm run generate-manifest.
  • syft or grype not found locally: refresh your shell PATH after installation, then rerun npm run sbom:generate or npm run scan:vulns.

Tools

  • get_<component>: Returns canonical HTML (best-effort extracted from Storybook) plus validation results.
    • Params: locale?: 'de'|'en' (default de), strict?: boolean.
    • Experimental components include an HTML comment warning.
  • validate_html: Strictly validates HTML against Kern UX A11Y contracts.
  • render_composition: Renders recursive content blocks (Grid/Card/Section/Disclosure/Text/HTML/Button/Badge) as one composed layout.

Composition Patterns

Use render_composition when you need nested structures in one call.

Side-by-Side Cards

{
  "locale": "de",
  "contentBlocks": [
    {
      "kind": "grid",
      "grid": {
        "columns": 2,
        "columnsContent": [
          [
            {
              "kind": "card",
              "card": {
                "header": { "title": "Linke Karte" },
                "contentBlocks": [{ "kind": "text", "text": "Inhalt links" }]
              }
            }
          ],
          [
            {
              "kind": "card",
              "card": {
                "header": { "title": "Rechte Karte" },
                "contentBlocks": [{ "kind": "text", "text": "Inhalt rechts" }]
              }
            }
          ]
        ]
      }
    }
  ]
}

Deep Section Chain

{
  "locale": "de",
  "contentBlocks": [
    {
      "kind": "section",
      "section": {
        "headingText": "Kompositionsbereich",
        "contentBlocks": [
          {
            "kind": "grid",
            "grid": {
              "columns": 1,
              "columnsContent": [
                [
                  {
                    "kind": "card",
                    "card": {
                      "header": { "title": "Karte mit Disclosure" },
                      "contentBlocks": [
                        {
                          "kind": "disclosure",
                          "disclosure": {
                            "triggerLabel": "Details anzeigen",
                            "open": true,
                            "contentBlocks": [
                              { "kind": "text", "text": "Tiefer Inhalt" }
                            ]
                          }
                        }
                      ]
                    }
                  }
                ]
              ]
            }
          }
        ]
      }
    }
  ]
}

Notes / Known Repo Gaps

In this workspace snapshot, kern-ux-plain references scripts/ and .storybook/ content that is not required by this MCP server workflow. Manifest generation and runtime behavior here do not rely on those missing parts.