sitecore-personalize-mcp
Provides tools for interacting with Sitecore Personalize/CDP, enabling management of decisioning flows, experiences, audiences, guest profiles, behavioral events, and datasets.
Click on "Install Server".
Wait a few minutes for the server to deploy. Once ready, it will show a "Started" state.
In the chat, type
@followed by the MCP server name and your instructions, e.g., "@sitecore-personalize-mcplist all decisioning flows"
That's it! The server will respond to your query, and you can continue using it as needed.
Here is a step-by-step guide with screenshots.
Sitecore Personalize MCP Server
A production-ready Model Context Protocol server for Sitecore
Personalize / CDP, built with the official @modelcontextprotocol/sdk, TypeScript, Zod, and Axios.
Every Sitecore Personalize API operation is exposed as its own MCP tool, so an MCP client (Claude
Desktop, Claude Code, or any other MCP host) can list/manage decisioning flows and experiences, read
and update CDP guest profiles, send behavioral events, and work with audiences and datasets.
Architecture
src/
index.ts Process entry point: stdio transport wiring, signal handling
server.ts McpServer construction + tool registration
config/
env.ts Zod-validated environment configuration (fails fast at startup)
constants.ts API route table, server metadata, retry-status set
auth/
tokenManager.ts OAuth2 client_credentials flow, in-memory cache, refresh locking
services/
httpClient.ts Shared axios factory: auth injection, retry/backoff, error normalization
flowService.ts Flow list/get/publish/execute
experienceService.ts Experience list/get/publish
audienceService.ts Audience (segment) list/get/create
guestService.ts CDP guest get/upsert/delete/search
eventService.ts CDP event ingestion
datasetService.ts Dataset list/get
schemas/ One Zod schema module per domain (shared between tool input
validation and typed service calls)
tools/ One MCP tool per API operation, grouped by domain, registered
from tools/index.ts
utils/
logger.ts pino structured logger (stderr only — stdout is reserved for
MCP protocol frames)
errors.ts Typed error hierarchy (ValidationError, AuthenticationError,
SitecoreApiError, RetryExhaustedError, ConfigurationError)
retry.ts Exponential backoff w/ full jitter, used by httpClient
responseFormatter.ts Wraps service results into MCP CallToolResult (success/isError)Design principles:
Clean separation of concerns. Tools only translate MCP calls into service calls and format results — they contain no HTTP or business logic. Services own API contracts.
httpClientowns cross-cutting HTTP concerns (auth, retry, logging, error shape) so every service gets them for free.Every operation is its own tool. No multiplexed "do anything" tool — each is independently discoverable, documented, and schema-validated, which is what lets an MCP client (or the model driving it) reason about what's safe to call.
Fail fast, fail loud. Environment variables are validated once at startup with Zod; a misconfigured deployment never gets as far as accepting a tool call.
stdout is sacred. All logging goes to stderr via pino. Never
console.login this codebase — it will corrupt the JSON-RPC stream on the stdio transport.
Related MCP server: SitecoreMCP
Setup
npm install
cp .env.example .env
# edit .env with your tenant's client ID/secret and API URLs
npm run build
npm startFor local iteration with auto-reload: npm run dev (uses tsx watch).
Required environment variables
Variable | Description |
| OAuth2 client ID from Sitecore Cloud Portal |
| OAuth2 client secret |
| Identity token endpoint |
| Personalize/CDP admin API base URL for your tenant/region |
| (optional) Interactive decisioning/edge API base, if it differs from the admin API |
See .env.example for the full list, including HTTP timeout/retry tuning and log level.
Verify API routes before production use. Sitecore Personalize's REST surface is versioned and tenant/region-hosted. The route table in
src/config/constants.tsreflects the commonly documented v2/v3 shapes, but you should confirm exact paths against your tenant's current API reference before relying on this in production, and adjust that one file if anything differs.
Connecting to Claude Desktop / Claude Code
Add to your MCP client config (e.g. claude_desktop_config.json):
{
"mcpServers": {
"sitecore-personalize": {
"command": "node",
"args": ["/absolute/path/to/sitecore-personalize-mcp/dist/index.js"],
"env": {
"SITECORE_PERSONALIZE_CLIENT_ID": "...",
"SITECORE_PERSONALIZE_CLIENT_SECRET": "...",
"SITECORE_PERSONALIZE_AUTH_URL": "...",
"SITECORE_PERSONALIZE_API_URL": "..."
}
}
}
}Tools
All tool names are prefixed sitecore_personalize_.
Tool | Type | Description |
| read | List decisioning flows, filterable by status |
| read | Get a single flow's definition |
| write | Publish a draft flow |
| write | Trigger real-time flow decisioning for a guest ( |
| read | List experiences, filterable by type/status |
| read | Get a single experience's definition |
| write | Publish a draft experience |
| read | List audiences/segments |
| read | Get a single audience's rules |
| write | Create a new rule-based audience |
| read | Get a CDP guest profile by reference |
| write | Create or update a guest profile |
| write (destructive) | Permanently delete a guest profile |
| read | Search guests by email or attribute |
| write | Ingest a behavioral event for a guest |
| read | List datasets |
| read | Get a single dataset's metadata |
Every write tool carries MCP annotations (readOnlyHint, destructiveHint, idempotentHint) so
clients can apply appropriate confirmation UX — guest_delete in particular is flagged destructive
and irreversible.
Error handling & resilience
Validation happens at the MCP layer via each tool's Zod
inputSchemabefore any service code runs.Auth failures raise
AuthenticationError; a401from the API triggers one transparent token refresh + retry before failing.Transient failures (
429,5xx, network errors) are retried with exponential backoff + full jitter, up toMAX_RETRIES(default 3).All failures are normalized into typed errors and returned to the MCP client as
{ isError: true, content: [...] }— never as an uncaught exception that would kill the process or return an opaque transport error.
Extending
To add a new API operation:
Add its request/response shape to the relevant
src/schemas/*.schema.ts(or a new file for a new domain).Add the route to
src/config/constants.tsand the call to the matchingsrc/services/*.ts.Register a tool for it in
src/tools/*.tools.ts, following the existing pattern (registerTool→ service call →toolSuccess/toolError).If it's a new domain, wire its
registerXTools(server)intosrc/tools/index.ts.
Scripts
Command | Purpose |
| Type-check and compile to |
| Run the compiled server |
| Run with |
| Type-check without emitting |
| Remove |
This server cannot be installed
Maintenance
Resources
Unclaimed servers have limited discoverability.
Looking for Admin?
If you are the server author, to access and configure the admin panel.
Related MCP Servers
- Flicense-qualityDmaintenanceAn MCP Server that enables natural language interaction with the Open Policy Agent REST API, allowing users to manage policies, decisions, and data through conversational interfaces.1
- AlicenseCqualityDmaintenanceA SitecoreMCP version that can be used in enterprises100326Apache 2.0
- Alicense-qualityAmaintenanceMCP server for Sitecore that provides tools to interact with Sitecore via GraphQL, Item Service API, and Sitecore PowerShell Extensions, enabling content and security management.32648Apache 2.0
- Alicense-qualityDmaintenanceMCP Server for interacting with the Langflow API via a natural language interface. It exposes Langflow functionalities as tools for LLMs.MIT
Related MCP Connectors
Personal assistant MCP server with search, execute, packages, jobs, secrets, and integrations.
GibsonAI MCP server: manage your databases with natural language
MCP server providing access to the Scorecard API to evaluate and optimize LLM systems.
Latest Blog Posts
- Who's Calling? MCP Hosts Are an Identity Blind Spot (And the Spec Knows It)By Om-Shree-0709 on .mcpAgent IdentityOAuth 2.1
- Your AI Chatbot Just Exposed Your CEO's Salary to an InternBy Om-Shree-0709 on .Agent IdentityMCP SecurityOAuth Delegation
- Why MCP Servers Need Execution Sandboxing (And Why Your Current Stack Isn't Enough)By Om-Shree-0709 on .Agentic AiPrompt InjectionWebAssembly
MCP directory API
We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/keerthika-srinivasan/sitecore-personalize-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server