Amazon Personalize · 2026-11-16 · Personalize arc

Amazon Personalize for MCP Server Teams: Three SDKs, Six Gotchas, and the Full Recommendation Pipeline

MCP servers are tool routers. At small scale, the tool list is short enough that static ordering suffices. At production scale — hundreds of tools, thousands of users, multi-turn agent sessions that evolve over time — static ordering becomes the wrong default. Amazon Personalize is a fully managed ML service that delivers personalized rankings without requiring any ML expertise. For MCP server teams, it enables tools that surface relevant tools, documents, workflow steps, or API endpoints ranked by each user's interaction history. But Personalize has a larger SDK surface than most AWS services: three separate npm packages, Avro schemas with non-obvious gotchas, a six-stage provisioning pipeline before you get your first recommendation, and event tracking behaviors that silently fail in ways that are hard to diagnose. This guide synthesizes the full Personalize SDK into an end-to-end playbook: three-SDK architecture, Avro schema pitfalls, the management-plane pipeline, runtime inference with filtering, real-time event tracking with impression data and feedback loops, coldstart session handling, and when to choose domain recommenders over custom campaigns — with six production gotchas that cause silent failures on first deployment.

TL;DR — three SDKs, six gotchas

SDK npm package What it does
Management @aws-sdk/client-personalize Create dataset groups, schemas, datasets, solutions, campaigns, filters, event trackers, batch jobs
Runtime @aws-sdk/client-personalize-runtime Get recommendations, get personalized rankings at inference time
Events @aws-sdk/client-personalize-events Send real-time interactions (PutEvents), update user and item metadata (PutUsers, PutItems)
# Gotcha Symptom
1 TIMESTAMP must be Unix seconds, not milliseconds All events appear to be from the year 33000+; temporal signal corrupted; model ignores recency
2 Nullable Avro fields require ["null","float"] union syntax Import job fails with schema mismatch on any row missing that field
3 properties in PutEventsCommand must be JSON.stringify() HTTP 200 returned but itemId not extracted; interaction recorded with no item association
4 filterValues must be JSON-encoded string arrays Filter silently returns fewer results than expected or throws ResourceNotFoundException
5 Coldstart session linking requires the same sessionId across auth boundary Anonymous pre-auth interactions never linked to user; cold-start persists longer than necessary
6 Domain group domain cannot be changed after creation Wrong domain chosen during setup requires creating a new dataset group and re-uploading all data

Why MCP servers need personalization

An MCP server with ten tools doesn't need personalization — the user can see all options. An MCP server with 150 tools, integrated into an agentic workflow where the LLM must pick the best tool for the next step, has a real ranking problem. Static ordering (alphabetical, by recency, by global popularity) produces the same list for every user regardless of their history. That's the wrong starting point for an agentic system where user intent is the most valuable signal available.

Concrete use cases where Personalize changes the quality of MCP tool responses:

Personalize runs entirely within your AWS account — no data leaves to external ML platforms, all interaction history stays in your Personalize datasets in your region, and VPC endpoints eliminate public internet exposure for the most sensitive use cases.

The three-SDK architecture

Unlike most AWS services that ship a single SDK client, Personalize requires three separate npm packages that target three different API endpoints:

npm install \
  @aws-sdk/client-personalize \
  @aws-sdk/client-personalize-runtime \
  @aws-sdk/client-personalize-events

Each package creates a client pointed at a different endpoint:

import { PersonalizeClient } from "@aws-sdk/client-personalize";
import { PersonalizeRuntimeClient } from "@aws-sdk/client-personalize-runtime";
import { PersonalizeEventsClient } from "@aws-sdk/client-personalize-events";

// Management plane — resource lifecycle (create/update/delete dataset groups, schemas, campaigns)
const personalize = new PersonalizeClient({ region: "us-east-1" });
// Endpoint: personalize.us-east-1.amazonaws.com

// Inference plane — real-time recommendations
const runtime = new PersonalizeRuntimeClient({ region: "us-east-1" });
// Endpoint: personalize-runtime.us-east-1.amazonaws.com

