Content type management API
Preview feature
The Xperience by Kentico management API and MCP server are currently in preview mode. 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 (Create, Read, Update, Delete) of objects within the system. At this time, the API allows:
- Retrieval and management of content types and reusable field schemas
- Retrieval of information about UI form components and data types for fields
This enables automated content modeling workflows, accelerates migration scenarios, and simplifies integration with external systems that need to manage your project’s content model.
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:
- Install the Kentico.Xperience.ManagementApi NuGet package into your Xperience project.
- Kentico.Xperience.ManagementApi is currently a prerelease package.
- Adjust your application’s startup code in Program.cs:
- Call the
AddKenticoManagementApi()extension method on your application’s service collection.- Adds controllers used by the management API. Also registers and configures services for authentication, authorization, Swagger generation, and API versioning. If you already configure such services, place the AddKenticoManagementApi() call after your configuration. Most of the configuration is scoped only to the management API endpoints, but there are exceptions (see the method’s remarks in your IDE for details).
- In the method’s
ManagementApiOptionsparameter, set theSecretproperty 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.
- Add the following to the application’s middleware pipeline:
UseAuthentication()– adds authentication middleware. Must be called before UseKentico().UseKenticoManagementApi()– adds middleware required for the management API.UseAuthorization()– adds authorization middleware. Must be called after UseKentico().
- Call the
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();
// ...
// Adds authentication middleware
app.UseAuthentication();
if (builder.Environment.IsDevelopment())
{
// Adds middleware required for the management API
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 a supported version of Node.js 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:
- Use MCP servers in VS Code
- MCP guide for Cursor
- Use MCP servers in Visual Studio
- Connect to local MCP servers from Claude Desktop
For example, to get the MCP server running in VS Code:
Edit the
mcp.jsonfile of your workspace (located in the project’s .vscode folder).Add the following server configuration:
JSONmcp.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" } } } }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.
Run your Xperience application. See Set up local hosting for more information.
Start the MCP server in your IDE.
The server should now be running and your AI agent configuration should now show the MCP server and display the available tools.
Example prompts
Your AI agent will automatically use the MCP server’s tools when handling 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?”
- “Create a new content type named ‘Coffee cup’ with fields ‘Size’, ‘Color’ and with 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.