Content type management API

Preview feature

The Xperience by Kentico management API and MCP server is currently in preview mode. The current scope of the features is limited and will be expanded in the future. Expect changes in the functionality, potentially including breaking changes.

Feel free to try out the features, for example using the sample Dancing Goat project template. You can share your feedback directly with the Kentico Product team.

The Xperience by Kentico management API provides endpoints that allow retrieval and management of objects within the system. At this time, the functionality is limited and the API only allows retrieval of information about:

Support for create, update and delete operations will be introduced in the future.

The management API is designed to be used via AI tools. Kentico provides a Model Context Protocol (MCP) server that allows AI clients to easily discover and use the tools provided by the API.

Enable the management API

Only for local development purposes

The management API is only intended for use on local development instances. It currently only provides basic authentication and no authorization options for various types of operations.

Do not enable the management API for production deployments or other publicly available instances.

To enable the content management API for a development project:

  1. Install the Kentico.Xperience.ManagementApi NuGet package into your Xperience project.
    • Kentico.Xperience.ManagementApi is currently a prerelease package.
  2. Call the AddKenticoManagementApi extension method on your application’s service collection (Program.cs).
  3. In the method’s ManagementApiOptions parameter, set the Secret property to a string with at least 32 characters.
    • The secret is required to authenticate all requests to the management API endpoints, and will be used in the configuration of your management API MCP server.
C#
Program.cs

using Kentico.Xperience.ManagementApi;

// ...

var builder = WebApplication.CreateBuilder(args);

// ...

// Only enables the management API in the local development environment
if (builder.Environment.IsDevelopment())
{
    builder.Services.AddKenticoManagementApi(options => 
    {
       // Sets the secret required to authenticate all requests to the management API endpoints
       // Must be at least 32 characters
       options.Secret = "rrvpzpu18m5385tfw1h9j5luxton5vyv";
    });
}

Install the MCP server

Kentico provides an MCP server that allows AI clients to easily discover and work with the management API. The MCP server is accessible to any IDE, agent, or tool that supports MCP.

The server runs locally on your development machine, and automatically generates tools for using the management API endpoints.

To install the MCP server:

  • Use the @kentico/management-api-mcp npm package.
  • Set the transport method to stdio in the server’s configuration.
  • Set the following environment variables for the server:
    • MANAGEMENT_API_URL – the URL of your locally running Xperience application, followed by the kentico-api/management path.
    • MANAGEMENT_API_SECRET – the secret configured when enabling the management API for your application.

See the documentation of your IDE for detailed information:

For example, to install the server in VS Code, you can add the server configuration in your workspace mcp.json file:

JSON
mcp.json

{
  "servers": {
    "xperience-management-api": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@kentico/management-api-mcp@latest"
      ],
      "env": {
        "MANAGEMENT_API_URL": "http://localhost:5001/kentico-api/management",
        "MANAGEMENT_API_SECRET": "rrvpzpu18m5385tfw1h9j5luxton5vyv"
      }
    }
  }
}

MCP server restart required

Before using the MCP server, you need to locally run your Xperience application. See Set up local hosting for more information.

After you run the application, you may need to restart the MCP server in your IDE.

Troubleshooting

Certificate issues

In certain cases, you may encounter certificate related errors when using the MCP server with an application running under HTTPS (i.e., you have an HTTPS URL in the server’s MANAGEMENT_API_URL environment variable).

To resolve the issue, try setting the NODE_OPTIONS environment variable to --use-system-ca.