Configure the Management MCP

Preview feature

The Xperience by Kentico management API and Management 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.

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.
    • The version names of this package contain the -preview suffix after the corresponding Xperience by Kentico version number, for example:
      CMD
      Install a specific version of the package
      
      dotnet add package Kentico.Xperience.ManagementApi --version 31.4.3-preview
      
  2. Adjust your application’s startup code in Program.cs:
    1. 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).
    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:
      • 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().
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 = "<YourSecretValue>";

       // Optionally set the directory from which asset upload files are read
       // Default: ~/assets/managementapiuploads (resolved relative to the application root)
       // An absolute path (e.g., "C:\\temp") is used as-is
       // options.AssetUploadDirectoryPath = "~/my/custom/upload-path";
    });
}

// ...

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();

Add the MCP server

  • Use the @kentico/management-api-mcp npm package.
    • We recommend using the latest version of the npm package. You do not need to match the version to your project’s Xperience by Kentico NuGet packages – the MCP server dynamically reads the management API schema from your local project and adapts to the version.
  • 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 or AI client for details on adding MCP servers. The following are guides for popular tools:

For example, to get the MCP server running in VS Code (the same configuration also works in Claude Code and Cursor):

  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-mcp": {
           "type": "stdio",
           "command": "npx",
           "args": [
             "@kentico/management-api-mcp@latest"
           ],
           "env": {
             "MANAGEMENT_API_URL": "http://localhost:5001/kentico-api/management",
             "MANAGEMENT_API_SECRET": "<YourSecretValue>"
           }
         }
       }
     }
     
  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. Start the MCP server in your IDE.

The server should now be running and your IDE should now show the MCP server and display the available tools.

Tools provided by the MCP server

Limit the available tools

For the best results from AI agents, consider limiting the enabled tools of the MCP server to only those required for your current scenario. Disabling unrelated tools reduces noise, lowers token usage, and helps the AI agent focus on the task at hand.

You can limit tools from your IDE’s UI (see your IDE’s documentation), or use the MCP server’s built-in command-line options:

Option

Description

--enabled-tools <names> (-e)

Expose only the listed tools. The option can be repeated multiple times, or <names> can be a comma-separated list.

--disabled-tools <names> (-x)

Hide the listed tools. The option can be repeated multiple times, or <names> can be a comma-separated list.

--dynamic-tools (-d)

Expose only three dynamic meta-tools (list_available_tools, get_tool_schema, call_tool) instead of registering every tool individually. This significantly reduces the initial token footprint.

For example, to only expose content type-related tools in VS Code:

JSON
mcp.json – limiting tools via CLI options

{
  "servers": {
    "xperience-management-mcp": {
      "type": "stdio",
      "command": "npx",
      "args": [
        "@kentico/management-api-mcp@latest",
        "--enabled-tools",
        "list_content_types,get_content_type,create_content_type,update_content_type,delete_content_type"
      ],
      "env": {
        "MANAGEMENT_API_URL": "http://localhost:5001/kentico-api/management",
        "MANAGEMENT_API_SECRET": "<YourSecretValue>"
      }
    }
  }
}

Configure asset uploads

The Management MCP server can upload files to Content item asset fields. By default, the server reads files from the ~/assets/managementapiuploads directory relative to the application root.

The upload directory path can be customized via the AssetUploadDirectoryPath property of ManagementApiOptions (see Enable the management API). The property accepts two formats:

  • Application-relative paths (starting with ~/ or ~\) – resolved against the application root (e.g., ~/my/upload-folder).
  • Absolute paths – used as-is and can point to any location on the file system (e.g., C:\temp).

Subfolders within the upload directory are supported.