// Event tracking plane — real-time interaction ingestion
const events = new PersonalizeEventsClient({ region: "us-east-1" });
// Endpoint: personalize-events.us-east-1.amazonaws.com

The separation has IAM consequences. Your MCP server's production execution role should only have inference and event-tracking permissions — not management permissions. Use separate IAM roles for provisioning (CI/CD setup) versus serving (MCP server runtime):

Avro schema design: three pitfalls before you write your first row

Personalize uses Apache Avro JSON format for dataset schemas. The Interactions dataset is the only required dataset — without at least 1,000 unique interactions across 25 unique users and 25 unique items, training will fail. Getting the schema right before the first import saves a painful re-upload cycle.

The minimum Interactions schema requires three reserved fields:

That third field has the most dangerous gotcha in the entire SDK.

Gotcha 1: TIMESTAMP is Unix seconds, not milliseconds

JavaScript's Date.now() returns milliseconds. If you write TIMESTAMP: Date.now() directly into your CSV, Personalize will interpret every event as being from the year 33658. The temporal signal — which is central to the recency weighting the model uses for recommendations — is completely corrupted. The model will treat all interactions as equally old and effectively ignore recency.

// WRONG — JavaScript milliseconds, year ~33000 from Personalize's perspective
const wrongTimestamp = Date.now();         // 1747000000000

// CORRECT — Unix seconds
const correctTimestamp = Math.floor(Date.now() / 1000);  // 1747000000

This error is silent — the import job succeeds, training succeeds, the campaign goes live, and your first recommendations look plausible. The only way to notice is to look at the timestamp values in your dataset and find they are 1,000× larger than Unix seconds. By then you have a trained model on corrupted data and need to re-import and retrain.

Gotcha 2: nullable Avro fields require union syntax

Optional fields in Avro use the union type syntax with default: null. Fields declared with a simple type like "float" are required in every row — if any row is missing that field, the import job fails at schema validation time.

const interactionsSchema = {
  type: "record",
  name: "Interactions",
  namespace: "com.amazonaws.personalize.schema",
  fields: [
    { name: "USER_ID",       type: "string" },   // required
    { name: "ITEM_ID",       type: "string" },   // required
    { name: "TIMESTAMP",     type: "long" },     // required, Unix seconds
    { name: "EVENT_TYPE",    type: "string" },   // required if used
    // Optional reserved fields — must use union syntax:
    { name: "EVENT_VALUE",   type: ["null", "float"],  default: null },
    { name: "IMPRESSION",    type: ["null", "string"], default: null },
    { name: "RECOMMENDATION_ID", type: ["null", "string"], default: null },
  ],
  version: "1.0",
};

The union syntax ["null", "float"] means "this field is either null or a float." The first element of the union array must be "null" and default: null must be specified — this combination tells the Avro parser what value to use when the field is absent in the CSV. Without it, every row in your CSV must have a non-null value for that column, which is rarely practical for optional signals like EVENT_VALUE.

Metadata categorical hint: use it for bounded enums, not free text

For string fields in Items or Users schemas with a bounded vocabulary (plan tiers, item categories, content types), add metadata: { categorical: true }. This tells the training job to embed them as discrete categories rather than free-text tokens, which produces significantly better embeddings for enum-style fields:

const itemsSchema = {
  type: "record",
  name: "Items",
  namespace: "com.amazonaws.personalize.schema",
  fields: [
    { name: "ITEM_ID",    type: "string" },
    { name: "CATEGORY",   type: ["null", "string"], default: null,
      metadata: { categorical: true } },   // "monitoring"|"database"|"integration"|...
    { name: "PLAN_TIER",  type: ["null", "string"], default: null,
      metadata: { categorical: true } },   // "free"|"author"|"team"|"enterprise"
    // Do NOT set categorical:true for high-cardinality fields like DESCRIPTION
    { name: "DESCRIPTION", type: ["null", "string"], default: null },
    // Reserved field — used for cold-start temporal modeling
    { name: "CREATION_TIMESTAMP", type: ["null", "long"], default: null },
  ],
  version: "1.0",
};

