Custom Lightning Type Creation with Lightning Types MCP Tool (Developer Preview)

The Lightning Types Model Context Protocol (MCP) tool in Salesforce DX MCP Server simplifies and accelerates the creation of LightningTypeBundle metadata. The MCP server uses large language models (LLMs) to analyze your request, generate the required LightningTypeBundle metadata files, and stage them in your local repository so you can use natural language prompts instead of manually creating the JSON files.

Access this tool through Agentforce Vibes in your integrated development environment (IDE). Salesforce DX MCP Server protects your data and credentials with multiple layers of security. See Salesforce DX MCP Server and Tools (Beta).

See Also

The Lightning Types MCP tool feature is available as a developer preview. Feature isn’t generally available unless or until Salesforce announces its general availability in documentation or in press releases or public statements. All commands, parameters, and other features are subject to change or deprecation at any time, with or without notice. Don’t implement functionality developed with these commands or tools.

To create custom Lightning types by using natural language, install and configure Salesforce DX MCP Server to use Lightning Types tool.

Before you use the Lightning Types MCP tool, review the Salesforce DX MCP server prerequisites and make sure that you have:

  • An org with custom Lightning types enabled
  • A project connected to a version control system
  • A Salesforce IDE, such as Agentforce Vibes IDE or Visual Studio Code (VS Code), that your Salesforce admin has accepted the Terms and Conditions for
  • A configured IDE project. To learn how, see Create Projects.
  • An IDE connected to the same Salesforce org where you enabled the feature. Connect and authenticate your IDE to this org.
  • A cloned project repository open in your IDE’s workspace
  • An MCP client, such as the Agentforce Vibes Extension. For setup instructions, see Set Up Agentforce Vibes Extension.

Salesforce DX MCP Server is preconfigured in the Agentforce Vibes Extension. Open your IDE and turn on Salesforce DX MCP Server in the Agentforce Vibes Extension. See Enable Salesforce DX MCP Server.

To enable the Lightning Types MCP tool, configure the Salesforce DX MCP Server arguments. In the args option, use the --tools flag and specify the tool name create_lightning_type. See Configure the Salesforce DX MCP Server for Your Environment (Beta).

You interact with the server by entering natural language prompts in Agentforce. Agentforce Vibes is available from the Activity Bar and includes a chat window where you enter prompts.

To use VS Code as the MCP client, see Quick Start Using the VS Code With Copilot MCP Client (Beta).

See Also

Use natural language prompts to create and configure custom Lightning type bundle files, including schema.json, editor.json, and renderer.json.

How It Works

The create_lightning_type tool generates the necessary LightningTypeBundle metadata files based on your prompts. This tool doesn’t create Lightning Web Components (LWC). You can build the LWC components by using the orchestrate_lwc_component_creation tool.

The tool first analyzes your prompt to generate the schema.json file with the specified properties. By default, the tool doesn’t create editor.json and renderer.json files. To generate the UI override files (editor.json or renderer.json), you must explicitly request them. You can include this request in your initial prompt or use a follow-up prompt. This step links your schema to a Lightning Web Component. The tool stages the new or modified files by using git add.

Sample Workflow: Object-Based Custom Lightning Type

This workflow shows how to create a custom Lightning type by specifying the properties directly in your prompt.

  1. Create the schema

    Prompt: “Create a custom Lightning type named LuxuryPropertyListing to showcase premium real estate properties. Include properties for address (text), price (number), and isAvailable (boolean).”

    Sample Response: “Success! The custom Lightning type LuxuryPropertyListing has been created in force-app/main/default/lightningTypes/LuxuryPropertyListing/schema.json. The file has been staged. Please review.”

  2. Create the LWC

    You can create the Lightning Web Component (LWC) manually or use a prompt to generate it with the orchestrate_lwc_component_creation tool.

    Prompt: “Create a modern, elegant LWC renderer named luxuryPropRenderer for this CLT.”

    The orchestrate_lwc_component_creation tool handles this prompt.

    Sample Response: “Success! The LWC luxuryPropRenderer has been created at force-app/main/default/lwc/luxuryPropRenderer/. You can now reference it as c/luxuryPropRenderer.”

  3. Link the LWC to the CLT Schema

    Prompt: “Create the renderer metadata for LuxuryPropertyListing. Link the LWC fields to the Schema fields.”

    Sample Response: “Success! The renderer.json file has been created for the LuxuryPropertyListing bundle and staged. It’s configured to use c/luxuryPropRenderer and maps its fields to the schema. Please review.”

Sample Workflow: Apex-Based Custom Lightning Type

This workflow shows how to create a custom Lightning type that references an existing Apex class.

  1. Create the schema

    Prompt: “Create a custom Lightning type that references an Apex class for flight booking. Apex Class: c__FlightAgent\$AvailableFlight.”

    Sample Response: “Success! The custom Lightning type FlightBooking has been created in force-app/main/default/lightningTypes/FlightBooking/schema.json. The file has been staged. Please review.”

  2. Create the LWC

    You can create the Lightning Web Component (LWC) manually or use a prompt to generate it with the orchestrate_lwc_component_creation tool.

    Prompt: “Create a modern, elegant LWC renderer named flightBookingRenderer for this CLT.”

    The orchestrate_lwc_component_creation tool handles this prompt.

    Sample Response: “Success! The LWC flightBookingRenderer has been created at force-app/main/default/lwc/flightBookingRenderer/. You can now reference it as c/flightBookingRenderer.”

  3. Link the LWC to the CLT Schema

    Prompt: “Create the renderer metadata for FlightBooking. Link the LWC fields to the Schema fields.”

    Sample Response: “Success! The renderer.json file has been created for the FlightBooking bundle and staged. It’s configured to use c/flightBookingRenderer and maps its fields to the schema. Please review.”

See Also

Find detailed descriptions and sample prompts for the tool.

ToolDescriptionSample Prompts
create_lightning_type(Developer Preview) Creates, enhances, and provides expert guidance and best practices for custom Lightning types. Generates and maintains LightningTypeBundle components, including schema.json, editor.json, renderer.json, and validation rules, for use across Salesforce applications.
  • “Create a custom Lightning type for a hotel booking system by using the MCP tool.”
  • “Create a custom Lightning type based on the Apex class com.example.model.HotelModel. Use the MCP tool.”
  • “I want to use the MCP tool to create a custom Lightning type to store user preferences.”

If Agentforce Vibes doesn’t automatically invoke the tool, add “using the MCP tool” to your prompt.