Skip to content

Architecture

PKP is designed as a three-layer architecture for maximum flexibility and decentralization.

Layer 0: Static Files

The foundation of PKP is static files hosted on vendor domains.

https://example.com/
├── pkp.txt                           # Optional: discovery pointer
└── .well-known/
    └── pkp/
        ├── catalog.json              # Product index (L0)
        └── products/
            ├── product-a.md          # PRODUCT.md files
            └── product-b.md

Benefits

  • Zero cost: Just static files
  • Decentralized: Data stays on vendor domains
  • Cacheable: Works with CDNs
  • No vendor lock-in: Standard HTTP

catalog.json

json
{
  "schema": "pkp-catalog/1.0",
  "name": "Example Store",
  "description": "Quality products",
  "updated_at": "2025-01-15T10:00:00Z",
  "products": [
    {
      "sku": "product-a",
      "name": "Product A",
      "category": "notebooks",
      "path": "products/product-a.md"
    }
  ]
}

Layer 1: Catalog MCP Server

For AI agents that need to interact with a single catalog.

bash
# Start server
pkp-catalog-server ./dist

Tools Available

ToolDescription
search_productsSearch with filters
get_productGet product details
compare_productsCompare 2-5 products
list_categoriesList all categories
get_product_faqGet product FAQ
get_alternativesFind similar products

MCP Resources

  • pkp://catalog - Catalog metadata
  • pkp://product/{sku} - Product content

Layer 2: Registry MCP Server

For AI agents that need cross-catalog product discovery.

bash
# Start registry
pkp-registry-server --domain registry.example.com

Tools Available

ToolDescription
search_productsGlobal search across catalogs
resolve_productResolve pkp://domain/sku URI
register_catalogAdd catalog to registry
compare_across_catalogsCompare products from different catalogs
list_catalogsList registered catalogs

Product URIs

Products can be referenced globally using PKP URIs:

pkp://example.com/iphone-16-pro
pkp://store.example.com/galaxy-s25-ultra

Data Flow

┌─────────────────┐
│   AI Agent      │
│  (Claude, etc)  │
└────────┬────────┘
         │ MCP Protocol

┌─────────────────┐     ┌─────────────────┐
│ Registry Server │────▶│ Catalog Server  │
│    (Layer 2)    │     │    (Layer 1)    │
└────────┬────────┘     └────────┬────────┘
         │                       │
         ▼                       ▼
┌─────────────────┐     ┌─────────────────┐
│  catalog.json   │     │  PRODUCT.md     │
│    (Layer 0)    │     │    (Layer 0)    │
└─────────────────┘     └─────────────────┘

Confidence & Trust

Each data source has an associated trust level:

LevelSourceTrust
1manufacturerHighest
2retailer-feedHigh
3communityMedium
4ai-generatedLow
5scrapedLowest

When conflicts occur, higher trust sources take precedence.

Released under the MIT License.