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

@santi020k/lumen-mcp

v2.0.0

Published

Model Context Protocol server for the Lumen multi-framework primitive UI system. Lets AI agents list components, read real component source, and follow Lumen tokens and rules.

Readme

@santi020k/lumen-mcp

A Model Context Protocol server for the Lumen multi-framework primitive UI system. It gives AI agents structured access to components, real framework contracts, recipes, design tokens, accessibility behavior, runtime events, native platform contracts, and Lumen's generation rules.

The published server ships a self-contained catalog snapshot, so consumers do not need a checkout of the Lumen repository.

Tools

| Tool | Purpose | | --- | --- | | lumen_list_components | List components with descriptions, categories, framework availability, collections, and recipe membership. Filter by framework, recipe, or natural-language query. | | lumen_get_component | Get a component for astro, react, or elements at summary, usage, or source detail. Usage includes imports, styles, props or attributes, examples, accessibility, guidance, and events. | | lumen_list_native_components | List native components and filter them by react-native, swiftui, or compose. | | lumen_get_native_component | Get native installation, setup, import, API, example, accessibility guidance, and optional adapter source for one platform. | | lumen_get_recipe | Get a recipe or component set with its purpose, components, files, categories, and framework-specific install command. | | lumen_search | Rank natural-language matches across web and native contracts, recipes, tokens, and agent rules. Optionally filter by web framework or native platform. | | lumen_get_meta | Return deterministic snapshot provenance, package versions, schema version, component count, and catalog hash. | | lumen_get_catalog_manifest | Return stable web component, native component, and recipe fingerprints that clients can retain between upgrades. | | lumen_diff_catalog | Compare a retained manifest with the current snapshot and report added, changed, removed, and unchanged entries. | | lumen_diagnose | Verify snapshot integrity and report web framework plus native platform coverage when testing a connection. | | lumen_get_tokens | Return semantic token names, base colors, glass tokens, and the theme attribute. | | lumen_get_rules | Return the Lumen agent rules from llms.txt. |

Every tool returns both readable text and validated structuredContent.

Resources

| Resource | Contents | | --- | --- | | lumen://meta | Snapshot provenance, package versions, and deterministic catalog hash. | | lumen://catalog-manifest | Stable component and recipe fingerprints for change detection. | | lumen://diagnostics | Snapshot integrity results and framework coverage. | | lumen://rules | Agent rules as Markdown. | | lumen://tokens | Structured design tokens. | | lumen://components | Compact component catalog. | | lumen://components/{name} | Component metadata and default Astro usage. | | lumen://native-components | Compact native component catalog with platform availability. | | lumen://native-components/{name} | Native component metadata and usage for an available platform. | | lumen://recipes/{name} | Recipe metadata and install commands. |

Install and connect

The stdio command for any MCP client is:

npx -y @santi020k/lumen-mcp

Node.js 20.20 or newer is supported.

Codex

Register it from the Codex CLI:

codex mcp add lumen -- npx -y @santi020k/lumen-mcp
codex mcp list

Or add a project-scoped .codex/config.toml:

[mcp_servers.lumen]
enabled = true
command = "npx"
args = ["-y", "@santi020k/lumen-mcp"]
startup_timeout_sec = 10.0
tool_timeout_sec = 30.0

Start or resume a Codex task after changing MCP configuration so the new tools are loaded.

Claude Desktop

Add this server to claude_desktop_config.json:

{
  "mcpServers": {
    "lumen": {
      "command": "npx",
      "args": ["-y", "@santi020k/lumen-mcp"]
    }
  }
}

Cursor

Add this server to .cursor/mcp.json:

{
  "mcpServers": {
    "lumen": {
      "command": "npx",
      "args": ["-y", "@santi020k/lumen-mcp"]
    }
  }
}

Any stdio MCP client

Use the equivalent of this generic configuration:

{
  "name": "lumen",
  "transport": "stdio",
  "command": "npx",
  "args": ["-y", "@santi020k/lumen-mcp"]
}

Client configuration envelopes differ, but the command and arguments remain the same.

Streamable HTTP

For local network clients or a self-hosted deployment, start the included Streamable HTTP transport:

npx -y --package @santi020k/lumen-mcp lumen-mcp-http

It binds to 127.0.0.1:3000 by default and exposes MCP at http://127.0.0.1:3000/mcp, a liveness check at /health, and a catalog readiness check at /ready. Readiness returns the loaded catalog hash and server version, or a safe 503 response when the catalog cannot initialize. Configure the transport with LUMEN_MCP_HOST, LUMEN_MCP_PORT, and a comma-separated LUMEN_MCP_ALLOWED_HOSTS. The transport applies safe response headers and a fixed-window request limit of 120 requests per minute by default. Malformed request bodies and initialization failures return bounded JSON errors without stack traces or local paths.

