MCP Minigame Creation

The Optimove MCP exposes the Minigames creation engine as Model Context Protocol (MCP) actions — the same connection that powers campaign analytics, segment exploration, and promotion creation.

Any Optimove client with Minigames enabled can point an MCP-compatible AI client — such as Claude, ChatGPT, Gemini, Cursor, or VS Code — at https://mcp.optimove.net/mcp and generate, preview, iterate on, and publish fully playable minigames into their Minigames library. You describe the game in natural language; the AI generates the complete HTML game, deploys a preview, and returns a live URL. There are no templates to conform to, no visual-editor constraints, and no hand-coded game logic required.

Prerequisites

  • An Optimove account with Minigames enabled
  • An MCP-compatible AI client connected to the Optimove MCP server — see the Optimove MCP Connector reference
  • No additional setup: create_mini_game and save_mini_game are part of your MCP toolset once the connector is authenticated

How It Works

The minigame actions follow a preview-then-publish model. Nothing is permanently published until you call save_mini_game.

  1. Connect your AI client to the Optimove MCP server at https://mcp.optimove.net/mcp
  2. Prompt the client — for example: "Create a football-themed scratch card with our brand colors."
  3. The AI generates a complete, self-contained HTML game with the SDK embedded
  4. The AI calls create_mini_game, which returns a live preview URL in seconds
  5. Open the URL and play the game
  6. Prompt for changes — the AI regenerates and the same preview URL updates automatically
  7. When the game is ready, the AI calls save_mini_game to publish it to your Minigames library
  8. Attach the published game to any campaign and activate it in Optimove
💡

Same hour, same preview slot

The AI updates the same preview URL on every iteration within the same hour — no duplicate previews are created — until you call save_mini_game. After the hour resets, a new slot is created automatically. Pass the previous preview_id explicitly if you want to keep editing across the hour boundary.

ℹ️

Publishing a game with save_mini_game adds it to your library, but does not activate or send anything to customers. Attaching a game to a campaign and activating that campaign is always a separate, human action in Optimove.

Try It

Paste the following prompt into Claude, Cursor, or any MCP-connected client to generate your first game:

Use the Optimove MCP to create a mobile-responsive scratch card game with a football
theme. Use green and white as the primary colors, add a satisfying reveal animation,
and use the SDK to handle prize display. Show me a live preview link.

The AI handles the rest: game logic, HTML, CSS, SDK integration, and preview deployment.

Example: Memory Challenge

A card-flip memory game is a pure-skill mechanic that is universally understood and works for any brand in any vertical. Swap what appears on the cards and it adapts: product shots for retail, player faces for sports, destinations for travel, or abstract brand patterns for finance and telco.

The prompt

Create a card-flip memory game. 4x4 grid of 8 pairs — use brand icons as the card faces.
Cards flip with a smooth 3D animation. 60-second timer: Gold prize for finishing under
20s, Silver under 40s, Bronze under 60s. Wrong flips shake and flip back. Correct matches
lock with a green glow. Show the earned prize on completion and call the SDK. Mobile-first.

What the AI builds

The board

  • A 4x4 CSS grid with cards sized in vw units, so it fits any screen

  • CSS rotateY(180deg) with perspective for a true 3D flip

  • Wrong pair: shake animation plus auto-flip back after 800ms

  • Correct match: green pulse glow, cards lock face-up
    The prize system

  • A countdown timer that shifts green → amber → red as time runs out

  • Gold / Silver / Bronze tiers based on completion speed

  • Game completion triggers the SDK and the campaign prize flow

  • A time-out ends with a retry prompt — no dead ends

💡

Prompt to live preview URL: about 60 seconds

Want a 6x6 hard mode, a leaderboard, or different prize tiers? That is one follow-up prompt.

What the AI Controls

Because the AI generates the complete HTML, it has full control over every aspect of the game — there are no templates to conform to and no visual-editor constraints:

  • Game mechanic — any type, from scratch cards to platformers
  • Visual design — brand colors, fonts, layout, and animations
  • Difficulty and scoring — fully configurable logic
  • Particle effects and transitions
  • Sound design via the Web Audio API
  • Prize display and winner screens
  • SDK event hooks — context.prize, finish(), and callbacks
  • Mobile and desktop responsiveness

Prize-Draw Games

The prize list arrives at runtime. Prizes are campaign data, not game data. The same game is reused across campaigns with different prizes, and two players in the same campaign can legitimately see different lists. So the game is handed its prizes when it loads, inside AdactGame.onReady():

MethodReturns
AdactGame.getPrizes()Every prize this player could win: [{id, title, description, image}], any length
AdactGame.getWonPrize()The prize this player won, always one of getPrizes()
AdactGame.getWonPrizeIndex()Index of the winning prize within getPrizes()
AdactGame.isRngGame()Whether prize context is present

When you open a play_url preview, the SDK supplies a sample prize catalogue automatically so the game stays playable. The number of sample prizes varies on each reload on purpose, so you can check the layout holds up.

