Sovereign Debt Contagion & Geopolitical Risk
About
Sovereign debt contagion modelling and geopolitical risk analysis are now available as a single MCP server your AI agent can call directly.
Details
- License
- MIT
Explore
- 4th-order tensor network construction — builds T[creditor][debtor][exposure_type][time] from 18 sources, decomposed via Alternating Least Squares CP decomposition (T ≈ Σ_r λ_r · a_r ⊗ b_r ⊗ c_r ⊗ d_r) to reveal latent cross-exposure structures
- Euler-Maruyama Monte Carlo with contagion shocks — discretises the coupled SDE system dd(t) = (r(t) − g(t))d(t)dt + pb(t)dt + σ_d·d(t)·dW(t) with up to 10,000 paths; when country j exceeds distress threshold, injects contagion shock r_i += exposure_ij × severity_j into creditor country i
- Bifurcation classification — computes the Jacobian at the current fixed point, finds dominant eigenvalues via power iteration, then sweeps interest rate spread parameters to locate tipping points and classifies them as saddle-node, Hopf, or transcritical
- HHI × VaR commodity vulnerability — Herfindahl-Hirschman Index of the commodity export basket multiplied by commodity-specific 95th-percentile log-normal VaR, scaled by commodity exports to GDP; outputs four risk tiers (LOW / MEDIUM / HIGH / CRITICAL)
- Markov-switching currency crisis detection — two-regime model with Hamilton forward recursion; augmented by Exchange Market Pressure index EMP = Δe/e − (σ_e/σ_r)(ΔR/R) + (σ_e/σ_i)Δi; cryptocurrency volume spikes as supplementary capital flight indicator; crisis flag at P(crisis) > 0.70
- Modified IMF ARA reserve adequacy — RA = reserves / (0.3×STD + 0.2×portfolio + 0.1×M2 + 0.1×exports); adjusted for current crisis probability and geopolitical alignment score derived from latent space proximity to major reserve currency issuers
- Latent space geopolitical alignment — SVD on the country-feature matrix (trade flows, sanctions co-occurrence, aid relationships) via power iteration and deflation, yielding low-dimensional ideal point estimates analogous to DW-NOMINATE; assigns countries to US_ALIGNED, EU_ALIGNED, CN_ALIGNED, or NON_ALIGNED blocs
- Composite sovereign risk report — integrates all 7 algorithms into a single overallSystemicRisk score (0-1), letter grade (A-F), ranked top risk factors, and actionable recommendations
- Seeded deterministic numerics — uses Mulberry32 PRNG seeded from country identifiers; results are reproducible across runs with identical inputs
- Spending limit enforcement — each tool checks Actor.charge() before executing; stops gracefully when the run budget is reached
- 18-actor parallel orchestration — runActorsParallel() fires all actor calls via Promise.all(); individual actor failures return empty arrays rather than crashing the pipeline
Setting up with Highlight
This MCP is not yet compatible with Highlight’s one-click setup. However, you can still use it with Highlight by following these steps:
- Download and install Highlight from highlightai.com/download
- Navigate to the plugins tab and select "Add Custom Plugin"
-
Configure the plugin with the settings below
Plugin Name
Sovereign Debt Contagion & Geopolitical RiskCommand (node, npx, python, etc.)Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.
- Enable "Start Automatically" if you want the plugin to start when Highlight launches
From the repository
Add to your MCP client (Claude Desktop, Cursor, Windsurf):
{
"mcpServers": {
"sovereign-debt-contagion-geopolitical-mcp": {
"url": "https://ryanclinton--sovereign-debt-contagion-geopolitical-mcp.apify.actor/mcp"
}
}
}
---
Sovereign debt contagion modelling and geopolitical risk analysis are now available as a single MCP server your AI agent can call directly. This server gives Claude, Cursor, and any MCP-compatible client 8 quantitative finance tools that fuse live data from 18 international sources — IMF, World Bank, OECD, Eurostat, FRED, BLS, UN COMTRADE, exchange rate feeds, CoinGecko, OFAC, OpenSanctions, Interpol, World Bank Projects, Grants.gov, USAspending, and GDACS — into institutional-grade sovereign risk models. The result is a fully automated pipeline from raw macroeconomic data to crisis probability scores, contagion chains, tipping point detection, and geopolitical alignment maps.
The server implements seven distinct quantitative algorithms: a 4th-order tensor CP decomposition for network structure, Euler-Maruyama Monte Carlo simulation of coupled sovereign debt SDEs, Jacobian-based bifurcation analysis, HHI-weighted commodity vulnerability with 95th-percentile VaR, Markov-switching currency crisis detection via the Hamilton filter, a modified IMF Assessing Reserve Adequacy metric, and latent space ideal point estimation via SVD for geopolitical positioning. Each tool runs the relevant data collection actors in parallel, calibrates the model from live data, and returns structured analytical output in seconds.
build_sovereign_exposure_network
4th-order tensor CP decomposition (ALS)
simulate_debt_crisis_cascade
Euler-Maruyama coupled SDE Monte Carlo (up to 10,000 paths)
detect_bifurcation_points
Jacobian eigenvalues via power iteration; saddle-node/Hopf/transcritical classification
compute_commodity_vulnerability
HHI of export basket × 95th-pct VaR, scaled by commodity exports/GDP
detect_currency_crisis_signal
Markov-switching two-regime model (Hamilton filter); EMP index
assess_reserve_adequacy
Modified IMF ARA adjusted for crisis probability and geopolitical alignment
map_geopolitical_alignment
Latent space ideal point estimation via SVD (DW-NOMINATE style)
generate_sovereign_risk_report
Full 7-algorithm pipeline with composite risk score and recommendations
| Tool | Algorithm | Best For | Approx. Cost |
|------|-----------|----------|--------------|
| build_sovereign_exposure_network | 4th-order tensor CP decomposition (ALS) | Initial network construction; prerequisite for simulations | $0.05/call |
| simulate_debt_crisis_cascade | Euler-Maruyama coupled SDE Monte Carlo (up to 10,000 paths) | Default probabilities, contagion chains, systemic risk score | $0.055/call |
| detect_bifurcation_points | Jacobian eigenvalues via power iteration; saddle-node/Hopf/transcritical classification | Tipping point proximity, parameter sensitivity | $0.05/call |
| compute_commodity_vulnerability | HHI of export basket × 95th-pct VaR, scaled by commodity exports/GDP | Dutch disease, resource curse, commodity shock exposure | $0.045/call |
| detect_currency_crisis_signal | Markov-switching two-regime model (Hamilton filter); EMP index | Early warning of currency crises, capital flight detection | $0.045/call |
| assess_reserve_adequacy | Modified IMF ARA adjusted for crisis probability and geopolitical alignment | IMF-style reserve buffer assessment | $0.04/call |
| map_geopolitical_alignment | Latent space ideal point estimation via SVD (DW-NOMINATE style) | Bloc assignments, geopolitical distance matrix | $0.05/call |
| generate_sovereign_risk_report | Full 7-algorithm pipeline with composite risk score and recommendations | Portfolio stress testing, comprehensive sovereign assessment | $0.05/call |
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"sovereign debt contagion & geopolitical risk": {
"sovereign-debt-contagion-geopolitical-mcp": {
"url": "https://ryanclinton--sovereign-debt-contagion-geopolitical-mcp.apify.actor/mcp"
}
}
}
}
McpServers
{
"sovereign-debt-contagion-geopolitical-mcp": {
"url": "https://ryanclinton--sovereign-debt-contagion-geopolitical-mcp.apify.actor/mcp"
}
}
Sovereign Debt Contagion & Geopolitical MCP Server
> View on ApifyForge | Use on Apify Store
---
Quick Start
Add to your MCP client (Claude Desktop, Cursor, Windsurf):
{
"mcpServers": {
"sovereign-debt-contagion-geopolitical-mcp": {
"url": "https://ryanclinton--sovereign-debt-contagion-geopolitical-mcp.apify.actor/mcp"
}
}
}
---
Sovereign debt contagion modelling and geopolitical risk analysis are now available as a single MCP server your AI agent can call directly. This server gives Claude, Cursor, and any MCP-compatible client 8 quantitative finance tools that fuse live data from 18 international sources — IMF, World Bank, OECD, Eurostat, FRED, BLS, UN COMTRADE, exchange rate feeds, CoinGecko, OFAC, OpenSanctions, Interpol, World Bank Projects, Grants.gov, USAspending, and GDACS — into institutional-grade sovereign risk models. The result is a fully automated pipeline from raw macroeconomic data to crisis probability scores, contagion chains, tipping point detection, and geopolitical alignment maps.
The server implements seven distinct quantitative algorithms: a 4th-order tensor CP decomposition for network structure, Euler-Maruyama Monte Carlo simulation of coupled sovereign debt SDEs, Jacobian-based bifurcation analysis, HHI-weighted commodity vulnerability with 95th-percentile VaR, Markov-switching currency crisis detection via the Hamilton filter, a modified IMF Assessing Reserve Adequacy metric, and latent space ideal point estimation via SVD for geopolitical positioning. Each tool runs the relevant data collection actors in parallel, calibrates the model from live data, and returns structured analytical output in seconds.
What data can you access?
| Data Point | Source | Example Value |
|---|---|---|
| 📊 Debt-to-GDP ratio, growth, interest rates | IMF World Economic Outlook | Argentina: 89.4% debt/GDP |
| 🌐 Development indicators, governance scores | World Bank | GR governance percentile: 61.2 |
| 📈 International economic statistics | OECD | Germany primary balance: +1.2% GDP |
| 🇪🇺 EU fiscal and monetary statistics | Eurostat | IT general government debt: 144.7% |
| 🏦 US monetary indicators (FEDFUNDS, GDP, GFDEBTN) | FRED | Fed Funds rate: 5.33% |
| 👷 CPI and unemployment time series | BLS | US CPI: 3.2%, Unemployment: 3.7% |
| 🚢 Bilateral trade flows by commodity | UN COMTRADE | US-CN goods trade: $575B |
| 💱 Live foreign exchange rates | Exchange Rate Tracker | USD/ARS: 839.5 |
| 📉 Historical FX time series | Exchange Rate History | TRY 12-month depreciation: 38% |
| 🏛️ ECB reference rates (EUR/major pairs) | ECB Rates | EUR/USD: 1.0847 |
| ₿ Cryptocurrency prices and volumes | CoinGecko | BTC volume spike: +240% (VE) |
| 🚫 OFAC sanctions and blocked entities | OFAC | RU sovereign entities: 412 |
| 🌍 Global sanctions and PEP registries | OpenSanctions | CN state-owned: 89 entries |
| 🔴 Interpol red notices and fugitives | Interpol | Active notices: 7,241 |
| 🏗️ World Bank development project aid | World Bank Projects | EG commitments: $2.1B |
| 💰 US federal grants (foreign aid) | Grants.gov | USAID awards: 1,847 |
| 🇺🇸 Federal spending and foreign assistance | USAspending | Foreign assistance FY24: $62B |
| 🌊 Global disaster alerts and risk events | GDACS | PK flood severity: Orange |
MCP tools
| Tool | Algorithm | Best For | Approx. Cost |
|------|-----------|----------|--------------|
| build_sovereign_exposure_network | 4th-order tensor CP decomposition (ALS) | Initial network construction; prerequisite for simulations | $0.05/call |
| simulate_debt_crisis_cascade | Euler-Maruyama coupled SDE Monte Carlo (up to 10,000 paths) | Default probabilities, contagion chains, systemic risk score | $0.055/call |
| detect_bifurcation_points | Jacobian eigenvalues via power iteration; saddle-node/Hopf/transcritical classification | Tipping point proximity, parameter sensitivity | $0.05/call |
| compute_commodity_vulnerability | HHI of export basket × 95th-pct VaR, scaled by commodity exports/GDP | Dutch disease, resource curse, commodity shock exposure | $0.045/call |
| detect_currency_crisis_signal | Markov-switching two-regime model (Hamilton filter); EMP index | Early warning of currency crises, capital flight detection | $0.045/call |
| assess_reserve_adequacy | Modified IMF ARA adjusted for crisis probability and geopolitical alignment | IMF-style reserve buffer assessment | $0.04/call |
| map_geopolitical_alignment | Latent space ideal point estimation via SVD (DW-NOMINATE style) | Bloc assignments, geopolitical distance matrix | $0.05/call |
| generate_sovereign_risk_report | Full 7-algorithm pipeline with composite risk score and recommendations | Portfolio stress testing, comprehensive sovereign assessment | $0.05/call |
Why use Sovereign Debt Contagion & Geopolitical MCP Server?
Building sovereign risk models manually means assembling data from a dozen international databases, normalising currencies and time periods, writing the SDE discretisation code, implementing tensor decomposition, and interpreting bifurcation diagrams — a project that takes a quantitative analyst weeks and requires Bloomberg Terminal or Refinitiv licenses running $20,000-30,000 per year.
This MCP server eliminates that entirely. Your AI agent calls a single tool, the server fetches fresh data from 18 public sources in parallel, runs the calibrated model, and returns structured analytical results. No data sourcing. No numerical methods implementation. No subscription required.
- Scheduling — run daily or weekly sovereign monitoring for a country portfolio via Apify's built-in task scheduler
- API access — trigger the server from Python, JavaScript, or any MCP-compatible client, including Claude and Cursor
- Parallel data collection — all 18 actors run simultaneously; total data collection time is bounded by the slowest single source, not the sum
- Monitoring — configure Slack or email alerts when runs fail via Apify's notification system
- Integrations — connect results to Zapier, Make, Google Sheets, or webhooks for downstream reporting pipelines
Features
…
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