CREATION_TIMESTAMP in the Items schema is a reserved field (must be Unix seconds if populated). Personalize uses it to model item age and to weight the exploration algorithm toward newer items — items without CREATION_TIMESTAMP are treated as old for exploration purposes, reducing their chance of appearing in exploration slots even if explorationItemAgeCutOff is set.

The six-stage provisioning pipeline

Unlike most AWS services where a single API call creates a usable endpoint, Personalize requires six sequential provisioning steps before you can call GetRecommendationsCommand. Each step depends on the previous one completing successfully:

// 1. Create the dataset group (top-level container)
const { datasetGroupArn } = await personalize.send(new CreateDatasetGroupCommand({
  name: "mcp-tools-recommendations",
  // For domain groups: domain: "ECOMMERCE" | "VIDEO_ON_DEMAND"
  // For custom groups: omit domain
}));
// Poll DescribeDatasetGroupCommand until status === "ACTIVE"

// 2. Create Avro schema
const { schemaArn } = await personalize.send(new CreateSchemaCommand({
  name:   "mcp-interactions-schema",
  schema: JSON.stringify(interactionsSchema),
}));

// 3. Create dataset container
const { datasetArn } = await personalize.send(new CreateDatasetCommand({
  name:           "mcp-interactions",
  datasetType:    "Interactions",   // "Interactions" | "Items" | "Users"
  datasetGroupArn,
  schemaArn,
}));

// 4. Import data from S3
// CSV header must exactly match schema field names (all uppercase, underscores)
// USER_ID,ITEM_ID,TIMESTAMP,EVENT_TYPE
// user-42,tool-database-query-mcp,1747000000,invoke
const { datasetImportJobArn } = await personalize.send(new CreateDatasetImportJobCommand({
  jobName:    "mcp-interactions-import-v1",
  datasetArn,
  dataSource: { dataLocation: "s3://my-bucket/personalize/interactions.csv" },
  roleArn:    "arn:aws:iam::123456789012:role/PersonalizeS3Role",
  importMode: "FULL",   // "FULL" replaces; "INCREMENTAL" appends
}));
// Poll DescribeDatasetImportJobCommand until status === "ACTIVE"

// 5. Create solution (binds dataset group to recipe) + solution version (the training run)
const { solutionArn } = await personalize.send(new CreateSolutionCommand({
  name:           "mcp-user-personalization",
  datasetGroupArn,
  recipeArn:      "arn:aws:personalize:::recipe/aws-user-personalization",
  // Note: recipe ARNs use triple-colon format — no region segment
}));
const { solutionVersionArn } = await personalize.send(new CreateSolutionVersionCommand({
  solutionArn,
  trainingMode: "FULL",   // "FULL" (20–90 min) or "UPDATE" (5–15 min, aws-user-personalization only)
}));
// Poll DescribeSolutionVersionCommand until status === "ACTIVE" — takes 20–90 minutes

// 6. Create campaign (hosted endpoint)
const { campaignArn } = await personalize.send(new CreateCampaignCommand({
  name:               "mcp-recommendations-prod",
  solutionVersionArn,
  minProvisionedTPS:  1,   // billing floor — $0.20/TPS-hour × 720 hours ≈ $144/month at 1 TPS
  campaignConfig: {
    itemExplorationConfig: {
      explorationWeight:         "0.3",   // 0=fully exploit, 1=fully explore
      explorationItemAgeCutOff:  "30",    // days; older items excluded from exploration slots
    },
  },
}));
// Poll DescribeCampaignCommand until status === "ACTIVE" (~5 minutes)

Recipe ARNs use a triple-colon format with no region segment: arn:aws:personalize:::recipe/aws-user-personalization. This is correct and identical across all regions. The six built-in recipes for custom groups:

