stencil-mcp
Provides tools for interacting with StencilJS projects, including detecting the Stencil version, retrieving decorator and lifecycle references, and enforcing best practices for Stencil component development.
Click on "Deploy Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@stencil-mcp How should I use @Listen to avoid manual event listeners?"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
@stencil/mcp
A Model Context Protocol server that gives AI coding agents accurate, version-aware knowledge of a StencilJS project.
Proof-of-concept for stenciljs/core#6518.
Why
AI agents frequently suggest non-idiomatic Stencil code — e.g. manually adding a
window.addEventListener in componentWillLoad instead of using the built-in
@Listen() decorator, or mutating a @Prop. This server exposes Stencil's real
API surface and best practices to the agent so it can self-correct, and tells it
which Stencil version the project is actually running.
Related MCP server: Components Build MCP
Tools
Tool | Purpose |
| Resolves the version from |
| Signatures, idiomatic examples, and anti-patterns for |
| The component lifecycle hooks and when each fires. |
| Concrete "wrong vs right" rules so agents use built-in Stencil features. |
All reference content is sourced from Stencil's own public runtime type declarations, so it matches the framework rather than guessing.
Usage
npm install && npm run buildRegister with an MCP-capable client (Claude Desktop, Cursor, VS Code, etc.):
{
"mcpServers": {
"stencil": {
"command": "npx",
"args": ["-y", "@stencil/mcp"]
}
}
}Develop
npm run build # compile TypeScript
npm test # unit tests (node:test)
node test/smoke.mjs # end-to-end MCP stdio testLicense
MIT
Available Tools
4 toolsdetect_stencil_versionA
Detect the StencilJS version a project is actually using so suggestions match the installed framework. Reads node_modules/@stencil/core and package.json.
Inputs: projectRoot.
get_best_practicesA
Get idiomatic StencilJS best practices as concrete "wrong vs right" rules, so AI suggestions use built-in Stencil features instead of manual workarounds.
Inputs: id.
get_decorator_referenceA
Get accurate reference for StencilJS decorators (@Component, @Prop, @State, @Watch, @Event, @Listen, @Method, @Element, @AttachInternals), including signatures, idiomatic examples, and anti-patterns to avoid.
Inputs: name.
get_lifecycle_referenceA
Get the StencilJS component lifecycle methods (componentWillLoad, componentDidLoad, render, etc.) with when each fires.
Inputs: no named parameters.
Tool Schema Changelog
Recent tool additions, removals, and schema changes observed during successful MCP inspections.
Loading tool schema changelog…
TDQS
Scored across 4 tools
Each tool has a clearly distinct purpose: version detection, decorator reference, lifecycle reference, and best practices. There is no overlap or ambiguity among the four tools.
All tools follow a consistent verb_noun pattern using snake_case: detect_stencil_version, get_decorator_reference, get_lifecycle_reference, get_best_practices. Naming is predictable and uniform.
With only 4 tools, the server is well-scoped for a focused reference utility. Each tool earns its place, and the count is neither too sparse nor overwhelming.
The server covers the core StencilJS reference needs: version, decorators, lifecycle, and best practices. Minor gaps exist like Stencil config or testing references, but the essential surface is well covered.
Maintenance
Related MCP Connectors
Live React design-system APIs, patterns, and code validation so AI agents build real UI, not slop.
Versioned documentation registry and semantic search for AI tools and coding assistants.
Serves your design system and coding standards to coding agents, so they stop guessing.
Provide your AI coding tools with token-efficient access to up-to-date technical documentation for…
Related MCP Servers
- AlicenseAqualityDmaintenanceProvides up-to-date, version-specific documentation and code examples for libraries and frameworks directly into AI prompts, eliminating outdated code generation and hallucinated APIs.2MIT
- 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 AI coding assistants with on-demand access to component specs, test scenarios, accessibility requirements, and build guides from the Web UI Component Specification.10MIT
- AlicenseAqualityDmaintenanceExposes Radix Primitives' parts, props, and accessibility contracts to AI coding agents, ensuring correct and accessible component usage.34 npmMIT