Skip to main content
Glama

@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: Context7 MCP

Tools

Tool

Purpose

detect_stencil_version

Resolves the version from node_modules/@stencil/core (authoritative) and the declared range in package.json.

get_decorator_reference

Signatures, idiomatic examples, and anti-patterns for @Component, @Prop, @State, @Watch, @Event, @Listen, @Method, @Element, @AttachInternals.

get_lifecycle_reference

The component lifecycle hooks and when each fires.

get_best_practices

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 build

Register 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 test

License

MIT

Available Tools

4 tools
detect_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.

ParametersJSON Schema
NameRequiredDescriptionDefault
projectRootNoAbsolute path to the project root. Defaults to the current working directory.

TDQS

A4.1/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description carries the transparency burden. It explicitly mentions reading 'node_modules/@stencil/core and package.json,' which discloses the data sources. However, it does not describe error handling or fallback behavior if the version cannot be determined.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single concise sentence that front-loads the primary purpose, then adds context and method. No wasted words.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness3/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple with one optional parameter and no output schema. The description explains the purpose and data sources but does not specify the exact return format or precedence between the two sources. It is adequate but leaves some ambiguity.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage for the single parameter, including its default behavior. The description adds no extra parameter detail, but the schema already provides sufficient semantics, so a baseline score of 3 is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool's function with a specific verb and resource: 'Detect the StencilJS version a project is actually using.' It also distinguishes itself from sibling tools which focus on references and best practices, not version detection.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description implies when to use the tool: 'so suggestions match the installed framework.' It provides clear context for its usage, though it does not explicitly mention alternatives or exclusion criteria, which is acceptable given the distinct purpose.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
idNoOptional best-practice id to fetch a single rule. Omit to get all.

TDQS

A4/5.0
Behavior3/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description must carry the burden of behavioral disclosure. The verb 'Get' implies a read-only operation, and the description explains the return format ('wrong vs right' rules). However, it does not explicitly state side effects, permission needs, or what happens when id is omitted (though the schema covers that). This is adequate but not deeply transparent.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, well-front-loaded sentence that conveys the purpose, the output format, and the intended benefit without any fluff. Every word earns its place.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

The tool is simple (one optional param, no output schema), and the description provides sufficient context for what the tool does and how the output is shaped. It does not explain the structure of each rule, but for this low complexity, the description is mostly complete. Slight gap: no mention of return types beyond 'rules'.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The input schema has 100% coverage for the single optional 'id' parameter, describing it as 'Optional best-practice id to fetch a single rule. Omit to get all.' The description adds no additional parameter-level meaning, so the baseline score of 3 applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool retrieves idiomatic StencilJS best practices formatted as concrete 'wrong vs right' rules. It distinguishes itself from sibling tools that detect versions or fetch decorator/lifecycle references by focusing on idiomatic guidance.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The phrase 'so AI suggestions use built-in Stencil features instead of manual workarounds' implies when to use this tool: when generating or validating suggestions for idiomatic Stencil code. It gives context but does not explicitly name alternatives or when not to use it, though sibling names make the distinction clear.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

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.

ParametersJSON Schema
NameRequiredDescriptionDefault
nameNoOptional decorator name (without @) to look up. Omit to list all decorators.

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations provided, the description carries the transparency burden. It discloses what the reference includes (signatures, idiomatic examples, anti-patterns), which is useful. However, it doesn't specify the return format or behavior when the optional parameter is omitted; these details are left to the schema, which is acceptable for a simple read-only reference tool.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is one sentence, front-loaded with the main action, and every element contributes (scope, content, anti-patterns). No redundant or filler wording.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

This is a low-complexity reference tool with one optional parameter and no output schema. The description explains what information will be provided, and the schema covers parameter behavior. The only minor gap is the unspecified return structure, but that does not impede correct invocation.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% for the single optional parameter, providing clear semantics. The description adds value by enumerating valid decorator names (e.g., @Component, @Prop), reinforcing the expected input values beyond the schema's generic 'decorator name' phrasing.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses a specific verb ('Get accurate reference') and clearly identifies the resource (StencilJS decorators), explicitly listing the decorator names covered. This distinguishes it from sibling tools like get_lifecycle_reference and get_best_practices, which target different StencilJS aspects.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly implies when to use this tool (when you need decorator references) but does not explicitly mention alternatives or exclusions. The domain is unambiguous enough that an agent would correctly select this over lifecycle or best-practices tools, but explicit contrast would strengthen the guidance.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

get_lifecycle_referenceA

Get the StencilJS component lifecycle methods (componentWillLoad, componentDidLoad, render, etc.) with when each fires.

ParametersJSON Schema
NameRequiredDescriptionDefault

No parameters

TDQS

A4.4/5.0
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

No annotations are present, so the description carries the full burden of behavioral disclosure. It explicitly states the output (lifecycle methods and when each fires) and the 'Get' verb implies a read-only, non-destructive operation. It lacks explicit statements about return format or side effects, but for a pure reference tool, the disclosure is adequate.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

The description is a single, dense sentence that front-loads the action ('Get') and includes the key resource and specificity. Every word earns its place, with no redundant or filler content.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Given the tool's simplicity (no parameters, no output schema), the description is sufficiently complete for an agent to understand what will be returned: lifecycle methods and their firing times. It could explicitly state the return format (e.g., 'returns a list'), but that is not essential for a reference lookup.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters4/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

The tool has zero parameters, and the schema confirms this with an empty properties object. The description correctly adds no parameter semantics since none exist, and the baseline of 4 for zero-parameter tools applies.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description uses the specific verb 'Get' and clearly identifies the resource (StencilJS component lifecycle methods) and the informational detail ('with when each fires'), making the tool's purpose unambiguous. It also distinguishes itself from sibling tools (detect_stencil_version, get_decorator_reference, get_best_practices) by targeting a distinct aspect of StencilJS.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines4/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

The description clearly implies the tool is used to retrieve lifecycle method timing for StencilJS components. It does not explicitly name alternatives or exclusion criteria, but the purpose is contextually clear and self-contained, which is sufficient for a simple reference lookup tool.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections. Dates show when Glama detected each change.

  1. 4 tool updatesv0.1.0
    • First observeddetect_stencil_version
    • First observedget_best_practices
    • First observedget_decorator_reference
    • First observedget_lifecycle_reference

TDQS

A4.3/5.0
Disambiguation5/5

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.

Naming Consistency5/5

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.

Tool Count5/5

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.

Completeness4/5

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

ActivityMaintained
ResponsivenessSyncing

Resources

Unclaimed servers have limited discoverability.

Looking for Admin?

If you are the server author, to access and configure the admin panel.

Related MCP Connectors

Related MCP Servers

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Arul1998/stencil-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server