Use the LWC Guidelines MCP Tools (Beta)

The LWC guidelines MCP tools improve your code quality by evaluating your code based on LWC development guidelines or recommending best practices.

  • guide_lwc_accessibility - Provides accessibility guidelines and testing instructions for Lightning web components
  • guide_lwc_best_practices - Offers LWC development best practices and coding standards guidance
  • guide_lwc_development - Comprehensive LWC development workflow and implementation guidelines
  • guide_lwc_rtl_support - Right-to-Left (RTL) internationalization support and RTL development guidance
  • guide_lwc_slds2_uplift_linter_fixes - Analyzes LWC code along with the slds-linter output to fix issues using the SLDS 2 knowledge
  • guide_lwc_security - Analyzes components based on product security and Lightning Web Security Guidelines

MCP Tools for LWC Development is a pilot or beta service that is subject to the Beta Services Terms at Agreements - Salesforce.com or a written Unified Pilot Agreement if executed by Customer, and applicable terms in the Product Terms Directory. Use of this pilot or beta service is at the Customer's sole discretion.

The tools are invoked automatically based on your prompts. Here are some possible prompts that invoke the LWC guidelines MCP tools.

Ask about reviewing a component based on LWC accessibility guidelines.

  • Review this component for accessibility and list concrete fixes with code examples.
  • Provide a step-by-step plan to run a11y Jest tests for this component and interpret failures.
  • Generate an ARIA/keyboard checklist for this component and verify focus management.

Ask about reviewing a component based on LWC best practices.

  • Review this component for LWC best practices and suggest improvements.
  • Recommend patterns for state management and eventing for this component.
  • Identify anti-patterns in this code and propose compliant alternatives.

Ask about evaluating a component based on development workflow guidelines.

  • Outline the end-to-end workflow to build a list of case records with UI API, including error states.
  • Provide a development checklist for this component in these areas: data, events, a11y, tests, performance.
  • Compare when to use UI API vs Apex for a record update and recommend an approach.

Ask about evaluating a component based on RTL guidelines.

  • Assess this component for RTL readiness and list CSS logical property changes.
  • Provide RTL testing steps and visual checks for this component.
  • Convert these LTR styles to RTL-safe equivalents and explain choices: <paste CSS>

Ask about enhancing a component based on SLDS 2 guidelines and best practices.

  • Run SLDS 2 uplift linter on components under force-app/main/default/lwc. Group violations by rule and component and provide autofix suggestions. Include a brief rationale per rule and call out any rules requiring manual remediation.
  • Analyze this component for SLDS 2 issues. Generate a brief summary listing files changed, rules fixed, and remaining violations. Ensure no visual regressions by avoiding disruptive class removals without substitutions.
  • Identify deprecated classes and tokens for SLDS 2, and suggest compatible replacements. Map each finding to a linter rule. Output a table with columns: Rule, File Location, Problem, Recommended Fix. Provide a step-by-step fix order to minimize cascading changes.

Ask about product security and Lightning Web Security guidelines and best practices.

  • Analyze this component to flag XSS/DOM injection risks for lwc="manual" and innerHTML. Suggest fixes for this component.
  • Generate a secure LWC and Apex checklist for CRUD/FLS, WITH SHARING, SOQL injection prevention, input validation.
  • Audit the third‑party libraries under Lightning Web Security and CSP, and recommend safe integration patterns.

See Also