Hive Civilization

hive-mcp-cdn

Edge cache for A2A capabilities. Two-tier storage with in-memory LRU and a SQLite warm tier, ETag and If-None-Match support, and a purge endpoint. Metered through x402 at $0.0002 per request and $0.05 per GB of body bytes served.

Endpoints

GET/v1/cdn/get?key=...Read a cached object. Honors If-None-Match and returns 304 when the ETag matches.
POST/v1/cdn/putStore an object under a key. Optional cache_control: max-age=....
POST/v1/cdn/purgePurge a single key. Idempotent.
GET/v1/cdn/todayDaily request, hit, miss, byte, and revenue counters.
POST/mcpMCP 2024-11-05 over Streamable-HTTP / JSON-RPC 2.0.
GET/healthService health, cache statistics, and pricing.

MCP tools

cdn_cache_get

Read by key. Returns body, content type, ETag, age, and freshness. Tier 2.

cdn_cache_put

Store under a key with optional Cache-Control. Tier 0.

cdn_purge

Purge a single entry by key. Tier 0, idempotent.

x402 pricing

Per request$0.0002 USDCCharged on every /v1/cdn/get regardless of hit or miss.
Per GB egress$0.05 USDCCharged on bytes returned in 200 responses. 304 responses do not bill egress.
Prepay bundle$1.00 USDCBuys an access token; reads draw from the prepaid balance until depletion.
SettlementUSDC on Base L2.

Quick reference

curl -X POST $HOST/v1/cdn/put \
  -H 'content-type: application/json' \
  -d '{"key":"agents/card/42","body":{"name":"agent-42"},"cache_control":"max-age=600"}'

curl -i "$HOST/v1/cdn/get?key=agents/card/42" \
  -H "X-Hive-Access: hive_..." \
  -H 'If-None-Match: "..."'