RecipeUse caseRequired at inference
aws-user-personalizationTop-N items for a user based on historyuserId
aws-similar-itemsItems similar to a given item (collaborative + content)itemId
aws-personalized-rankingRe-rank an existing list for a specific useruserId + inputList
aws-popularity-countMost popular items globally (no user signal)None
aws-item-affinityUsers' affinity for a given itemitemId
aws-item-attribute-affinityUsers' affinity for item attributesuserId + attribute name

Once a campaign is ACTIVE, you can retrain and deploy without downtime by calling UpdateCampaignCommand with a new solutionVersionArn. The campaign continues serving the old model during the update and cutover to the new version atomically when the update completes.

Runtime inference: scores are relative, not absolute

The runtime plane is where your MCP tools call Personalize at serving time. The separation from the management plane means your MCP server's execution role needs only inference permissions, not the ability to create or modify Personalize resources:

import { PersonalizeRuntimeClient, GetRecommendationsCommand }
  from "@aws-sdk/client-personalize-runtime";

const runtime = new PersonalizeRuntimeClient({ region: "us-east-1" });

const result = await runtime.send(new GetRecommendationsCommand({
  campaignArn: "arn:aws:personalize:us-east-1:123456789012:campaign/mcp-recommendations-prod",
  userId:      "user-42",
  numResults:  10,     // 1–500; default 25
}));

for (const item of result.itemList ?? []) {
  console.log(item.itemId, item.score);
}

Two important properties of the returned scores that catch teams off guard:

  1. Scores are normalized within each response. A score of 0.4 for user-42 and a score of 0.4 for user-99 do not mean the same thing — both are simply "relatively high within that user's response." Never compare scores across users or across separate API calls.
  2. There is no cold-start flag. Users with fewer than 2–5 interactions receive effectively popularity-based results, but the API returns the same structure as personalized responses. Use the heuristic items.some(i => (i.score ?? 0) > 0.01) to detect cold-start responses and handle them differently in your MCP tool (e.g., show a "here are popular tools" label instead of "recommended for you").

For related-item recommendations (requires a campaign trained on aws-similar-items), pass itemId instead of userId. To blend user preference with item similarity — called hybrid inference — pass both:

// Hybrid inference: "items similar to X, ranked by user-42's preferences"
const hybrid = await runtime.send(new GetRecommendationsCommand({
  campaignArn: similarItemsCampaignArn,
  userId:      "user-42",
  itemId:      "tool-database-query-mcp",
  numResults:  5,
}));

Dynamic filters: the JSON-stringify gotcha

Filters allow excluding or including items at inference time based on metadata or interaction history. Static filters embed literal values in the filter expression. Dynamic filters use $VARIABLE_NAME placeholders that you substitute per request:

// Create the dynamic filter at setup time
import { CreateFilterCommand } from "@aws-sdk/client-personalize";

const { filterArn } = await personalize.send(new CreateFilterCommand({
  name:           "filter-by-category",
  datasetGroupArn,
  filterExpression: 'INCLUDE itemId WHERE Items.CATEGORY IN ($CATEGORY)',
}));

At inference time, provide the substitution values via filterValues:

const result = await runtime.send(new GetRecommendationsCommand({
  campaignArn,
  userId:   "user-42",
  numResults: 10,
  filterArn,
  filterValues: {
    // KEY: placeholder name without the $ prefix
    // VALUE: JSON-encoded string array — this is gotcha #4
    CATEGORY: JSON.stringify(["database", "monitoring"]),
    //         ^^^ JSON.stringify wraps the array as a string
    // WRONG: CATEGORY: "database"            (bare string)
    // WRONG: CATEGORY: ["database"]          (raw array, not a string)
    // CORRECT: CATEGORY: '["database","monitoring"]'
  },
}));

The filterValues values must be JSON-encoded string arrays even for a single value: JSON.stringify(["database"]), not "database". Passing a bare string either throws a ResourceNotFoundException or silently returns fewer results than expected (Personalize cannot match the filter expression against a non-array input). This gotcha is not clearly documented in the SDK type definitions — the TypeScript type for filterValues is Record<string, string>, and the "must be JSON-encoded array of strings" constraint is only in the narrative documentation.

