{
  "$schema": "https://playground.wordpress.net/blueprint-schema.json",
  "meta": {
    "title": "Royal MCP — Live Demo",
    "description": "Try the Royal MCP security-first Model Context Protocol server live in your browser. API key auth, rate limiting, activity log, and platform config all pre-seeded.",
    "author": "royalplugins",
    "categories": ["AI & Integration"]
  },
  "landingPage": "/wp-admin/admin.php?page=royal-mcp",
  "preferredVersions": { "php": "8.2", "wp": "latest" },
  "phpExtensionBundles": ["kitchen-sink"],
  "features": { "networking": true },
  "login": { "username": "admin", "password": "password" },
  "steps": [
    {
      "step": "setSiteOptions",
      "options": {
        "blogname": "Royal MCP Demo",
        "blogdescription": "Security-first MCP server for WordPress — live preview."
      }
    },
    {
      "step": "installPlugin",
      "pluginData": { "resource": "wordpress.org/plugins", "slug": "royal-mcp" },
      "options": { "activate": true }
    },
    {
      "step": "runPHP",
      "code": "<?php\nrequire_once '/wordpress/wp-load.php';\n\n// Turn the MCP server on and set a stable demo API key so the Settings UI renders meaningfully.\nupdate_option( 'royal_mcp_settings', [\n  'enabled'     => true,\n  'api_key'     => 'rmcp_demo_' . wp_generate_password( 24, false ),\n  'platforms'   => [\n    'claude'  => [ 'enabled' => true ],\n    'chatgpt' => [ 'enabled' => true ],\n    'gemini'  => [ 'enabled' => false ],\n  ],\n  'mcp_servers' => [],\n] );\n\nglobal $wpdb;\n$table = $wpdb->prefix . 'royal_mcp_logs';\nif ( $wpdb->get_var( \"SHOW TABLES LIKE '{$table}'\" ) !== $table ) {\n  return;\n}\n\n// Seed representative activity log entries so the Activity Log page isn't empty in the demo.\n$samples = [\n  [ '-4 hours',  'claude',  'tools/list',        'success', '{\"jsonrpc\":\"2.0\",\"method\":\"tools/list\",\"id\":1}',           '{\"tools\":[{\"name\":\"search_posts\"},{\"name\":\"get_post\"},{\"name\":\"list_products\"}]}' ],\n  [ '-3 hours',  'claude',  'tools/call',        'success', '{\"method\":\"tools/call\",\"params\":{\"name\":\"search_posts\",\"arguments\":{\"query\":\"backup\"}}}','{\"content\":[{\"type\":\"text\",\"text\":\"Found 12 posts\"}]}' ],\n  [ '-2 hours',  'chatgpt', 'resources/list',    'success', '{\"method\":\"resources/list\"}',                               '{\"resources\":[{\"uri\":\"wp://posts\"},{\"uri\":\"wp://pages\"}]}' ],\n  [ '-90 minutes','claude', 'tools/call',        'rate_limited', '{\"method\":\"tools/call\",\"params\":{\"name\":\"get_post\",\"arguments\":{\"id\":42}}}','{\"error\":\"rate_limit_exceeded\",\"retry_after\":60}' ],\n  [ '-45 minutes','unknown','tools/list',        'unauthorized', '{\"method\":\"tools/list\"}',                                   '{\"error\":\"invalid_api_key\"}' ],\n  [ '-15 minutes','chatgpt','tools/call',        'success',     '{\"method\":\"tools/call\",\"params\":{\"name\":\"list_products\"}}','{\"content\":[{\"type\":\"text\",\"text\":\"WooCommerce not installed in demo.\"}]}' ],\n];\n\nforeach ( $samples as $row ) {\n  list( $ago, $server, $action, $status, $req, $res ) = $row;\n  $wpdb->insert( $table, [\n    'timestamp'     => gmdate( 'Y-m-d H:i:s', strtotime( $ago ) ),\n    'mcp_server'    => $server,\n    'action'        => $action,\n    'request_data'  => $req,\n    'response_data' => $res,\n    'status'        => $status,\n  ] );\n}\n"
    }
  ]
}
