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

@ulu/mcp-context-server

v0.0.3

Published

An agnostic Model Context Protocol (MCP) engine that exposes task-driven frontend documentation to AI agents via distributed UI library providers.

Readme

@ulu/mcp-context-server

A lightweight engine (powered by the Model Context Protocol) designed to bridge the gap between AI agents and complex frontend library ecosystems.

Table of Contents:

The Problem

Exposing a large UI library to an AI agent is challenging. Throwing raw source code or unstructured Markdown at an LLM quickly overwhelms its context window, leading to hallucinations and degraded performance. For humans, we build regular documentation (HTML websites). For AI, we need Task-Driven Context.

Furthermore, building a monolithic AI server for multiple libraries creates versioning nightmares (e.g., the server expects Vue 3 syntax, but the developer installed a Vue 2 version of your library).

The Solution

@ulu/mcp-context-server solves these issues through two core architectural principles:

1. Task-Driven Context (TDC)

The core innovation of this engine is forcing libraries to categorize their documentation into distinct tiers based on AI Intent (Tasks). This prevents the AI from reading a massive AST when it simply wants to copy-paste a button component.

Providers map their data into these task tiers, and the Server automatically registers them as dynamically prefixed tools (e.g., ulu_get_snippets):

  • Builder Tier (get_snippets): Used when the AI's task is writing UI code. High signal, low noise. Returns copy-pasteable HTML or Vue variations.
  • Configuration Tier (get_configuration): Used when the AI's task is altering themes or component state. Returns a concise list of SCSS $config maps, CSS variables, or component props.
  • Conceptual Tier (get_guides): Used when the AI's task is understanding architecture. Returns overarching library knowledge and installation instructions.
  • In-Depth Reference Tier (get_reference): Used only as a last resort when the AI's task is deep debugging. Returns the full, raw AST.

2. Distributed Provider Model

This package is incredibly lightweight. It knows nothing about parsing SCSS, JavaScript, or Vue.

Instead, the UI libraries themselves (@ulu/frontend, @ulu/frontend-vue) parse their own code during their build step. They map their data into our standardized Task-Driven schema and ship it via a specific ulu-mcp-provider export subpath inside their NPM package. Because the AI documentation ships with the NPM package, the AI is guaranteed to read documentation that exactly matches the code the developer has installed locally.


Usage for End Users

This is the recommended approach for developers building applications with ULU UI libraries.

1. Installation

Install the server as a dev dependency in your project:

npm install -D @ulu/mcp-context-server

2. Configuration

You can configure the server either by creating a ulu-mcp.config.js file at the root of your project or by adding an "ulu-mcp" property to your package.json.

Option A: ulu-mcp.config.js

export default {
  providers: [
    "@ulu/frontend",
    "@ulu/frontend-vue"
  ]
};

Option B: package.json

{
  "ulu-mcp": {
    "providers": [
      "@ulu/frontend",
      "@ulu/frontend-vue"
    ]
  }
}

Behind the scenes, the CLI loads your configuration and dynamically attempts to import the [package-name]/ulu-mcp-provider subpath.

3. Connect your AI Agent

Point your AI's MCP configuration (e.g., Gemini CLI, Claude Desktop, Cursor) to the local CLI binary using npx.

Example configuring gemini-cli:

{
  "mcpServers" : {
    "ulu": {
      "command": "npx",
      "args": ["ulu-mcp"]
    }
  }
}

Usage for Advanced Users (Programmatic)

For custom servers, advanced tooling, or HTTP hosting, you can instantiate the server manually, pass in the provider objects, and provide a custom transport layer.

The providers array accepts any standard JavaScript object that conforms to the Task-Driven schema, regardless of how it was generated or imported.

import { ContextServer } from "@ulu/mcp-context-server";
// Import provider data (can be JSON, a JS module, or dynamically fetched)
import vanillaProvider from "@ulu/frontend/ulu-mcp-provider" with { type: "json" };
import myCustomProvider from "./my-custom-provider.js";

const server = new ContextServer({
  serverName: "my-custom-context-server",
  providers: [
    vanillaProvider,
    myCustomProvider
  ]
});

// Starts the server (defaults to StdioServerTransport)
server.start();

Building a Provider (For Library Authors)

This package is designed to be open-ended. Any UI library, design system, or frontend framework can implement the Task-Driven schema to provide perfect AI context for their users.

To become a provider, you must expose a pure JSON object that conforms to the schema. While the programmatic API accepts any JS object, exporting a pure JSON file ensures that your documentation can be easily fetched over a network by future HTTP-based web agents without requiring a JavaScript runtime.

1. Build-Time Generation

During your library's build step, output an mcp-data.json file containing the necessary metadata (name, prefix) alongside the required snippets, configuration, reference, and guides objects.

{
  "name": "@my-org/my-ui-library",
  "prefix": "my_ui",
  "snippets": { ... },
  "configuration": { ... }
}

2. Package Export

Your package.json must map the "exports" field to expose this specific JSON file via the "./ulu-mcp-provider" subpath:

{
  "name": "@my-org/my-ui-library",
  "exports": {
    ".": "./dist/index.js",
    "./ulu-mcp-provider": "./dist/mcp-data.json"
  }
}