Use a consistent wrapper to avoid the mistake:

function encodeFilterValues(values: Record): Record {
  return Object.fromEntries(
    Object.entries(values).map(([k, v]) => [k, JSON.stringify(v)])
  );
}

const result = await runtime.send(new GetRecommendationsCommand({
  campaignArn,
  userId: "user-42",
  numResults: 10,
  filterArn,
  filterValues: encodeFilterValues({ CATEGORY: ["database", "monitoring"] }),
}));

Two-stage retrieval and personalized ranking

The aws-personalized-ranking recipe is the highest-value recipe for MCP server architectures that already have a retrieval layer. Instead of Personalize generating the candidate set, you provide the candidates from your existing retrieval (semantic search, keyword search, rule-based filtering) and Personalize re-orders them by user preference:

import { GetPersonalizedRankingCommand } from "@aws-sdk/client-personalize-runtime";

// candidateItems from your existing retrieval (keyword search, vector DB query, etc.)
const candidateItems = [
  "tool-database-query-mcp",
  "tool-search-mcp",
  "tool-read-file-mcp",
  "tool-write-file-mcp",
  "tool-execute-code-mcp",
];

const ranked = await runtime.send(new GetPersonalizedRankingCommand({
  campaignArn: rankingCampaignArn,   // must be trained on aws-personalized-ranking recipe
  userId:      "user-42",
  inputList:   candidateItems,       // up to 500 items
}));

// personalizedRanking preserves item IDs, orders by user preference
for (const item of ranked.personalizedRanking ?? []) {
  console.log(item.itemId, item.score);
}

The key constraint: the campaign must be specifically trained on the aws-personalized-ranking recipe — you cannot use a aws-user-personalization campaign for ranking. Run two campaigns in production when you need both: one for "recommend from your full catalog" and one for "re-rank these specific candidates."

The practical value of two-stage retrieval for MCP tools: semantic search (via Bedrock Knowledge Base or Kendra) provides broad coverage across your tool/document corpus. Personalize then re-ranks the top-50 results by user history, surfacing the top-5 that this specific user is most likely to need. The two signals are complementary — semantic search finds relevance to the query, Personalize finds relevance to the user.

Real-time event tracking: three SDKs, one feedback loop

Batch imports via S3 snapshot the state of your interaction data at import time. Any interactions that happen after the last import are invisible to the model until the next import runs. PutEventsCommand streams interactions in near-real-time — the model updates its user representations for inference within minutes of receiving new events, without waiting for retraining.

Set up an event tracker once per dataset group:

import { CreateEventTrackerCommand } from "@aws-sdk/client-personalize";

const { trackingId } = await personalize.send(new CreateEventTrackerCommand({
  name:            "mcp-event-tracker",
  datasetGroupArn,
}));

// Store trackingId in environment config — treat it like an API key
// It routes events to the correct dataset group
console.log("Tracking ID:", trackingId);  // UUID format

Send events using the events client (not the management or runtime clients):

import { PersonalizeEventsClient, PutEventsCommand }
  from "@aws-sdk/client-personalize-events";

const eventsClient = new PersonalizeEventsClient({ region: "us-east-1" });

await eventsClient.send(new PutEventsCommand({
  trackingId: process.env.PERSONALIZE_TRACKING_ID!,
  userId:     "user-42",
  sessionId:  "sess-20261116-abc123",
  eventList: [
    {
      eventId:    `evt-${Date.now()}`,         // optional deduplication ID
      eventType:  "invoke",
      sentAt:     new Date(),
      itemId:     "tool-database-query-mcp",
      properties: JSON.stringify({             // MUST be JSON.stringify, not raw object
        itemId: "tool-database-query-mcp",
      }),
    },
  ],
}));

Gotcha 3: properties must be a JSON string

The properties field in each event in eventList must be a JSON-serialized string. Passing a JavaScript object directly causes a silent failure: Personalize returns HTTP 200 (accepted), but the itemId is not extracted from the event, so the interaction is recorded with no item association. Your event tracker shows successful calls but recommendation quality does not improve because there is no item-level signal.

