Files
world/public/.well-known/mcp/server-card.json
zeekayandHanzo Dev 95d5c9dc05 feat(world/mcp): MCP server (streamable-HTTP, JSON-RPC 2.0) at /v1/world/mcp
Clean-room MCP apps surface for Hanzo World — a thin, read-only projection
of the existing public /v1/world/* routes. Ideas-only from the upstream
study; no code copied.

- internal/world/mcp: JSON-RPC 2.0 over streamable HTTP. 7 tools
  (world_brief, country_instability, model_history, market_quotes,
  chain_status, traffic_map, feeds) each dispatched IN-PROCESS through the
  same world mux via an httptest recorder — one impl per data path, the
  model.Engine's unexported handlers reached through the mux composition
  point, zero edits to existing handlers.
- Two MCP apps (ui:// resources): world-brief + market-radar. resources/read
  returns a DATA-FREE static HTML shell (text/html;profile=mcp-app, strict
  CSP, textContent-only, no innerHTML) that receives data later via a
  tools/call over the host postMessage bridge (quota-safe two-phase).
- Discovery: root server.json (MCP registry manifest) + public/.well-known/
  mcp/server-card.json (tool + app inventory), both generated by
  cmd/gencard and digest-stable like the agent-skills index.
- feeds tool exposes a curated category enum (never raw URLs) over
  allowlisted RSS hosts — no SSRF surface.
- Anonymous public access; gate() attachment point noted per the
  internal/world/model gate() pattern for later pro-tier gating.

Tests: JSON-RPC initialize/tools.list/tools.call/resources round-trip over
live wiring, server-card + server.json drift guards, shell digest pins, and
a data-free/no-innerHTML shell-safety grep. Verified end-to-end against the
compiled binary with the official @modelcontextprotocol/inspector CLI.

Co-authored-by: Hanzo Dev <[email protected]>
2026-07-09 22:06:26 -07:00

189 lines
5.8 KiB
JSON

{
"schemaVersion": 1,
"name": "hanzo-world",
"title": "Hanzo World",
"description": "Read-only Model Context Protocol server over Hanzo World's public planetary-intelligence data: world-model instability rankings, per-country risk, market quotes, cloud chain + traffic status, and curated news feeds. Ships two MCP apps (world-brief, market-radar).",
"version": "1.0.0",
"endpoint": "/v1/world/mcp",
"transport": "streamable-http",
"protocolVersion": "2025-06-18",
"tools": [
{
"name": "world_brief",
"title": "World Brief",
"description": "Ranked snapshot of the highest-instability entities from the Hanzo World model — the fastest \"what is going on in the world right now\" brief.",
"method": "GET",
"endpoint": "/v1/world/model/top",
"inputSchema": {
"additionalProperties": false,
"properties": {
"kind": {
"default": "country",
"description": "entity kind to rank",
"enum": [
"country",
"theater",
"market"
],
"type": "string"
},
"metric": {
"default": "instability",
"description": "ranking signal",
"enum": [
"instability",
"velocity",
"sentiment"
],
"type": "string"
},
"n": {
"default": 10,
"description": "number of entities to return",
"maximum": 100,
"minimum": 1,
"type": "integer"
}
},
"type": "object"
},
"app": "ui://world/world-brief"
},
{
"name": "country_instability",
"title": "Country Instability",
"description": "Instability, news-velocity and sentiment profile for one country by ISO code, from the Hanzo World model.",
"method": "GET",
"endpoint": "/v1/world/model/country/",
"inputSchema": {
"additionalProperties": false,
"properties": {
"iso": {
"description": "ISO 3166 country code, e.g. US, RU, CN, UA",
"type": "string"
}
},
"required": [
"iso"
],
"type": "object"
}
},
{
"name": "model_history",
"title": "Model History",
"description": "Downsampled time-series of composite world instability and top movers over the last N hours (max 168).",
"method": "GET",
"endpoint": "/v1/world/model/history",
"inputSchema": {
"additionalProperties": false,
"properties": {
"hours": {
"default": 24,
"description": "look-back window in hours",
"maximum": 168,
"minimum": 1,
"type": "integer"
}
},
"type": "object"
}
},
{
"name": "market_quotes",
"title": "Market Quotes",
"description": "Live quotes (price, change, %change, high/low/open/previous-close) for up to 20 symbols — stocks, indices, FX, commodities, crypto. Returns skipped:true when no quote provider is configured.",
"method": "GET",
"endpoint": "/v1/world/finnhub",
"inputSchema": {
"additionalProperties": false,
"properties": {
"symbols": {
"description": "ticker symbols, e.g. [\"AAPL\",\"^GSPC\",\"BTC-USD\"]",
"items": {
"type": "string"
},
"maxItems": 20,
"minItems": 1,
"type": "array"
}
},
"required": [
"symbols"
],
"type": "object"
},
"app": "ui://world/market-radar"
},
{
"name": "chain_status",
"title": "Chain Status",
"description": "Public chain-node telemetry for the Hanzo Cloud map: node locations, health and per-region counts.",
"method": "GET",
"endpoint": "/v1/world/cloud/chain-nodes",
"inputSchema": {
"additionalProperties": false,
"properties": {},
"type": "object"
}
},
{
"name": "traffic_map",
"title": "Traffic Map",
"description": "Public request-traffic snapshot for the Hanzo Cloud map: origin→edge flows and regional volume.",
"method": "GET",
"endpoint": "/v1/world/cloud/traffic",
"inputSchema": {
"additionalProperties": false,
"properties": {},
"type": "object"
}
},
{
"name": "feeds",
"title": "News Feeds",
"description": "Latest headlines for one news category, fetched server-side from a curated set of reputable RSS feeds. Categories: world, tech, markets, security, ai.",
"method": "POST",
"endpoint": "/v1/world/feeds-batch",
"inputSchema": {
"additionalProperties": false,
"properties": {
"category": {
"default": "world",
"description": "news category",
"enum": [
"world",
"tech",
"markets",
"security",
"ai"
],
"type": "string"
}
},
"type": "object"
}
}
],
"apps": [
{
"uri": "ui://world/world-brief",
"name": "world-brief",
"title": "World Brief",
"description": "Ranked list of the highest-instability entities from the Hanzo World model.",
"tool": "world_brief",
"mimeType": "text/html;profile=mcp-app",
"sha256": "0051db196f80843c370663cd95bbcf836df79dfd60750991efc7a27e5b6e2e01"
},
{
"uri": "ui://world/market-radar",
"name": "market-radar",
"title": "Market Radar",
"description": "Compact quote board for a watchlist of market symbols.",
"tool": "market_quotes",
"mimeType": "text/html;profile=mcp-app",
"sha256": "1ee47b12414bf01cf4311d9182541a427dc7e43fe0609eb4709047eb37c3ef14"
}
]
}