Skip to content

160-tool MCP server for real-time global intelligence from free public APIs: markets, liquidity, prediction markets, SEC filings, conflict, military, aircraft-cohort early warning, migration and border flows, cyber, climate, news and more. Dated observation history, 29 research prompts, cited briefs, geofences, SSE dashboard. MIT, no paid API keys.

Release 0.7.0 docs: the split recorded

Phoenix Agent (Marcs-Mac-Studio)9b0bb245cefb
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 5d96871..eade7a7 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,31 @@
# Changelog
+## 0.7.0 - 2026-09-01
+
+The monolith splits. No behavior changes.
+
+### Changed
+- server.py (2,890 lines: a 128-entry Tool list plus an 800-line
+ match/case) is now a 158-line shell over 12 domain modules in
+ `world_intel_mcp/tools/` (markets, hazards, conflict,
+ infrastructure, society, intelligence, geospatial, synthesis,
+ finance, vector, aoi, system), with shared infrastructure (cache,
+ circuit breaker, AOI store, vector store, fetcher) in
+ `world_intel_mcp/runtime.py`. Each module exports TOOLS and
+ HANDLERS; `tools.aggregate()` refuses to import a registry whose
+ tools and handlers disagree or collide, so the drift the old
+ text-scan parity test could only catch in CI now prevents the
+ server from starting at all.
+- Pure move, verified three ways: an AST comparison of every
+ name/description/inputSchema against the pre-split registry
+ (127/127 byte-equal), the full suite (814 passed, 90.8% coverage),
+ and a live MCP stdio session (initialize, tools/list returning all
+ 128, and a real tools/call round-trip).
+- Registry/registration tests upgraded from text-scans of server.py
+ to import-based assertions against the aggregated registry,
+ including a falsifiability test proving `aggregate()` rejects
+ drift and collisions.
+
## 0.6.0 - 2026-09-01
The CLI stops lying about outages, and the new domains join the 24/7
diff --git a/CLAUDE.md b/CLAUDE.md
index ad70c7f..9f3b8c5 100644
--- a/CLAUDE.md
+++ b/CLAUDE.md
@@ -47,7 +47,9 @@ collector.py (daemon) ──┘
- `CircuitBreaker`: Per-source tracking. 3 consecutive failures trips the breaker for 5 minutes. Each RSS feed gets its own breaker (`rss:bbc_world`).
- `Cache`: SQLite WAL-mode TTL cache. `get()` returns live data, `get_stale()` returns expired data for fallback.
-**Source modules** (`sources/*.py`): Each module exports `async def fetch_*(fetcher: Fetcher, **kwargs) -> dict`. Pure data fetching — no MCP awareness. 30 modules covering markets, seismology, military, cyber, health, tech, environmental, etc.
+**Tool registry** (`tools/*.py` + `runtime.py`, Phase 26): server.py is a thin shell; the 128 tools live in 12 domain modules under `tools/`, each exporting `TOOLS` (list of Tool definitions) and `HANDLERS` (tool name -> `async def h(arguments)`). Shared infrastructure (cache, circuit breaker, AOI store, vector store, fetcher) is constructed once in `runtime.py`; handlers reach it as `runtime.fetcher` etc. `tools/aggregate()` enforces TOOLS/HANDLERS parity and cross-module name uniqueness at import time — a drifted registry refuses to start.
+
+**Source modules** (`sources/*.py`): Each module exports `async def fetch_*(fetcher: Fetcher, **kwargs) -> dict`. Pure data fetching — no MCP awareness. 30+ modules covering markets, seismology, military, cyber, health, tech, environmental, etc.
**Analysis modules** (`analysis/*.py`): Cross-domain intelligence that consumes outputs from multiple sources. Includes signal aggregation, instability indexing, NLP (entity extraction, classification, clustering, spike detection via Welford's algorithm), and strategic synthesis.
@@ -65,7 +67,7 @@ collector.py (daemon) ──┘
1. Create `sources/your_source.py` with `async def fetch_your_data(fetcher: Fetcher, **kwargs) -> dict`
2. Use `fetcher.get_json(url, source="your-source", cache_key=..., cache_ttl=300)` — this gives you caching, retries, circuit breaking, and rate limiting automatically
-3. In `server.py`: import the module, add a `Tool(...)` to the `TOOLS` list, add a `case` to `_dispatch()`
+3. In the matching `tools/<domain>.py`: append the `Tool(...)` to that module's `TOOLS` and add a handler to its `HANDLERS` (`async def h(arguments)` calling your fetch via `runtime.fetcher`); `tools/aggregate()` fails the import if the two disagree
4. Optionally add to `dashboard/app.py` (SSE endpoint) and `cli.py` (Click command)
5. Add tests using `respx` to mock HTTP (see `tests/test_sources.py` for pattern)
diff --git a/ROADMAP.md b/ROADMAP.md
index c5583a6..e3051b4 100644
--- a/ROADMAP.md
+++ b/ROADMAP.md
@@ -27,7 +27,7 @@
| Geofence correctness | Antimeridian AOIs lost the far side of the dateline (bbox clamp); pipelines/cables matched on endpoints only | :white_check_mark: Fixed in Phase 22 | Segment distance + split bboxes shipped with tests |
| Security posture | Issue #21 (external report) assessed; no shell/eval/exec, SQL parameterized throughout, report paths server-generated | :white_check_mark: | SECURITY.md added with explicit threat model; cache db now 0600 |
| Documentation drift | Prior roadmap documented 89/110 tools while the codebase now exposes 113 | :white_check_mark: Updated below | Keep roadmap synced with phase increments |
-| Maintainability | `src/world_intel_mcp/server.py` is ~2.7k lines and remains the main refactor target | :yellow_circle: | Split tool registry and dispatch by domain (Phase 26) |
+| Maintainability | server.py split into 12 domain modules + runtime.py (158-line shell); parity enforced at import time | :white_check_mark: Shipped 2026-09-01 (Phase 26) | Largest module 444 lines |
| CLI/dashboard parity for AOIs | AOI tools exist over MCP only; no `intel aoi` CLI group, no dashboard AOI layer | :red_circle: | Phase 23 |
### Implemented Addendum Missing From Prior Roadmap
@@ -586,10 +586,13 @@ Verified absent from `sources/` on 2026-09-01 (grep, not memory):
Note: resolved in 0.6.0 - the four domains are in the collector's
roster (50 sources), with the invariant test and docs updated together.
-### Phase 26 (planned): server.py Modularization
-~2.7k lines; split the tool registry and dispatch by domain, keeping
-the TOOLS/`_dispatch` parity invariant machine-checked (Phase 24's
-import-based tests make this refactor safe to attempt).
+### Phase 26: server.py Modularization (shipped 2026-09-01)
+The 2,890-line monolith is a 158-line shell over 12 domain modules in
+`tools/` plus shared infrastructure in `runtime.py`. The
+TOOLS/`_dispatch` parity invariant is now enforced at import time by
+`tools.aggregate()` (drift or collision refuses to start), verified by
+an AST byte-parity gate against the pre-split registry, the full
+suite, and a live MCP stdio session.
---
diff --git a/pyproject.toml b/pyproject.toml
index 9b3027f..dad14bf 100644
--- a/pyproject.toml
+++ b/pyproject.toml
@@ -1,6 +1,6 @@
[project]
name = "world-intel-mcp"
-version = "0.6.0"
+version = "0.7.0"
description = "World Intelligence MCP Server — real-time global intelligence across 30+ domains with 100+ MCP tools"
readme = "README.md"
requires-python = ">=3.11"