Develop widgets with Sitefinity MCP Server 

Overview

Using the Sitefinity MCP (Model Context Protocol) server for generating ASP.NET Core and Next.js widgets, you utilize the power of Large Language Models (LLM) to quickly and easily generate new widgets for your decoupled renderer project.

This way, you can start enriching your project based on decoupled renderer architecture with new widgets immediately.

First, you describe to an LLM your business needs. For example – create a carousel widget with image, title, and two buttons. Then, using the MCP protocol, the Sitefinity MCP server generates all the required code and configurations in your editor.

This feature enables faster testing and iteration, faster team scaling, and enables new developers to contribute from day one.

Sitefinity MCP server enriches the IDEs you are using with specific knowledge about Sitefinity CMS, thus, the code and configuration it creates align with Sitefinity’s widget structure, naming conventions, and rendering logic. It follows the best practices and feels natural to the underlying platform.

In this sample, you learn how to configure Sitefinity MCP Server in your editor of choice and create a Next.js widget using prompting.

PREREQUISITES: To use this sample, you must comply with the following:
  • To develop Next.js widgets, you must have installed Sitefinity CMS 15.2 or later
  • To develop ASP.NET Core widgets, you must have installed Sitefinity CMS 14.4 or later
  • You must have an existing project using either Sitefinity Next.js or ASP.NET Core renderer.
    For more information, see Develop with Next.js and Develop with ASP.NET Core.
  • The sample assumes you are using Visual Studio Code (VS Code).
    You can use any MCP-enabled development environment, such as Cursor or Windsurf, but you have to adjust the procedure accordingly.

Procedure

This sample guides you to configure your development environment using VS Code to start building Sitefinity widgets with the hosted MCP server.
Perform the following:

  1. Open your decoupled renderer project in VS Code. Both ASP.NET Core and Next.js are supported.
  2. Add the Sitefinity MCP Server:
    1. Open the Command Palette by pressing Ctrl+Shift+P.
    2. In the Command palette, enter MCP:Add Server…
    3. Select HTTP (HTTP or Server-Sent Events)
    4. In MCP Server URL, enter the URL of the corresponding Sitefinity MCP Server.
      For developing with Next.js, enter https://mcp.sitefinity.cloud/nextjs-widgets.
      For developing with ASP.NET Core, enter https://mcp.sitefinity.cloud/nextcore-widgets.
    5. Set a name of your choice.
      For example, mcp-widgets.
    6. Select Workspace Settings.
      The mcp.json file opens in a new tab. It contains the MCP URL you have set in Step 2d.
    7. In the mcp-widgets object, add the headers object, containing the x-sitefinity-url property. You set the value of this property to the URL of the API endpoint exposed by your Sitefinity CMS instance.
      For example, if your Sitefinity is hosted on www.example.com, the JSON should look like the following.
      For Next.js:
      For ASP.NET Core:
  3. Start the MCP server connection.
    Perform the following:
    1. Open the Command Palette by pressing Ctrl+Shift+P.
    2. Select the MCP server that you configured in Step 2.
    3. Click Start Server.
      NOTE: If the server has already been started, the Start Server option is unavailable.
    4. To open Copilot Chat, click View » Chat.
    5. To select Agent mode, in the lower-left corner of the chat bubble, open the Select mode dropdown box and select Agent.
    6. Optionally, configure the used LLM, using the middle dropdown box with the name of the currently selected LLM in the chat bubble.
      RECOMMENDATION: For the best results, we recommend using Anthropic Sonnet 3.7 or 4, or Google Gemini 2.5 Pro.

RESULT: Your Sitefinity MCP Server is ready. You can start prompting it and create widgets.

Example

To build a carousel widget, perform the following:

  1. In the Chat bubble, enter Create a carousel widget with an image, title, and two buttons.
  2. When Copilot asks you for confirmation, use the dropdown box to select one of the Allow options, then click Continue.
    If you intend to use the Sitefinity MCP Server multiple times in your project, we recommend using the Allow in this workspace option.
  3. In the Chat bubble, click Keep.
  4. Review the generated code.
    IMPORTANT: Sitefinity MCP Server relies on an LLM to generate code. Because LLMs can generate unreliable code, you should always check their output before using it in a production project.
  5. Navigate to your Sitefinity CMS backend using your decoupled renderer as a proxy.
  6. Open or create a new page, based on a renderer template that uses the same technology as the one you used to create the widget.
    For example, if you used Sitefinity MCP Server to create a widget based on ASP.NET Core, you must use an ASP.NET Core-based renderer and edit ASP.NET Core pages to place the newly generated widget.
  7. Place the newly generated widget.
NEW TO SITEFINITY?

Want to learn more?

Increase your Sitefinity skills by signing up for our free trainings. Get Sitefinity-certified at Progress Education Community to boost your credentials.

Get started with Integration Hub | Sitefinity Cloud | Sitefinity SaaS

This free lesson teaches administrators, marketers, and other business professionals how to use the Integration hub service to create automated workflows between Sitefinity and other business systems.

Web Security for Sitefinity Administrators

This free lesson teaches administrators the basics about protecting yor Sitefinity instance and its sites from external threats. Configure HTTPS, SSL, allow lists for trusted sites, and cookie security, among others.

Foundations of Sitefinity ASP.NET Core Development

The free on-demand video course teaches developers how to use Sitefinity .NET Core and leverage its decoupled architecture and new way of coding against the platform.

Was this article helpful?