Sovereign Debt Contagion
About
Sovereign debt contagion analysis for credit analysts, macro fund managers, and development finance institutions — delivered through any MCP-compatible AI client.
Details
- Author
- apifyforge
- GitHub stars
- 1
- Downloads
- 136
- Categories
- Other
Jump to
- Four independent scoring models (Sovereign Stress, Contagion, Currency Crisis, Disaster-Fiscal)
- Composite sovereign risk verdict with crisis override logic
- HHI trade concentration scoring from UN COMTRADE
- Historical FX volatility pattern matching for currency crisis
- Parallel 8-source data collection via Promise.all
- Graceful partial results when data sources fail
- 7 distinct MCP tools covering all risk dimensions
- MCP Standby mode eliminating cold-start delays
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 ContagionCommand (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 the server URL https://ryanclinton--sovereign-debt-contagion-mcp.apify.actor/mcp to your MCP client configuration (Claude Desktop, Cursor, Windsurf). Then ask a question in natural language (e.g., “Assess sovereign stress for Argentina”). The server runs up to 8 data sources in parallel and returns structured JSON output in 15–60 seconds.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"sovereign debt contagion": {
"sovereign-debt-contagion-mcp": {
"url": "https://ryanclinton--sovereign-debt-contagion-mcp.apify.actor/mcp"
}
}
}
}
McpServers
{
"sovereign-debt-contagion-mcp": {
"url": "https://ryanclinton--sovereign-debt-contagion-mcp.apify.actor/mcp"
}
}
Sovereign Debt Contagion MCP Server
> View on ApifyForge | Use on Apify Store
---
Quick Start
Add to your MCP client (Claude Desktop, Cursor, Windsurf):
{
"mcpServers": {
"sovereign-debt-contagion-mcp": {
"url": "https://ryanclinton--sovereign-debt-contagion-mcp.apify.actor/mcp"
}
}
}
---
Sovereign debt contagion analysis for credit analysts, macro fund managers, and development finance institutions — delivered through any MCP-compatible AI client. This server orchestrates 8 international data sources (IMF, World Bank, OECD, UN COMTRADE, FRED, live and historical exchange rates, GDACS disaster alerts) to produce a composite sovereign risk verdict ranging from INVESTMENT_GRADE to DEFAULT_RISK. Ask a question in natural language, receive structured JSON with numeric scores, calibrated signals, and portfolio recommendations in seconds.
The server runs 7 distinct MCP tools covering every dimension of sovereign risk: fiscal stress, trade-channel contagion, currency crisis probability, fiscal headroom, disaster-fiscal compound vulnerability, multi-country comparison, and full regional scenario planning. All 8 underlying data sources fire in parallel via Promise.all, cutting total latency to the slowest single source. No code required after a one-time setup.
What data can you extract?
| Data Point | Source | Example |
|---|---|---|
| 📊 Debt-to-GDP ratio, fiscal balance, current account deficit | IMF World Economic Outlook | Debt/GDP: 87.4%, Deficit: -6.2% |
| 🏛️ Governance effectiveness, political stability, rule of law | World Bank Indicators | Governance: 28th percentile |
| 🏦 Cross-border capital flows, financial integration signals | OECD Statistics | Capital outflow: -$4.2B flagged |
| 🔗 Bilateral trade flows, partner network, HHI concentration | UN COMTRADE | 34 partners, HHI: 3,200 — concentrated |
| 💱 Real-time FX rates, depreciation percentage change | Exchange Rate Tracker | USD/TRY: +18.3% change signal |
| 📉 Historical FX volatility series, crisis pattern matching | Exchange Rate History | 12 volatile moves in 90 days |
| 🇺🇸 US Treasury 10Y spread, global interest rate environment | FRED Economic Data | GS10: 4.8%, spread: 5.4% |
| 🌍 Natural disaster alerts, severity classification | GDACS Disaster Alerts | 3 alerts, 2 ORANGE severity |
| ⚠️ Composite sovereign risk score and verdict | 4-model scoring engine | Score: 38, Verdict: HIGH_YIELD |
| 📋 All calibrated signals and actionable recommendations | All 8 sources combined | 10 signals, 3 portfolio recommendations |
Why use Sovereign Debt Contagion MCP Server?
Sovereign credit analysis traditionally requires a team pulling data from IMF portals, World Bank APIs, COMTRADE, and FRED, then manually computing debt sustainability metrics, trade concentration indices, and FX volatility signals. That process takes hours per country, produces inconsistent outputs across analysts, and costs tens of thousands of dollars annually in Bloomberg Terminal or Moody's CreditView subscriptions.
This server automates the entire process. Provide a country name, and it runs up to 8 data sources in parallel, applies four validated scoring models, and returns a structured verdict through your existing AI client — accessible without writing a single line of code after setup.
- Scheduling — Run weekly sovereign stress sweeps across your portfolio via Apify Scheduler to surface emerging risks before they reach the newswires
- API access — Trigger assessments from Python, JavaScript, or any HTTP client using the Apify API with full JSON output
- Proxy rotation — All underlying data collection uses Apify's proxy infrastructure for reliable access to international data portals
- Monitoring — Set up Slack or email alerts via Apify webhooks when sovereign stress scores exceed defined thresholds
- Integrations — Connect output to Zapier, Make, Google Sheets, or webhooks for downstream portfolio monitoring workflows
Features
- Four independent scoring models — Sovereign Stress Index, Contagion Network Graph, Currency Crisis Probability, and Disaster-Fiscal Vulnerability each produce a 0-100 score and a labeled severity tier (e.g., STABLE, ELEVATED, DISTRESSED, CRISIS)
- Composite sovereign risk verdict — Weighted composite formula (35% sovereign stress + 25% currency crisis + 20% contagion + 20% disaster) produces a single INVESTMENT_GRADE / SPECULATIVE / HIGH_YIELD / DISTRESSED / DEFAULT_RISK credit quality reading
- Crisis override logic — When both sovereign stress and currency crisis simultaneously reach CRISIS level, the verdict is forced to DEFAULT_RISK regardless of other sub-scores, preventing composite averaging from masking acute twin crises
- HHI trade concentration scoring — UN COMTRADE bilateral flows are aggregated to compute a Herfindahl-Hirschman Index; partners above 30% share are explicitly flagged as single-point contagion channels
- Historical FX volatility pattern matching — The currency crisis model builds a volatility time series from exchange rate history, counting moves exceeding 3% and 10% to identify unstable currency regimes
- Parallel 8-source data collection — All actor calls run concurrently via Promise.all, cutting total latency to the slowest single source rather than summing all sources sequentially
- Graceful partial results — Failed or empty data sources return empty arrays rather than crashing the scoring pipeline; missing data scores conservatively (zero points) rather than inflating risk
- Spending limit enforcement — Every tool call checks Actor.charge() before firing data collection and returns a structured error object rather than partially completing if a budget ceiling is hit
- 7 distinct MCP tools — Each risk dimension is callable independently; regional_contagion_scenario runs all 8 sources and returns all four dimensions plus the composite verdict in one call at the same price
- Calibrated signal text — Each scoring model emits human-readable signals (e.g., "Trade HHI 3,200 — concentrated trade dependency") bundled into allSignals for analyst review
- MCP Standby mode — Runs persistently on Apify's infrastructure, eliminating cold-start delays between sequential country queries in the same session
Use cases for sovereign debt contagion analysis
Sovereign credit research
Fixed income analysts and credit teams at asset managers use this server to generate quantified stress scores as a complement to traditional rating agency outputs. Because the server pulls leading indicators from IMF and FRED in near real time, it can flag fiscal deterioration months before a formal rating action. Run a weekly stress sweep across your sovereign bond portfolio to surface WATCH or ELEVATED signals before they become DISTRESSED.
Emerging market currency risk management
FX traders and EM fund managers use currency_crisis_probability to monitor currencies continuously. The tool combines current depreciation signals with historical volatility pattern matching against known crisis precursors. When the score exceeds 50 and reserve cover falls below 3 months of imports, the output explicitly recommends FX hedging or avoiding local currency bonds — actionable guidance derived directly from the data.
Trade-channel contagion mapping
Portfolio managers with cross-border exposure use contagion_network_analysis to understand how a sovereign crisis in one country would transmit to its trading partners. The HHI concentration score identifies which countries are most vulnerable to a single-partner default cascade — particularly relevant for EM portfolios with concentrated regional exposure to Turkey, Argentina, or Sub-Saharan frontier markets.
Development finance lending assessment
Multilateral development banks and bilateral lenders use fiscal_headroom_analysis to assess how much additional sovereign debt a country can absorb before crossing stress thresholds. The tool draws on IMF debt sustainability metrics alongside OECD fiscal statistics to produce a headroom score with specific deficit and debt signals.
Disaster-fiscal compound risk analysis
Climate finance teams and catastrophe bond issuers use disaster_fiscal_vulnerability to identify countries where natural hazard exposure compounds fiscal weakness. Small island developing states with high GDACS alert frequency and limited fiscal reserves face compounding risk where a single disaster event can trigger a debt restructuring. The tool scores this interaction explicitly from live GDACS data.
Regional contagion scenario planning
Chief investment officers and macro strategists use regional_contagion_scenario to run full regional stress tests. Provide a country and optional regional context; the server queries all 8 sources and returns a complete report with all four risk dimensions, all signals, and portfolio recommendations. Use for quarterly scenario planning or in response to a specific macro event.
How to use sovereign debt contagion analysis
1. Connect the MCP server to your AI client — Add the server URL https://sovereign-debt-contagion-mcp.apify.actor/mcp to your Claude Desktop, Cursor, or Windsurf config with your Apify API token in the Authorization: Bearer header (see connection examples below).
2. Ask a question in natural language — Type "Assess sovereign stress for Argentina" or "Run a full contagion scenario for Turkey" into your AI client. The client calls the appropriate tool automatically.
3. The server runs up to 8 data sources in parallel — Depending on the tool, it queries IMF, World Bank, UN COMTRADE, FRED, exchange rate feeds, and GDACS simultaneously. Expect 15-60 seconds depending on data availability for the country.
4. Review the structured output — Your AI client presents a JSON result with a numeric score (0-100), a labeled verdict, calibrated signals, and specific portfolio recommendations for each risk dimension.
MCP tools
| Tool | Price | Data Sources | Description |
|------|-------|--------------|-------------|
| sovereign_stress_assessment | $0.045 | IMF, World Bank, FRED | Sovereign Stress Index (0-100): debt-to-GDP, inflation, governance score, interest rate environment |
| contagion_network_analysis | $0.045 | UN COMTRADE, OECD | Trade-channel contagion transmission, HHI concentration, cross-border financial integration |
| currency_crisis_probability | $0.045 | Exchange Rate Tracker, Exchange Rate History, IMF | Currency crisis probability from current depreciation, historical FX volatility, reserve adequacy |
| fiscal_headroom_analysis | $0.045 | IMF, OECD, FRED | Debt capacity, deficit trends, interest burden, and remaining policy space |
| disaster_fiscal_vulnerability | $0.045 | GDACS, IMF, World Bank | Natural hazard exposure vs fiscal buffer strength; compound vulnerability scoring |
| compare_sovereign_risks | $0.045 | IMF, UN COMTRADE, Exchange Rate Tracker, GDACS | Multi-country comparison with composite scoring, per-dimension labels, and relative verdict |
| regional_contagion_scenario | $0.045 | All 8 sources | Full sovereign risk report: INVESTMENT_GRADE to DEFAULT_RISK with all four dimensions plus recommendations |
Tool parameters
| Parameter | Tool(s) | Type | Required | Description |
|-----------|---------|------|----------|-------------|
| country | All tools | string | Yes | Country name or ISO code (e.g., "Turkey", "TUR", "Argentina") |
| period | sovereign_stress_assessment | string | No | Analysis period (e.g., "2024", "last 5 years") |
| currency | currency_crisis_probability | string | No | Explicit currency pair override (e.g., "USD/TRY") |
| benchmark | compare_sovereign_risks | string | No | Benchmark country for relative comparison (e.g., "Brazil") |
| region | regional_contagion_scenario | string | No | Regional context for trade network query (e.g., "Latin America") |
Input tips
- Use full country names for best results — "Argentina" returns better IMF and World Bank data coverage than "AR" for most sources.
- Provide a currency pair for precise FX analysis — When using currency_crisis_probability, specifying currency: "USD/TRY" targets the exchange rate feed more accurately than country name alone, especially for EM currencies with non-standard identifiers.
- Use regional_contagion_scenario for comprehensive assessments — At the same $0.045 price as individual tools, it runs all 8 sources and returns all four scoring dimensions in one call.
- Pass a region argument for contagion modeling — For regional_contagion_scenario, setting region: "Sub-Saharan Africa" alongside country: "Kenya" broadens the UN COMTRADE query to capture regional transmission channels.
- Set a run spending limit for batch workflows — For sweeps across large country sets, configure a maximum cost per run in Apify console to prevent unexpected charges.
Output example
{
"country": "Argentina",
"compositeScore": 22,
"verdict": "DISTRESSED",
"sovereignStress": {
"score": 74,
"debtIndicators": 9,
"inflationSignals": 8,
"stressLevel": "DISTRESSED",
"signals": [
"Multiple debt distress indicators — elevated sovereign risk",
"High inflation indicators — debt erosion and social pressure",
"Elevated interest rate environment — refinancing risk"
]
},
"contagion": {
"score": 52,
"tradeLinks": 24,
"concentratedPartners": 1,
"contagionLevel": "MODERATE",
"signals": [
"24 trade partners — dense trade network (contagion transmission channels)",
"Trade HHI 2800 — concentrated trade dependency",
"Top partner controls 38% of trade — contagion channel"
]
},
"currencyCrisis": {
"score": 68,
"volatility": 11,
"depreciationSignals": 7,
"crisisLevel": "SEVERE",
"signals": [
"Significant currency depreciation — balance of payments stress",
"11 volatile moves — unstable currency pattern",
"Low reserve cover and/or current account deficit — currency defense limited"
]
},
"disasterFiscal": {
"score": 34,
"disasterExposure": 4,
"fiscalBufferWeakness": 6,
"vulnerabilityLevel": "MODERATE",
"signals": [
"Weak fiscal buffers — limited capacity to absorb disaster shocks"
]
},
"allSignals": [
"Multiple debt distress indicators — elevated sovereign risk",
"High inflation indicators — debt erosion and social pressure",
"Elevated interest rate environment — refinancing risk",
"24 trade partners — dense trade network (contagion transmission channels)",
"Trade HHI 2800 — concentrated trade dependency",
"Top partner controls 38% of trade — contagion channel",
"Significant currency depreciation — balance of payments stress",
"11 volatile moves — unstable currency pattern",
"Low reserve cover and/or current account deficit — currency defense limited",
"Weak fiscal buffers — limited capacity to absorb disaster shocks"
],
"recommendations": [
"Elevated sovereign stress — reduce exposure or hedge",
"Currency crisis risk — consider FX hedging or local currency bond avoidance",
"High sovereign risk — require credit default swap protection"
]
}
Output fields
| Field | Type | Description |
|-------|------|-------------|
| country | string | Country name as provided in the query |
| compositeScore | number (0-100) | Composite credit quality score; higher = less risky (inverted from raw risk score) |
| verdict | string | INVESTMENT_GRADE / SPECULATIVE / HIGH_YIELD / DISTRESSED / DEFAULT_RISK |
| sovereignStress.score | number (0-100) | Sovereign Stress Index; higher = more fiscal stress |
| sovereignStress.debtIndicators | number | Count of debt distress signals fired from IMF data |
| sovereignStress.inflationSignals | number | Count of inflation stress signals fired |
| sovereignStress.stressLevel | string | STABLE / WATCH / ELEVATED / DISTRESSED / CRISIS |
| sovereignStress.signals | string[] | Human-readable signal descriptions from stress model |
| contagion.score | number (0-100) | Contagion network risk score; higher = more transmission risk |
| contagion.tradeLinks | number | Distinct trade partners identified in COMTRADE data |
| contagion.concentratedPartners | number | Partners flagged above HHI concentration threshold |
| contagion.contagionLevel | string | ISOLATED / LOW / MODERATE / HIGH / SYSTEMIC |
| currencyCrisis.score | number (0-100) | Currency crisis probability score |
| currencyCrisis.volatility | number | Count of volatile FX moves above the 3% threshold |
| currencyCrisis.depreciationSignals | number | Count of current depreciation signals from live rate data |
| currencyCrisis.crisisLevel | string | STABLE / MILD_PRESSURE / MODERATE_STRESS / SEVERE / CRISIS |
| disasterFiscal.score | number (0-100) | Disaster-fiscal compound vulnerability score |
| disasterFiscal.disasterExposure | number | Total GDACS alerts returned for the country |
| disasterFiscal.fiscalBufferWeakness | number | Fiscal buffer weakness signal count from IMF data |
| disasterFiscal.vulnerabilityLevel | string | RESILIENT / LOW / MODERATE / VULNERABLE / CRITICALLY_EXPOSED |
| allSignals | string[] | All signals from all four models combined into one array |
| recommendations | string[] | Actionable portfolio recommendations derived from scores |
How much does it cost to run sovereign debt contagion analysis?
This MCP server uses pay-per-event pricing — you pay $0.045 per tool call. Platform compute costs are included. All 7 tools are priced identically, including regional_contagion_scenario which runs all 8 underlying data sources in one call.
| Scenario | Tool calls | Cost per call | Total cost |
|----------|-----------|---------------|------------|
| Quick country check | 1 | $0.045 | $0.045 |
| Stress assessment + currency pair | 2 | $0.045 | $0.090 |
| Full 4-dimension country assessment | 4 | $0.045 | $0.180 |
| Monthly monitoring sweep, 10 countries | 10 | $0.045 | $0.45 |
| Weekly portfolio sweep, 50 countries | 50 | $0.045 | $2.25 |
You can set a maximum spending limit per run to control costs. The server stops when your budget is reached and returns a structured error rather than a partial result.
Compare this to Bloomberg Terminal sovereign risk modules at $24,000+/year or Moody's CreditView at $15,000-50,000/year. Most analyst workflows using this server cost under $5/month with no subscription commitment.
How to connect this MCP server
Claude Desktop
Add to your claude_desktop_config.json:
{
"mcpServers": {
"sovereign-debt-contagion": {
"url": "https://sovereign-debt-contagion-mcp.apify.actor/mcp",
"headers": {
"Authorization": "Bearer YOUR_APIFY_TOKEN"
}
}
}
}
Cursor / Windsurf / Cline
Add the same URL and authorization header in your IDE's MCP server configuration panel. The server uses the standard MCP Streamable HTTP transport and is compatible with any MCP client that supports remote servers.
Python
```python
from apify_client import ApifyClient
client = ApifyClient("YOUR_API_TOKEN")
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



