@ui-context/cli
v0.1.4
Published
CLI to generate MCP Servers from frontend component libraries
Maintainers
Readme
@ui-context/cli
CLI tool for ui-context. Generate MCP Servers from your React and Angular component libraries.
Installation
npm install -g @ui-context/cliOr use directly with npx:
npx @ui-context/cli generate -s ./src/components -p reactCommands
ui-context generate
Extract component metadata from source files.
ui-context generate -s ./src/components -p react -o ./output| Option | Description | Required |
|--------|-------------|----------|
| -s, --source <path> | Source directory | Yes |
| -p, --parser <name> | react or angular | Yes |
| -o, --output <path> | Output directory (default: ./ui-context-output) | No |
| --name <name> | Library name | No |
| --include <patterns...> | Glob patterns to include | No |
| --exclude <patterns...> | Glob patterns to exclude | No |
ui-context serve
Start an MCP server from generated metadata.
ui-context serve -d ./output/components.jsonui-context validate
Check metadata for completeness and quality.
ui-context validate -d ./output/components.jsonQuick Start
# 1. Generate metadata
npx @ui-context/cli generate -s ./src/components -p react
# 2. Validate
npx @ui-context/cli validate -d ./ui-context-output/components.json
# 3. Start MCP server
npx @ui-context/cli serve -d ./ui-context-output/components.jsonMCP Configuration
Add to Claude Desktop (~/.claude/claude_desktop_config.json):
{
"mcpServers": {
"my-design-system": {
"command": "npx",
"args": ["-y", "@ui-context/cli", "serve", "-d", "path/to/components.json"]
}
}
}Links
License
MIT
