{
  "schema_version": "1.0",
  "name": "cybershop-ai",
  "description": "CYBERSHOP AI MCP — поиск APICore-каталога и заявки на проект (Kazakhstan B2B IT).",
  "transport": {
    "type": "http",
    "url": "https://cybershop.kz/mcp"
  },
  "backend": "cloudflare-worker",
  "upstream": "https://cybershop-mcp.cybershop.workers.dev",
  "tools": [
    {
      "name": "get_catalog_summary",
      "auth": "none",
      "description": "Сводка каталога APICore",
      "inputSchema": { "type": "object", "properties": {} },
      "result": {
        "source": "string",
        "item_count": "number",
        "generated_at": "string",
        "catalog_url": "string"
      }
    },
    {
      "name": "search_catalog",
      "auth": "none",
      "description": "Поиск SKU по q, category, networkRole, limit (max 50)",
      "inputSchema": {
        "type": "object",
        "properties": {
          "q": { "type": "string" },
          "category": { "type": "string" },
          "networkRole": { "type": "string" },
          "limit": { "type": "integer", "minimum": 1, "maximum": 50 }
        }
      },
      "result": {
        "count": "number",
        "items": "CatalogSlim[]"
      }
    },
    {
      "name": "get_product",
      "auth": "none",
      "description": "Карточка по pn или id",
      "inputSchema": {
        "type": "object",
        "properties": {
          "pn": { "type": "string" },
          "id": { "type": "string" }
        }
      },
      "result": {
        "ok": "boolean",
        "product": "CatalogSlim?",
        "reason": "not_found?"
      }
    },
    {
      "name": "submit_lead",
      "auth": "required",
      "description": "Проектная заявка. Нужны title и contactPhone или contactName. Fail-closed: без валидного ключа — HTTP 401 + JSON-RPC -32001 mcp_unauthorized.",
      "inputSchema": {
        "type": "object",
        "required": ["title"],
        "properties": {
          "title": { "type": "string" },
          "brief": { "type": "string" },
          "contactEmail": { "type": "string" },
          "contactPhone": { "type": "string" },
          "contactName": { "type": "string" },
          "invoiceNo": { "type": "string" }
        }
      },
      "result": {
        "ok": "boolean",
        "id": "string?",
        "orderNo": "string?",
        "duplicate": "boolean?",
        "reason": "string?"
      }
    }
  ],
  "auth": {
    "public_tools": ["get_catalog_summary", "search_catalog", "get_product"],
    "protected_tools": ["submit_lead"],
    "header": "X-MCP-Key",
    "alternate": "Authorization: Bearer <MCP_API_KEY>",
    "fail_closed": true,
    "submit_lead_key_required": true,
    "unauthorized": {
      "http_status": 401,
      "jsonrpc_code": -32001,
      "message": "mcp_unauthorized"
    },
    "note": "submit_lead ALWAYS requires X-MCP-Key or Authorization: Bearer matching Worker secret MCP_API_KEY. If MCP_API_KEY is not configured on the Worker, submit_lead is denied (fail-closed). Never open without a key."
  },
  "example_submit_lead": {
    "curl": "curl -s -X POST https://cybershop.kz/mcp -H 'Content-Type: application/json' -H 'X-MCP-Key: $MCP_API_KEY' -d '{\"jsonrpc\":\"2.0\",\"id\":1,\"method\":\"tools/call\",\"params\":{\"name\":\"submit_lead\",\"arguments\":{\"title\":\"Подбор PoE\",\"contactPhone\":\"+77001234567\"}}}'"
  },
  "catalog_fallback": "https://cybershop.kz/data/catalog/index.json",
  "documentation": "https://cybershop.kz/for-agents/",
  "human_docs": "https://cybershop.kz/for-agents/",
  "languages": ["ru", "ru-KZ"],
  "regions": ["KZ"]
}