// WRONG — raw object, Personalize returns 200 but itemId not extracted
properties: { itemId: "tool-database-query-mcp" }

// CORRECT — JSON-serialized string
properties: JSON.stringify({ itemId: "tool-database-query-mcp" })

Impression data: training on what users rejected

The impression field in PutEventsCommand is the highest-ROI optional field in the entire Personalize SDK. It records which items were visible to the user at the moment they made their choice. Without impression data, Personalize only sees positive interactions (what was clicked/invoked). With impressions, it also learns what the user was shown and chose not to interact with — negative signal that typically produces 10–30% improvement in recommendation precision.

// Your MCP tool returned these 10 recommendations
const recommendedItems = [
  "tool-search-mcp",
  "tool-database-query-mcp",
  "tool-read-file-mcp",
  "tool-write-file-mcp",
  "tool-execute-code-mcp",
  "tool-send-email-mcp",
  "tool-create-ticket-mcp",
  "tool-schedule-meeting-mcp",
  "tool-get-weather-mcp",
  "tool-translate-text-mcp",
];

// The user invoked only tool-database-query-mcp
await eventsClient.send(new PutEventsCommand({
  trackingId: TRACKING_ID,
  userId:     "user-42",
  sessionId:  "sess-20261116-abc123",
  eventList: [
    {
      eventType:  "invoke",
      sentAt:     new Date(),
      itemId:     "tool-database-query-mcp",    // what the user chose
      impression: recommendedItems,              // ALL items shown — including the chosen one
      properties: JSON.stringify({ itemId: "tool-database-query-mcp" }),
    },
  ],
}));

Include the chosen item in the impression array — it represents the full context the user saw. Add impression tracking before you start sending events, not after: capturing the impression list at the same moment as the click is far easier than retrofitting it. If you have a recommendation ID from the GetRecommendationsCommand call that produced this impression, pass it in recommendationId to close the feedback loop for Personalize's online metrics dashboard:

// 1. Get recommendations and capture the recommendationId
const result = await runtime.send(new GetRecommendationsCommand({
  campaignArn: CAMPAIGN_ARN,
  userId:      "user-42",
  numResults:  10,
}));
const { recommendationId, itemList } = result;

// 2. Present items to user, capture what they interacted with...

// 3. When the user interacts, send the event back with recommendationId
await eventsClient.send(new PutEventsCommand({
  trackingId: TRACKING_ID,
  userId:     "user-42",
  sessionId:  "sess-20261116-abc123",
  eventList: [
    {
      eventType:        "invoke",
      sentAt:           new Date(),
      itemId:           "tool-database-query-mcp",
      recommendationId: recommendationId!,
      impression:       itemList!.map(i => i.itemId!),
      properties:       JSON.stringify({ itemId: "tool-database-query-mcp" }),
    },
  ],
}));

Coldstart session linking: bridging anonymous to authenticated

MCP servers often handle requests before a user identity is established — during an OAuth flow, before first login, or in multi-turn agent sessions where the user becomes known mid-conversation. Personalize can retroactively attribute anonymous interactions to a user via session-based linking.

// Before user logs in: empty userId + stable sessionId
await eventsClient.send(new PutEventsCommand({
  trackingId: TRACKING_ID,
  userId:     "",                              // empty string = anonymous
  sessionId:  "sess-anonymous-abc123",         // stable — from cookie or agent context
  eventList: [
    {
      eventType:  "view",
      sentAt:     new Date(),
      itemId:     "tool-search-mcp",
      properties: JSON.stringify({ itemId: "tool-search-mcp" }),
    },
  ],
}));

// When the user authenticates — use the SAME sessionId
await eventsClient.send(new PutEventsCommand({
  trackingId: TRACKING_ID,
  userId:     "user-42",                       // now known
  sessionId:  "sess-anonymous-abc123",         // ← SAME sessionId as before login
  eventList: [
    {
      eventType:  "invoke",
      sentAt:     new Date(),
      itemId:     "tool-database-query-mcp",
      properties: JSON.stringify({ itemId: "tool-database-query-mcp" }),
    },
  ],
}));