The one hard rule. The game must end by revealing the prize the platform assigned, through whatever animation or interaction the mechanic calls for. Within that, the design is open. You can ask for:

  • Any reveal mechanic: wheel, slot reels, box opening, scratch, card pick
  • The full prize pool shown before the reveal, after it, or not at all
  • Prize image, name and description shown or hidden

A wheel naturally shows every segment, because the pointer has to land on one. A scratch card shows only what was scratched, which is the point of a scratch card. Ask for the mechanic you want and the pool visibility follows from it.

Example Prompt:

Create a spin the wheel prize draw. One segment per prize in the campaign, brand colors, smooth easing that slows into the winning segment. Show the prize image and name on the winner screen. Mobile-first.

The MCP Actions

The explore (mini-games focus), create_mini_game, and save_mini_game actions are part of your existing Optimove MCP connection. No additional setup is required — once the connector is authenticated, they appear in your client's toolset.

explore — mini-games focus

Searches and retrieves games from the Minigames library. Behavior depends on whether you pass mini_game_id.

List mode (no mini_game_id)

ParameterRequiredDescription
searchNoFilter by title. Partial names match — "Snake" matches "Snake Game", "Snake Classic", and similar.
fuzzyNoSet to true to tolerate typos and misspellings. Off by default.
offsetNoPagination start index. Use next_offset from the previous response to page forward.

Returns: { id, title, cdn_url } per game. cdn_url is a direct browser link to the published game.

Detail mode (mini_game_id=<id>)

ParameterRequiredDescription
mini_game_idYesThe id from a list response. Fetches the full game HTML from the CDN.

Returns: id, title, cdn_url, and html — the complete source code, ready to modify and pass back to create_mini_game.

create_mini_game

Generates or updates a minigame in preview mode and returns a live playable URL. Nothing is permanently published until you call save_mini_game.

ParameterRequiredDescription
game_codeYesComplete, self-contained HTML with embedded CSS, the SDK script, and game logic.
nameNoDisplay name. Auto-generated if omitted (Game_YYYYMMDD_HHMMSS).
preview_idNoPass to explicitly update a previous session's game. Omit to use the automatic same-hour slot.
modeNo"score" (default) or "rng". Use "rng" for prize-draw games, see Prize-Draw Games above. It changes the SDK injected into the game, so it must be set at create time, not only at save.

Returns: preview_id, play_url, has_sdk, is_update.

Example

{
  "game_code": "<!DOCTYPE html><html>...</html>",
  "name": "Football Scratch Card"
}
{
  "preview_id": "prev_a1b2c3",
  "play_url": "https://play.adact.me/preview/prev_a1b2c3",
  "has_sdk": true,
  "is_update": false
}

save_mini_game

Permanently publishes a previewed game to your Minigames library.

ParameterRequiredDescription
preview_idYesThe preview_id returned by create_mini_game.
nameNoFinal display name for the published game.
modeNo"score" (default) or "rng". Use "rng" for prize-draw games, see Prize-Draw Games above. It changes the SDK injected into the game, so it must be set at create time, not only at save.

Result: The game appears in your Minigames library, ready to attach to any campaign.

Example

{
  "preview_id": "prev_a1b2c3",
  "name": "Football Scratch Card"
}

Game Code Requirements — Technical Spec

The HTML passed to create_mini_game must be a complete, self-contained document:

  • <!DOCTYPE html> declaration
  • <html>, <head>, and <body> tags, all properly closed
  • A <style> block containing all CSS — no external stylesheets
  • The SDK <script> placed before the game logic — see the SDK reference for the embed snippet and available methods (context.prize, finish(), event callbacks)
  • Mobile-responsive layout using relative units (vw, vh, %, rem) — no fixed pixels
  • A complete implementation — no TODOs, placeholders, or incomplete logic
  • No external libraries. Games must be built in vanilla JavaScript. A CDN-hosted library
    cannot be used even if the marketer asks for one explicitly:
⚠️

If game_code contains a disallowed pattern, create_mini_game returns 400 with
{"error": "Game code contains disallowed content", "failure_domain": "validation"} and nothing is deployed. All game resources (images, sounds, fonts) must be inline or generated
in code, with no external URLs in any tag attribute or JS call. Your AI client receives the
full list of disallowed patterns from the MCP server and will avoid them.

For the SDK embed snippet, prize context, and event callbacks, see the SDK reference.

Part of the Full Optimove MCP

These minigame actions belong to the Builder category of the Optimove MCP. Like the other Builder tools, they create assets in your tenant that become available to attach to a campaign — they do not message customers or activate anything on their own.

Because the broader MCP exposes campaigns, segments, promotions, and platform analytics in the same connection, a single AI session can run fully end to end:

  1. Look up available customer segments
  2. Generate a branded minigame and preview it with create_mini_game
  3. Create a Target Group
  4. Draft a campaign
  5. Publish the game with save_mini_game

For the full transport, safety model, authentication, and tool catalog, see the Optimove MCP Connector reference.


Did this page help you?