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. Adjust your application’s startup code in Program.cs:
    1. Call the AddKenticoManagementApi() extension method on your application’s service collection.
    2. 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.
    3. Add the following to the application’s middleware pipeline:
      • UseKenticoManagementApi() – adds all middleware required for the management API. Must be called before UseKentico(). This automatically adds authentication middleware. so you can remove any existing UseAuthentication() calls to avoid duplication.
      • UseAuthorization() – adds authorization middleware. Must be called after UseKentico().
C#
Program.cs

using Microsoft.AspNetCore.Builder;

using Kentico.Xperience.ManagementApi;
using Kentico.Web.Mvc;

// ...

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";
    });
}

// ...

var app = builder.Build();

app.InitKentico();

// ...

if (builder.Environment.IsDevelopment())
{
    // Adds middleware required for the management API
    // This includes authentication middleware - 'UseAuthentication()'
    app.UseKenticoManagementApi();
}

app.UseKentico();

// Adds authorization middleware
app.UseAuthorization();

// Maps routes used by Xperience by Kentico feature
app.Kentico().MapRoutes();

Management API 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 available management API endpoints.

Node.js requirement

To use the management API MCP server, you must have Node.js 22.0.0 or newer installed on your development machine.

To add the MCP server:

  • Use the @kentico/management-api-mcp npm package.
  • Set the following environment variables in the server’s configuration:
    • 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 get the MCP server running in VS Code:

  1. Edit the mcp.json file of your workspace (located in the project’s .vscode folder).

  2. Add the following server configuration:

    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"
           }
         }
       }
     }
     
  3. Adjust the environment variables for your project:

    • MANAGEMENT_API_URL – change the port number to match the URL where your Xperience application is running.
    • MANAGEMENT_API_SECRET – set the value to the secret configured when enabling the management API.
  4. Run your Xperience application. See Set up local hosting for more information.

  5. Restart the MCP server in your IDE.

The server should start running and your AI agent configuration should now list the MCP server and its available tools.

Example prompts

Your AI agent will automatically use the MCP server for prompts related to content types and reusable field schemas. For example:

  • “List all content types containing a field with the ‘Content item asset’ data type.”
  • “Which content types use the ‘Product SKU’ reusable field schema?”

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.