Gotcha 5: session ID must be stable across the auth boundary

The session linkage mechanism only works if the same sessionId is used both before and after authentication. When the first authenticated event arrives with a known userId and a sessionId that matches prior anonymous events, Personalize retrospectively attributes all anonymous interactions from that session to the user. If the session ID changes at login (e.g., the auth system regenerates the session ID for security), the linkage is permanently lost — those anonymous interactions remain unattributed.

The practical implication: use a session identifier that persists across the login event, not one that resets. A cookie-based session ID or an agent conversation ID works well. A cryptographically random per-request ID does not.

Incremental catalog updates without S3 imports

When new tools, documents, or catalog items are added and you do not want to wait for the next scheduled S3 batch import, use PutItemsCommand:

import { PutItemsCommand } from "@aws-sdk/client-personalize-events";

await eventsClient.send(new PutItemsCommand({
  datasetArn: ITEMS_DATASET_ARN,
  items: [
    {
      itemId:     "tool-new-mcp-integration",
      properties: JSON.stringify({
        CATEGORY:          "integration",
        CONTENT_TYPE:      "mcp-tool",
        CREATION_TIMESTAMP: Math.floor(Date.now() / 1000),  // Unix seconds
      }),
    },
  ],
  // Max 10 items per call; throttle 10 req/sec
}));

New items added via PutItemsCommand enter cold-start (no interaction history). They appear in recommendations through exploration slots (explorationWeight > 0 in the campaign config) or after interaction events accumulate enough signal. CREATION_TIMESTAMP controls exploration priority — items without a creation timestamp are treated as old and receive less exploration exposure even when explorationItemAgeCutOff is set.

Similarly, use PutUsersCommand to update user metadata incrementally (plan tier upgrades, role changes) without a full S3 re-import. Property updates are incremental — only the specified keys change, existing keys are preserved. Set a property to null to delete it: JSON.stringify({ PLAN_TIER: null }).

Domain recommenders vs custom campaigns: the decision matrix

Personalize offers two paths: custom dataset groups (you pick recipes, trigger training, manage the solution lifecycle) and domain dataset groups (pick ECOMMERCE or VIDEO_ON_DEMAND, Personalize provides pre-built recommenders that auto-retrain every 7 days). The correct choice depends entirely on whether your item catalog fits a standard e-commerce or media schema.

FactorCustom dataset groupDomain dataset group
Setup steps Solution + solution version + campaign (manual training) Recommender only — no solution, no campaign (CreateRecommenderCommand)
Retraining Manual — trigger CreateSolutionVersionCommand Automatic every 7 days by default (configure via UpdateRecommenderCommand)
Recipe choice All 6 built-in recipes + custom HPO 5 pre-built recipes per domain (fixed algorithms)
Schema requirements Minimal — USER_ID, ITEM_ID, TIMESTAMP Domain-specific reserved fields required (PRICE, CATEGORY_L1, GENRES, etc.)
Inference parameter campaignArn recommenderArn
Response metadata itemId + score only itemId + score + item metadata columns (with enableMetadataWithRecommendations: true)
Best for Tool recommendations, document ranking, workflow suggestions — non-standard schemas E-commerce product recommendations, video streaming catalogs

For most MCP server use cases — tool recommendation, document re-ranking, workflow step suggestion — custom dataset groups are the correct choice. MCP server item catalogs do not naturally contain PRICE, CATEGORY_L1, or GENRES fields. Use a domain group only if your MCP server wraps an e-commerce or media platform where your Items dataset naturally maps to the domain schema.

Gotcha 6: domain cannot be changed after creation

The domain field on a dataset group is immutable. You cannot change ECOMMERCE to VIDEO_ON_DEMAND after creation, and you cannot convert a domain group to a custom group. If you pick the wrong domain — or realize your use case fits custom better — you must create a new dataset group and re-upload all data. This is the most expensive mistake to fix, so choose custom if there is any ambiguity about whether your schema fits a supported domain.

