Skip to content

chore(mcp): audit MCP coverage — 39 seeded data sources not exposed to agents #3029

@koala73

Description

@koala73

Context

WorldMonitor seeds 67+ canonical Redis keys across energy, economics, geopolitics, climate, markets, and infrastructure. The MCP server (`api/mcp.ts`) only exposes 28 of those keys through ~30 hand-curated tools (`get_market_data`, `get_economic_data`, etc.).

When a new seeder ships, nothing auto-propagates to MCP. Each new tool (or extension to an existing tool) requires a manual edit to `api/mcp.ts` with:

  • `name`, `description`, `inputSchema`
  • `_cacheKeys` array
  • `_seedMetaKey`
  • `_maxStaleMin`

Result: agents using the MCP endpoint get a partial view of what WorldMonitor actually knows.

Seeded keys NOT exposed via MCP (39)

Economic / Macro (6)

  • `economic:imf:macro:v2` — IMF WEO macro (inflation, current account, gov revenue, 200+ countries)
  • `economic:national-debt:v1` — US Treasury + IMF debt-to-GDP timeseries
  • `economic:bigmac:v1` — Big Mac PPP index ~50 countries
  • `economic:grocery-basket:v1` — grocery basket prices by country
  • `economic:fao-ffpi:v1` — FAO Food Price Index
  • `economic:eurostat-country-data:v1` — EU GDP/unemployment/CPI

Resilience (5) — entire pillar unexposed

  • `resilience:recovery:fiscal-space:v1`
  • `resilience:recovery:reserve-adequacy:v1`
  • `resilience:recovery:external-debt:v1`
  • `resilience:recovery:import-hhi:v1`
  • `resilience:recovery:fuel-stocks:v1`

Energy (8)

  • `economic:eu-gas-storage:v1`
  • `energy:chokepoint-baselines:v1`
  • `energy:chokepoint-flows:v1`
  • `energy:crisis-policies:v1`
  • `energy:iea-oil-stocks:v1:index`
  • `energy:intelligence:feed:v1`
  • `energy:jodi-gas:v1:_countries`
  • `energy:jodi-oil:v1:_countries`
  • `energy:spr-policies:v1`

Supply chain (5)

  • `supply_chain:hormuz_tracker:v1`
  • `supply_chain:portwatch-ports:v1:_countries`
  • `supply_chain:portwatch:v1`
  • `portwatch:chokepoints:ref:v1`
  • `portwatch:disruptions:active:v1`

Markets (3)

  • `market:crypto-sectors:v1`
  • `market:stablecoins:v1`
  • `shared:fx-rates:v1`

Health / Security (4)

  • `health:disease-outbreaks:v1`
  • `health:vpd-tracker:realtime:v1`
  • `cyber:threats:v2`
  • `patents:defense:latest`

Infrastructure (3)

  • `infra:service-statuses:v1`
  • `infrastructure:submarine-cables:v1`
  • `regulatory:actions:v1`

Other (5)

  • `bls:series:v1`
  • `correlation:cards-bootstrap:v1`
  • `intelligence:advisories:v1`
  • `thermal:escalation:v1`

Proposed action

Phase 1: close the existing gap (this issue)

For each uncovered key above, either:

  • Add to an existing MCP tool's `_cacheKeys` (if thematically adjacent), or
  • Create a new tool entry

Prioritize high-value domains first: resilience pillar (5 keys, currently a flagship feature that's invisible to agents), IMF macro (200+ countries, referenced by multiple seeders), energy/supply chain (geopolitical analysis core).

Phase 2: prevent future drift (follow-up)

Options (pick one):

  • (a) CI check: lint that fails if a new canonical key lands in `scripts/seed-*.mjs` without being referenced in `api/mcp.ts`
  • (b) Template rule: add a checklist item to `.github/PULL_REQUEST_TEMPLATE.md` for new seeders: "□ Exposed via MCP in api/mcp.ts"
  • (c) Auto-registry: refactor MCP tools to read from a single source-of-truth registry (similar to `SEED_META` in `api/health.js`) so new seeds get a default MCP tool auto-generated

Recommend (a) + (b) together. Auto-generation is tempting but loses description-quality control; a simple CI diff catches the majority of the problem.

Related

Acceptance criteria

  • All 39 uncovered seed keys either mapped to an existing MCP tool or given a new tool entry in `api/mcp.ts`
  • Each new/extended tool has a meaningful `description` (what the data is, cadence, country coverage)
  • `_seedMetaKey` and `_maxStaleMin` set correctly per tool
  • `tests/mcp.test.mjs` updated to cover new tools
  • Phase 2 drift-prevention mechanism chosen and implemented

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: APIBackend API, sidecar, keysenhancementNew feature or requestrefactorCode restructuring, architecture

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions