@aleph-alpha/lib-mcp
v1.3.0
Published
MCP Server for UI Library component discovery tools.
Readme
@aleph-alpha/lib-mcp
MCP (Model Context Protocol) Server for UI Library component discovery tools.
Overview
This package provides an MCP server that enables AI assistants (like Claude and Cursor) to discover and understand UI Library components. It offers tools to list available components and retrieve detailed documentation including props, examples, and usage guidance.
Installation
pnpm add @aleph-alpha/lib-mcp @aleph-alpha/ui-libraryUsage
Configure MCP Server
Run the install command to configure your IDE:
# For Claude Code
npx @aleph-alpha/lib-mcp mcp-install
# For both Claude Code and Cursor
npx @aleph-alpha/lib-mcp mcp-install --cursorAfter installation, restart your IDE to activate the MCP tools.
Available MCP Tools
Once configured, the following tools are available to your AI assistant:
list_components
Lists all available UI components. Supports optional filtering by name, category, or description.
list_components
list_components --filter="button"
list_components --filter="form"get_component_docs
Retrieves full documentation for a specific component including:
- Component description
- Props with types, defaults, and descriptions
- Sub-components (if applicable)
- Usage guidance
- Code examples
get_component_docs UiButton
get_component_docs Button # "Ui" prefix is optionalDevelopment
Building
pnpm buildGenerating Component Metadata
pnpm generate:component-metaTesting
pnpm testHow It Works
The MCP server reads component metadata from:
types.ts: Extracts props, their types, descriptions, and component-level JSDoc tags (@category,@useCases,@keywords,@related)*.stories.ts: Extracts code examples and usage guidance from Storybook storiescomponents-meta.json: Pre-generated metadata for faster lookups
CLI Commands
| Command | Description |
|---------|-------------|
| mcp-install | Configure MCP server for IDE |
| serve | Start the MCP server (used internally by IDE) |
| --help | Show help message |
License
Apache-2.0
