Stencil Component Library MCP Server
Provides access to a Stencil component library's generated documentation, enabling listing, searching, comparing, and exporting component details such as props, events, slots, and dependencies.
This server does not currently have a deployable release on Glama. Follow the repository's setup instructions to install and configure it for your MCP client, including any required credentials and local dependencies.
Stencil Component Library MCP Server
A Model Context Protocol (MCP) server template that gives Claude AI access to your Stencil component library documentation.
Note: This project started as a fork of SterlingChin's MCP Weather Server, which provided an excellent foundation for building MCP servers. The original weather server implementation has been repurposed to serve Stencil component library documentation.
What is MCP?
Model Context Protocol (MCP) is an open communication framework that allows AI models like Claude to interact with external tools and data sources. This template enables Claude to access your component library documentation and help you build UIs with your components.
Learn more about MCP:
Related MCP server: DevDocs MCP Server
What This Repository Contains
This repository provides:
Complete MCP Component Library Server Template: A fully functional implementation that gives Claude access to your Stencil component documentation
Component Documentation Integration: Reads from Stencil's generated JSON docs
Configuration Examples: Sample configuration files for connecting to Claude Desktop
Features
The MCP Component Library Server implements 11 powerful tools to help you work with your component library:
Core Tools
list-components: Get a list of all components in your component library
get-component-details: Retrieve detailed information about a specific component (props, events, slots)
generate-component-recipe: Generate usage examples and code snippets based on what you want to build
Discovery Tools
search-components: Search for components by keyword in their name, description, props, or events
find-components-with-prop: Find all components that have a specific property (e.g., "disabled", "value")
find-components-with-event: Find all components that emit a specific event (e.g., "click", "change")
Analysis Tools
compare-components: Compare two components side-by-side to see their differences
get-component-dependencies: Show dependencies and dependents for a component
get-all-props: List all unique property names across the entire component library
get-all-events: List all unique event names across the entire component library
Documentation Tools
generate-component-docs-markdown: Export component documentation as formatted markdown
Once connected, Claude can:
Tell you what components are available in your component library
Explain how to use specific components
Show you all the props, events, and slots for any component
Generate code examples and recipes for common UI patterns
Help you find the right component for your needs
Compare similar components to choose the best one
Understand component relationships and dependencies
Export documentation in markdown format
Quick Start
Prerequisites
Node.js 16+ and npm
Claude Desktop
A Stencil component library with generated docs.json
Installation
Clone or navigate to this repository:
cd stencil-library-mcpInstall dependencies:
npm installBuild the project:
npm run buildPlace your Stencil component docs in
component-docs/docs.json
Connecting to Claude Desktop
Open your Claude Desktop configuration file:
Mac:
~/Library/Application Support/Claude/claude_desktop_config.jsonWindows:
%AppData%\Claude\claude_desktop_config.json
Add the following configuration (update the path and name to match your component library):
{ "mcpServers": { "my-component-library": { "command": "node", "args": ["/absolute/path/to/stencil-library-mcp/build/index.js"] } } }š” Tip: The server name (the key under
mcpServers) is what Claude Desktop will display when asking to use tools. Choose a name that matches your component library. For example, if your library is called "Acme UI", you could use"acme-ui"as the key.Restart Claude Desktop
Look for the hammer icon in Claude Desktop, indicating that MCP tools are available
Testing Your Implementation
Try asking Claude these questions:
Basic Queries:
"What components does my component library have?"
"Show me details about [component-name]"
"Give me a recipe for a login form using my components"
"How do I use [property] on [component]?"
Discovery Queries:
"Search for components related to forms"
"Which components have a 'disabled' property?"
"What components emit a 'click' event?"
Analysis Queries:
"Compare [component-1] and [component-2]"
"What are the dependencies for [component-name]?"
"Show me all the common properties across the library"
"What events can components emit?"
Documentation Queries:
"Generate markdown documentation for [component-name]"
Project Structure
āāā src/
ā āāā index.ts # Main server entry point with all tools
āāā component-docs/
ā āāā docs.json # Your Stencil component documentation
ā āāā docs.d.ts # TypeScript definitions
āāā build/ # Compiled JavaScript files
āāā package.json
āāā tsconfig.jsonUpdating Component Documentation
When you update your Stencil components:
Regenerate your Stencil docs (usually part of your build process)
Copy the new
docs.jsontocomponent-docs/docs.jsonRebuild this MCP server:
npm run buildRestart Claude Desktop
Customizing for Your Design System
To adapt this template for your own design system:
Update server name in
src/index.ts:const server = new McpServer({ name: "your-design-system-name", // ... });Modify component formatting in
formatComponent()to match your needsEnhance code generation in
generateExampleUsage()to create better examplesAdd additional tools for specific design system needs (theme tokens, icons, etc.)
Update branding in console messages and documentation
Available Tools
Core Tools
list-components
Lists all available components in your design system with brief descriptions.
Parameters: None
Example: "What components are available in my library?"
get-component-details
Get detailed documentation for a specific component including:
All properties (with types and defaults)
Events
Slots
Usage documentation
Parameters:
tag(string): The component tag name (e.g., "my-button")
Example: "Show me details about my-button"
generate-component-recipe
Generate code examples and implementation suggestions based on what you want to build. Claude will analyze your available components and suggest how to combine them.
Parameters:
description(string): Description of what you want to build
Example: "Give me a recipe for a login form"
Discovery Tools
search-components
Search for components by keyword in their name, description, props, or events.
Parameters:
query(string): Search query (e.g., "button", "form", "input")
Example: "Search for all input-related components"
find-components-with-prop
Find all components that have a specific property.
Parameters:
propName(string): Property name to search for (e.g., "disabled", "value")
Example: "Which components have a 'disabled' property?"
find-components-with-event
Find all components that emit a specific event.
Parameters:
eventName(string): Event name to search for (e.g., "click", "change")
Example: "Which components emit a 'change' event?"
Analysis Tools
compare-components
Compare two components side-by-side to see their differences in props, events, and slots.
Parameters:
component1(string): First component tag namecomponent2(string): Second component tag name
Example: "Compare my-button and my-icon-button"
get-component-dependencies
Show dependencies (components this uses) and dependents (components that use this) for a component.
Parameters:
tag(string): Component tag name
Example: "What are the dependencies for my-card?"
get-all-props
List all unique property names across the entire component library, sorted by usage frequency.
Parameters: None
Example: "What are all the common properties across my components?"
get-all-events
List all unique event names across the entire component library, sorted by usage frequency.
Parameters: None
Example: "What are all the events my components can emit?"
Documentation Tools
generate-component-docs-markdown
Export component documentation as formatted markdown that you can copy to your documentation site.
Parameters:
tag(string): Component tag name
Example: "Generate markdown docs for my-button"
Troubleshooting
Common Issues
Claude can't find your server: Verify your configuration path in
claude_desktop_config.jsonand restart Claude Desktop"Failed to load component documentation": Ensure
component-docs/docs.jsonexists and is valid JSONServer not updating: Rebuild with
npm run buildand restart Claude DesktopCheck logs: Look at Claude Desktop logs at:
Mac:
~/Library/Logs/Claude/mcp*.logWindows:
%AppData%\Claude\logs\mcp*.log
License
MIT
Credits
This project is a fork of SterlingChin's MCP Weather Server. Special thanks to Sterling Chin for creating an excellent MCP server implementation that served as the foundation for this component library documentation server.
Contributing
Feel free to customize this for your own component library needs!
Built using the Model Context Protocol
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelogā¦
This server cannot be deployed
Maintenance
Related MCP Connectors
Access and maintain design system docs, tokens, components, skills, and contexts across any project.
Design system contracts, docs search, and usage validation for @digitaltableteur components.
Live React design-system APIs, patterns, and code validation so AI agents build real UI, not slop.
Your versioned prompt library: search, read, save and version prompts from Claude Code.
Related MCP Servers
- AlicenseBqualityDmaintenanceProvides AI assistants with tools to grade, generate, and validate UI components against the components.build specification. Supports searching documentation, checking compliance, and generating framework-agnostic accessible components.1124 npmApache 2.0
- AlicenseAqualityDmaintenanceProvides access to 600+ documentation libraries from DevDocs.io including Python, JavaScript, React, Django, and more. Enables searching, browsing, and retrieving documentation content directly through Claude Desktop.56MIT
- AlicenseAqualityDmaintenanceProvides AI coding agents with version-aware StencilJS API references, decorator signatures, lifecycle hooks, and best practices to help them write idiomatic Stencil code.4MIT
- AlicenseAqualityBmaintenanceProvides AI assistants with current Ionic Framework v9 and v8 documentation, including component API references, usage examples for Angular, React, Vue, and vanilla JavaScript, and Ionic blog posts. Enables searching docs, reading pages, listing components, retrieving usage examples, and listing blog posts.557 npm1MIT