Public deployments can also set:

  • LUMEN_MCP_OPENAI_CHALLENGE to serve the exact single-line verification token at /.well-known/openai-apps-challenge.
  • LUMEN_MCP_RATE_LIMIT_MAX and LUMEN_MCP_RATE_LIMIT_WINDOW_MS to tune positive integer rate limits.
  • LUMEN_MCP_TRUST_PROXY=true only behind a controlled proxy that sanitizes forwarded headers.

The process listens over HTTP. Public hosting must terminate TLS, configure the exact allowed host, and add authentication when the deployed data or operating model requires it. The public Lumen catalog does not require user authentication.

AI plugin package

The repository includes a submission-ready plugin package in plugins/lumen-ui. It combines the portable lumen-ui skill with this MCP server for Codex, ChatGPT, and Claude Code. The public OpenAI Plugins Directory submission uses a hosted Streamable HTTP endpoint; see the submission checklist for deployment requirements, listing copy, annotation justifications, and reviewer test cases.

Claude Code uses the package's stdio configuration and the repository marketplace in .claude-plugin/marketplace.json. See the Claude Code plugin guide for installation and validation.

Recommended agent workflow

  1. Read lumen://meta and call lumen_diagnose to identify and verify the bundled snapshot.
  2. Read lumen://rules.
  3. Call lumen_search with the requested use case and target framework or platform.
  4. For web, call lumen_get_component; for native, call lumen_get_native_component with detail: "usage".
  5. Follow the returned framework behavior section: mount Astro UIPrimitives once, use the named React hook/controller, or register custom elements once.
  6. Inspect a related recipe with lumen_get_recipe when the UI needs multiple primitives.
  7. Request detail: "source" only when the usage contract is insufficient.
  8. Use lumen_get_tokens before adding custom styling.
  9. Cache lumen://catalog-manifest; after an upgrade, pass it to lumen_diff_catalog to refresh only changed contracts.

Example calls:

{ "name": "lumen_search", "arguments": { "query": "accessible date input", "framework": "react", "limit": 5 } }
{
  "name": "lumen_get_component",
  "arguments": {
    "name": "DateRangePicker",
    "framework": "react",
    "detail": "usage"
  }
}
{
  "name": "lumen_get_recipe",
  "arguments": {
    "name": "advanced-fields",
    "framework": "react"
  }
}
{
  "name": "lumen_get_native_component",
  "arguments": {
    "name": "Settings row",
    "platform": "swiftui",
    "detail": "usage"
  }
}

Local repository usage

This repository includes a project-scoped Codex configuration that launches:

pnpm --filter @santi020k/lumen-mcp local

The local launcher builds the MCP package when dist is missing or older than the TypeScript source, then starts the server without writing build logs to the MCP stdout channel.

Useful development commands:

pnpm --filter @santi020k/lumen-mcp generate
pnpm --filter @santi020k/lumen-mcp build
pnpm --filter @santi020k/lumen-mcp test
pnpm --filter @santi020k/lumen-mcp test:coverage
pnpm --filter @santi020k/lumen-mcp check:snapshot
pnpm --filter @santi020k/lumen-mcp eval
pnpm --filter @santi020k/lumen-mcp smoke:package

Programmatic use

The reusable handlers return readable text plus typed data:

import {
  getComponent,
  getMeta,
  getNativeComponent,
  getRecipe,
  search
} from '@santi020k/lumen-mcp/tools'

const matches = search({ limit: 5, query: 'date input' }).data.results
const snapshot = getMeta().data.meta

const component = getComponent({
  detail: 'usage',
  framework: 'react',
  name: 'DateRangePicker'
}).data.component

const nativeComponent = getNativeComponent({
  detail: 'usage',
  name: 'Settings row',
  platform: 'react-native'
}).data.component

const recipe = getRecipe({
  framework: 'react',
  name: 'advanced-fields'
}).data.recipe

You can also embed the server:

import { createLumenServer } from '@santi020k/lumen-mcp'

const server = createLumenServer()

Snapshot generation

scripts/generate-data.mjs builds data/lumen-data.json from:

  • The shared component catalog and registry metadata.
  • Astro and React component declarations.
  • The Web Component definition registry.
  • The native registry and React Native, SwiftUI, and Compose adapter sources.
  • Native documentation examples, API rows, accessibility, and platform guidance.
  • Documentation examples, API rows, guidance, keyboard interactions, and runtime events.
  • Design tokens, recipes, docs/ai-usage.md, and llms.txt.

The output is deterministic and carries the package version used by the MCP initialization response. It also includes every framework package version, a schema version, and a SHA-256 catalog hash. CI regenerates the snapshot and fails when the committed file is stale. The release group versions the MCP alongside Lumen framework packages, and the package smoke test installs the packed artifact into a temporary consumer project before making a real stdio handshake.

The evaluation gate also runs a curated natural-language search benchmark, calls every available component/framework contract through MCP, parses all Astro and custom-element examples, and type-checks every React example against the built React package. A generated example that is syntactically valid but uses an unsupported React prop therefore fails before release.

License

MIT © Santiago Molina