Files
hanzo-dev dff283f1d0 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.

Claude-Session: https://claude.ai/code/session_013jh8aka8q8RvhhVQ1psMeW
2026-07-09 22:06:26 -07:00

13 lines
546 B
JSON

{
"$schema": "https://static.modelcontextprotocol.io/schemas/2025-12-11/server.schema.json",
"name": "ai.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",
"remotes": [
{
"type": "streamable-http",
"url": "https://world.hanzo.ai/v1/world/mcp"
}
]
}