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.
Python ai-toolsai-watchanthropicclaudecybersecuritydashboardgeofencinggeopoliticalgeospatialintelligencemarketsmcpmigrationmilitarymodel-context-protocolnuclearosintreal-timespace-weatherthreat-intelligence
Research routes: drop Access-Control-Allow-Origin (review r2 behavior F4, tests F9)
Phoenix Agent (mac-studio)d7ce2ccdf784
diff --git a/README.md b/README.mdindex 1a3c4f0..a72ea4a 100644--- a/README.md+++ b/README.md@@ -120,7 +120,7 @@ intel-dashboard --port 9000 # custom port- **Situations** (`/api/situations?hours=&sort=&kind=`, `fetch_situations`) and **Top stories** (`/api/top-stories?hours=&min_outlets=`, `fetch_top_stories`): ranked situations or multi-outlet stories with sample headlines, the attention list, feed coverage (failed feeds named) and the functions' own definitions, method and data gaps.- **Collection health** (`/api/collection-health`, `HistoryStore.collection_health`): state counts, then failing, degraded, not-attempted-recently and never-run sources with last attempt, last success, failures in a row, overdue and reason, storage size, and the report's `cannot_prove` text as given.-A panel that has not loaded says so; a failed call shows UNAVAILABLE with the reason (HTTP 503, or 504 after a 90 s budget) and never an empty list; a failed refresh keeps the earlier copy under a REFRESH FAILED banner with the time it loaded. Limits: the situations and top stories panels read every RSS feed: 5 to 15 s per call in the 2026-10-17 runs, warm cache included, because a feed that fails is not cached and every call tries it again, with retries, for up to 12 s. Collection health reads the history store in the dashboard's own cache database (`WORLD_INTEL_CACHE_DB`, or the default path), so it shows only cycles a collector ran against that same database; one writing elsewhere leaves every source `never_run`. Like the other dashboard routes, these answer with `Access-Control-Allow-Origin: *`, so a page open in the same browser can read them, the cache database path included; the server binds 127.0.0.1 unless `--host` says otherwise.+A panel that has not loaded says so; a failed call shows UNAVAILABLE with the reason (HTTP 503, or 504 after a 90 s budget) and never an empty list; a failed refresh keeps the earlier copy under a REFRESH FAILED banner with the time it loaded. Limits: the situations and top stories panels read every RSS feed: 5 to 15 s per call in the 2026-10-17 runs, warm cache included, because a feed that fails is not cached and every call tries it again, with retries, for up to 12 s. Collection health reads the history store in the dashboard's own cache database (`WORLD_INTEL_CACHE_DB`, or the default path), so it shows only cycles a collector ran against that same database; one writing elsewhere leaves every source `never_run`. These four routes send no `Access-Control-Allow-Origin` header, so a page from another site cannot read their answers; the older dashboard routes still send `Access-Control-Allow-Origin: *`, and `/api/overview` includes the cache database path. The server binds 127.0.0.1 unless `--host` says otherwise.### PDF/HTML Reportsdiff --git a/src/world_intel_mcp/dashboard/app.py b/src/world_intel_mcp/dashboard/app.pyindex 67ac6f0..dc91d2b 100644--- a/src/world_intel_mcp/dashboard/app.py+++ b/src/world_intel_mcp/dashboard/app.py@@ -745,10 +745,12 @@ async def api_migration(request):# ``error`` is a 503 with the payload intact, a timeout a 504, an exception a# 503 with the reason. None of them answers with an empty list that could# read as "nothing happened".+#+# No Access-Control-Allow-Origin header: the panel fetches from its own+# origin, so a page from another site cannot read these answers (the+# collector run log, the cache database path).# ----------------------------------------------------------------------------_CORS = {"Access-Control-Allow-Origin": "*"}-# The budget /api/stream gives its slow sources. The RSS panels read every# feed: 5 to 15 s per call measured 2026-10-17, warm cache included, as a# failed feed is not cached and each call retries it for up to 12 s.@@ -802,7 +804,7 @@ async def _research_payload(name: str, coro) -> tuple[dict, int]:def _bad_request(exc: ValueError) -> JSONResponse:- return JSONResponse({"error": str(exc)}, status_code=400, headers=_CORS)+ return JSONResponse({"error": str(exc)}, status_code=400)async def api_liquidity_board(request):@@ -823,7 +825,7 @@ async def api_liquidity_board(request):"liquidity board", liquidity.fetch_liquidity_board(_ensure_fetcher(), sort=sort))payload.setdefault("net_liquidity_method", copy.deepcopy(liquidity.NET_LIQUIDITY_METHOD))- return JSONResponse(payload, status_code=status, headers=_CORS)+ return JSONResponse(payload, status_code=status)async def api_situations(request):@@ -844,7 +846,7 @@ async def api_situations(request):payload, status = await _research_payload("situations", news_signals.fetch_situations(_ensure_fetcher(), **kwargs))- return JSONResponse(payload, status_code=status, headers=_CORS)+ return JSONResponse(payload, status_code=status)async def api_top_stories(request):@@ -863,7 +865,7 @@ async def api_top_stories(request):payload, status = await _research_payload("top stories", news_signals.fetch_top_stories(_ensure_fetcher(), **kwargs))- return JSONResponse(payload, status_code=status, headers=_CORS)+ return JSONResponse(payload, status_code=status)def _history_db_path() -> Path:@@ -924,9 +926,8 @@ async def api_collection_health(request):"db_path": None if db_path is None else str(db_path),},status_code=503,- headers=_CORS,)- return JSONResponse(data, status_code=404 if "error" in data else 200, headers=_CORS)+ return JSONResponse(data, status_code=404 if "error" in data else 200)async def api_health(request):diff --git a/src/world_intel_mcp/tests/test_dashboard_research.py b/src/world_intel_mcp/tests/test_dashboard_research.pyindex bc51ad2..807d4ee 100644--- a/src/world_intel_mcp/tests/test_dashboard_research.py+++ b/src/world_intel_mcp/tests/test_dashboard_research.py@@ -208,7 +208,7 @@ def test_liquidity_board_passes_payload_through_with_the_method_block(client, fecalls = _stub(monkeypatch, liquidity, "fetch_liquidity_board", _BOARD)r = client.get("/api/liquidity-board")assert r.status_code == 200- assert r.headers.get("access-control-allow-origin") == "*"+ assert "access-control-allow-origin" not in r.headers# Partial outage (unavailable), stale-cache row and blocked list all stay in the payload.assert r.json() == {**_BOARD, "net_liquidity_method": _METHOD}assert calls == [(fetcher, {"sort": "biggest_move"})]@@ -272,7 +272,7 @@ def test_situations_pass_through_with_default_arguments(client, fetcher, monkeypcalls = _stub(monkeypatch, news_signals, "fetch_situations", _SITUATIONS)r = client.get("/api/situations")assert r.status_code == 200- assert r.headers.get("access-control-allow-origin") == "*"+ assert "access-control-allow-origin" not in r.headersassert r.json() == _SITUATIONSassert calls == [(fetcher, {"hours": 24.0, "sort": "covered", "kind": "all", "limit": 20, "min_articles": 2})]@@ -499,7 +499,7 @@ def test_collection_health_reads_the_store_and_returns_the_report_unchanged(clie_populate(health_db)r = client.get("/api/collection-health")assert r.status_code == 200- assert r.headers.get("access-control-allow-origin") == "*"+ assert "access-control-allow-origin" not in r.headersbody = r.json()assert body == _expected(health_db)states = {s["source"]: s["state"] for s in body["sources"]}@@ -579,6 +579,32 @@ def test_collection_health_opens_the_dashboard_cache_database(client, tmp_path,assert {s["source"]: s["state"] for s in r.json()["sources"]}["fires"] == "failing"+def test_no_research_answer_is_readable_by_another_origin(client, fetcher, monkeypatch, tmp_path, pinned_history) -> None:+ """The panel fetches from its own origin. No answer of the four routes,+ success or failure, carries Access-Control-Allow-Origin, so a page from+ another site cannot read the run log or the cache database path."""+ _stub(monkeypatch, liquidity, "fetch_liquidity_board", _BOARD_OUTAGE)+ _stub(monkeypatch, news_signals, "fetch_situations", _SITUATIONS)+ _stub(monkeypatch, news_signals, "fetch_top_stories", _TOP)+ db_path = tmp_path / "cache.db"+ _populate(db_path)+ monkeypatch.setattr(dashboard_app, "_history_db_path", lambda: db_path)+ origin = {"Origin": "https://other.example"}+ answers = {+ path: client.get(path, headers=origin)+ for path in (+ "/api/liquidity-board", "/api/liquidity-board?sort=x", "/api/situations",+ "/api/top-stories", "/api/collection-health", "/api/collection-health?source=nope",+ )+ }+ assert {p: r.status_code for p, r in answers.items()} == {+ "/api/liquidity-board": 503, "/api/liquidity-board?sort=x": 400, "/api/situations": 200,+ "/api/top-stories": 200, "/api/collection-health": 200, "/api/collection-health?source=nope": 404,+ }+ leaking = [p for p, r in answers.items() if any(h.startswith("access-control-") for h in r.headers)]+ assert leaking == []++def test_roster_is_the_collector_sources() -> None:from world_intel_mcp.collector import SOURCES