// Creating a domain group — domain is set once and permanent
const { datasetGroupArn } = await personalize.send(new CreateDatasetGroupCommand({
  name:   "mcp-ecommerce-recommendations",
  domain: "ECOMMERCE",   // immutable after creation
}));

// For domain groups, use CreateRecommenderCommand instead of CreateSolutionCommand
const { recommenderArn } = await personalize.send(new CreateRecommenderCommand({
  name:           "ecommerce-recommended-for-you",
  datasetGroupArn,
  recipeArn:      "arn:aws:personalize:::recipe/aws-ecommerce-recommended-for-you",
  recommenderConfig: {
    minRecommendationRequestsPerSecond: 1,
    enableMetadataWithRecommendations: true,   // return item metadata columns in response
  },
}));

// At inference time: use recommenderArn, not campaignArn
const result = await runtime.send(new GetRecommendationsCommand({
  recommenderArn: recommenderArn,
  userId:         "user-42",
  numResults:     10,
}));

// With enableMetadataWithRecommendations: item.metadata populated with Items dataset columns
for (const item of result.itemList ?? []) {
  console.log(item.itemId, item.score, item.metadata?.CATEGORY_L1);
}

IAM summary: three roles, three planes

Separate IAM roles for the three planes follows least-privilege and allows you to audit each plane independently:

{
  "Version": "2012-10-17",
  "Statement": [
    // Inference role (MCP server runtime — read-only recommendations)
    {
      "Effect": "Allow",
      "Action": [
        "personalize:GetRecommendations",
        "personalize:GetPersonalizedRanking"
      ],
      "Resource": [
        "arn:aws:personalize:us-east-1:123456789012:campaign/mcp-recommendations-prod",
        "arn:aws:personalize:us-east-1:123456789012:campaign/mcp-personalized-ranking"
        // For domain groups: "arn:aws:personalize:...:recommender/..."
      ]
    },
    // Events role (MCP server runtime — write interaction events)
    {
      "Effect": "Allow",
      "Action": [
        "personalize:PutEvents",
        "personalize:PutUsers",
        "personalize:PutItems"
      ],
      "Resource": "arn:aws:personalize:us-east-1:123456789012:event-tracker/mcp-event-tracker"
      // Note: PutUsers and PutItems target event-tracker ARN for IAM, not dataset ARN
    }
  ]
}

The personalize:PutUsers and personalize:PutItems IAM resource is the event tracker ARN, not the dataset ARN. The dataset ARN appears in the SDK request body but is not the IAM resource for these actions — a non-obvious inconsistency that produces permission denied errors if you use the dataset ARN as the IAM resource.

See the IAM guide for MCP servers for the general pattern of separating provisioning roles from serving roles and locking resource ARNs to specific resources rather than using wildcards.

Pricing snapshot

OperationCostNotes
Data import (S3)$0.05/GB processedPer import job
Training$0.24/training-hour20–90 min per FULL training; UPDATE ~5–15 min
Campaign hosting$0.20/TPS-hour (provisioned)1 TPS × 720h = $144/month; minProvisionedTPS is billing floor
Auto-scaled burst$0.0048/TPS-hourWhen actual traffic exceeds minProvisionedTPS
Real-time events$0.0024/1,000 eventsPutEvents calls
Batch inference$0.067/user10,000 users ≈ $6.70 per batch job

The campaign hosting cost dominates for development workloads. At 1 TPS minProvisionedTPS, you pay approximately $144/month whether or not traffic reaches that rate. For internal MCP server tools with low-to-moderate usage, consider sharing a single campaign across all tool types rather than deploying per-tool campaigns to avoid multiplying the hosting cost.

Use batch inference (CreateBatchInferenceJobCommand) to pre-compute a "top 25" recommendation cache for all users, stored in DynamoDB or Redis. Your MCP tool then reads from cache at sub-millisecond latency and pays only batch inference cost ($0.067/user) instead of per-request campaign hosting, while completely avoiding cold-start latency for the first inference call per session.