Sovereign Debt Crisis
About
Sovereign debt crisis modeling for AI agents and LLM workflows — this MCP server delivers eight academically-grounded simulation tools spanning default dynamics, contagion networks, fiscal sustainability, restructuring design, speculative attacks, and political regime transitions
Details
- Author
- apifyforge
- Downloads
- 107
- Categories
- Other
Jump to
- Eaton‑Gersovitz value function iteration for endogenous default thresholds
- Eisenberg‑Noe clearing with CDS circularity for bank‑sovereign networks
- Hansen panel threshold regression for fiscal sustainability breakpoints
- Myerson mechanism design with Nash‑Rubinstein bargaining for restructuring
- Morris‑Shin global games resolving speculative attack multiple equilibria
- MIDAS regression with Almon polynomial lags for multi‑frequency forecasting
- 5‑minute in‑memory network cache per session
- 15 integrated live data actors (IMF, World Bank, FRED, OECD, etc.)
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 CrisisCommand (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://sovereign-debt-crisis-mcp.apify.actor/mcp?token=YOUR_APIFY_TOKEN) to your MCP client configuration (Claude Desktop, Cursor, Windsurf, or any MCP‑compatible client). No coding is required—after authentication you can query in plain language (e.g., “model default risk for Turkey”) and the server handles data fetching and computation.
Claude Desktop / Cursor
Paste into your MCP client config file to install this server.
{
"mcpServers": {
"sovereign debt crisis": {
"sovereign-debt-crisis-mcp": {
"url": "https://ryanclinton--sovereign-debt-crisis-mcp.apify.actor/mcp"
}
}
}
}
McpServers
{
"sovereign-debt-crisis-mcp": {
"url": "https://ryanclinton--sovereign-debt-crisis-mcp.apify.actor/mcp"
}
}
Sovereign Debt Crisis MCP Server
> View on ApifyForge | Use on Apify Store
---
Quick Start
Add to your MCP client (Claude Desktop, Cursor, Windsurf):
{
"mcpServers": {
"sovereign-debt-crisis-mcp": {
"url": "https://ryanclinton--sovereign-debt-crisis-mcp.apify.actor/mcp"
}
}
}
---
Sovereign debt crisis modeling for AI agents and LLM workflows — this MCP server delivers eight academically-grounded simulation tools spanning default dynamics, contagion networks, fiscal sustainability, restructuring design, speculative attacks, and political regime transitions. Connect any MCP-compatible client and ask questions like "model Argentina's default risk" or "design optimal haircuts for a Greek-style restructuring" and receive structured quantitative output in seconds.
The server pulls live data from 15 sources across five categories — macroeconomic databases (IMF, World Bank, FRED, BLS, OECD, Eurostat), bilateral trade flows (UN COMTRADE, World Bank Projects), exchange rates (current, historical, ECB), regulatory feeds (Federal Register, Congress Bills), and geopolitical intelligence (OpenSanctions, REST Countries) — then assembles a sovereign debt network that all eight tools operate against. A 5-minute in-memory cache means multi-tool analysis sessions reuse the same network without redundant data fetches.
⬇️ What data can you access?
| Data Point | Source | Example |
|---|---|---|
| 📊 Fiscal indicators (debt/GDP, primary balance, credit rating) | IMF, World Bank | Debt/GDP: 138%, primary balance: −3.2% GDP |
| 📈 Macroeconomic series (GDP growth, CPI, interest rates) | FRED, BLS, OECD | 10Y yield: 4.85%, CPI: 3.2% |
| 🌍 EU economic and social statistics | Eurostat | Eurozone deficit: −3.6% GDP |
| 🔗 Bilateral trade flow volumes | UN COMTRADE | Exports: $42.1B, imports: $67.3B |
| 🏗️ Development project portfolios | World Bank Projects | 147 active projects, $18.4B committed |
| 💱 Live and historical FX rates | Exchange Rate Tracker, History, ECB | EUR/USD: 1.0842, USD/TRY: 32.14 |
| 📜 Regulatory and legislative signals | Federal Register, Congress Bills | 23 relevant rulings, 4 pending bills |
| 🚨 Sanctions lists and PEP data | OpenSanctions | 14 sanctioned entities linked to sovereign |
| 🌐 Country profiles and regional metadata | REST Countries | 195 country profiles, regional alliances |
| 🏦 Sovereign CDS spreads (simulated high-frequency) | Derived from macro data | 5Y CDS: 342bps (BB-rated) |
| ⚖️ Bank-sovereign lending exposures | Derived from network edges | EUR 84B net cross-border exposure |
| 🗳️ Political regime classifications | Acemoglu-Robinson framework | Regime: hybrid, Gini: 0.43 |
| 📉 Default probability state-space profiles | Eaton-Gersovitz VFI | Default threshold: 82% debt/GDP |
| 🔄 Clearing payment cascades | Eisenberg-Noe + CDS | Systemic loss: $12.4B, recovery: 0.78 |
| 🗓️ Multi-frequency sovereign risk forecasts | MIDAS regression | Q+1 forecast: 2.1%, Q+4: 1.4% GDP growth |
❓ Why use the Sovereign Debt Crisis MCP Server?
Sovereign risk analysis currently requires a PhD-level understanding of econometric models, access to a Bloomberg terminal, and a team of quant analysts to run the computations. A single restructuring scenario model in a typical advisory firm takes weeks and costs tens of thousands of dollars in analyst time.
This MCP server changes that. Ask your AI agent to model sovereign default dynamics and it calls simulate_sovereign_default, running Eaton-Gersovitz value function iteration across a 50×40 state space grid, pulling live IMF and World Bank data, and returning the endogenous default threshold and equilibrium spread — all in a single tool call.
- Always-on data — the server fetches live data from 15 sources on every session, so analysis reflects current macroeconomic conditions
- API access — call tools from Claude Desktop, Cursor, Windsurf, or any MCP client with a single config line
- Parallel data fetching — all 15 actors are called with Promise.all for maximum throughput
- Spending limits — every tool call checks Actor.charge() and stops cleanly if your budget is reached
- Composable — run all eight tools in sequence for comprehensive sovereign risk assessment, or call individual tools for targeted analysis
Features
- Eaton-Gersovitz (1981) value function iteration — iterates on the 50-point debt grid × 40-point income grid (Tauchen-discretized AR(1) with ρ=0.945, σ=0.025) until convergence at tolerance 1e-5, yielding endogenous default thresholds, bond price schedules, and optimal borrowing policy functions
- Eisenberg-Noe (2001) clearing with CDS circularity — computes clearing payment vectors in bank-sovereign networks using Scarf-type damped fixed-point iteration (damping factor 0.7, tolerance 1e-6, up to 500 iterations) that handles the non-monotone mapping created by CDS cross-holdings
- Hansen (1999) panel threshold regression — grid-searches over the trimmed (15%–85%) empirical debt distribution to find the debt/GDP breakpoint that minimizes sum of squared residuals; validates significance with 200-iteration bootstrap inference
- Myerson (1981) mechanism design + Nash-Rubinstein bargaining — applies revelation principle with incentive compatibility and individual rationality constraints to derive optimal haircut schedules; combines with alternating-offers equilibrium (δ_d=0.92, δ_c=0.88) to compute debtor/creditor surplus division
- Morris-Shin (2003) global games — finds unique switching equilibrium θ via fixed-point iteration on the indifference condition with private signal noise σ=0.1 (precision τ=100), resolving the Obstfeld (1996) multiple equilibria problem for speculative attack models
- Lee-Mykland (2008) non-parametric jump detection — computes local bipower variation over rolling window K=√n, standardizes via Gumbel asymptotics (C_n, S_n constants), and flags jumps at p<0.05 across up to 8 sovereign spread time series simultaneously
- MIDAS regression with Almon polynomials (Ghysels et al. 2004) — grid-searches (θ₁, θ₂) parameter space for optimal exponential Almon lag weighting that mixes daily CDS spreads with quarterly GDP, forecasts at Q+1, Q+2, Q+4, Q+8 horizons with 95% confidence intervals
- Acemoglu-Robinson (2006) political transitions — estimates 3-state Markov transition matrix (democratic / hybrid / authoritarian) from inequality-derived Gini estimates, solves stationary distribution via 200-iteration power iteration, classifies regimes by AR phase (Revolutionary Threat / Elite Consolidation / Democratization Pressure / Stable Equilibrium)
- 5-minute network cache — builds sovereign debt network once per session from macro, trade, FX, regulatory, and geopolitical data; subsequent tool calls within the TTL window reuse cached network at zero additional data cost
- Selective source filtering — each tool call accepts a sources array to restrict data fetching to relevant categories (macro, trade, fx, regulatory, geopolitical), reducing latency for targeted queries
- 15 integrated data actors — IMF, World Bank, FRED, BLS, OECD, Eurostat, UN COMTRADE, World Bank Projects, Exchange Rate Tracker, Exchange Rate History, ECB Rates, Federal Register, Congress Bills, OpenSanctions, REST Countries
Use cases for sovereign debt crisis modeling
Sovereign default risk assessment
Fixed income analysts and sovereign credit teams need to model endogenous default thresholds before taking positions in emerging market debt. Usesimulate_sovereign_default with a country query to run value function iteration against live IMF and World Bank debt/GDP data, returning the exact debt level at which the sovereign optimally chooses default over repayment and the corresponding equilibrium spread in basis points.
Bank-sovereign doom loop analysis
European bank stress testers and financial stability researchers need to model how sovereign distress propagates through the banking system. Usecompute_clearing_contagion to run Eisenberg-Noe clearing with CDS circularity across the bank-sovereign exposure network, quantifying systemic loss, recovery rates, and the amplification effect of cross-border CDS positions.
Fiscal sustainability regime detection
IMF program designers, budget offices, and EM macro funds need to identify whether a country's current debt trajectory crosses into an unsustainable regime. Useestimate_fiscal_sustainability to run Hansen threshold regression over the panel dataset, locating the debt/GDP breakpoint with bootstrap confidence intervals and classifying each country in the network as sustainable, vulnerable, or unsustainable.
Debt restructuring design and negotiation
Sovereign advisory teams, distressed debt funds, and official creditor working groups preparing restructuring proposals need to model haircut schedules that balance creditor participation against debtor sustainability. Usedesign_optimal_restructuring to compute Myerson-IC restructuring terms and Nash-Rubinstein bargaining outcomes, including aggregate haircut, participation rates, and holdout risk scores.
Currency peg defense and speculative attack modeling
FX strategists and central bank reserve managers need to know whether a currency peg is defensible against coordinated speculative pressure. Usemodel_speculative_attack to compute the Morris-Shin switching equilibrium θ, the critical reserves level, and the attack probability given current CDS spreads — with a unique equilibrium guaranteed by incomplete information.
Nowcasting and multi-frequency sovereign risk forecasting
Macro research desks and risk managers need to incorporate high-frequency signals (daily CDS moves) into quarterly sovereign risk forecasts without lag aggregation bias. Useforecast_multi_frequency to fit MIDAS regression with optimal Almon exponential lag weights, producing GDP growth forecasts at Q+1 through Q+8 with confidence intervals and a regime-switching probability flag.
Political transition risk assessment
Country risk teams, political risk insurers, and geopolitical analysts need to quantify how inequality dynamics translate into regime transition probabilities. Useassess_political_transition_risk to run Acemoglu-Robinson framework analysis, returning Markov transition matrices, stationary regime distributions, expected regime duration, and the Gini trigger level for democratization or coup risk.
How to connect the Sovereign Debt Crisis MCP Server
No coding required. Add the server URL to your MCP client config and start querying in plain language.
1. Copy the server URL — https://sovereign-debt-crisis-mcp.apify.actor/mcp
2. Add to your MCP client — paste the config snippet below into Claude Desktop, Cursor, or Windsurf (see examples)
3. Authenticate — include your Apify API token in the URL or Authorization header (see Authentication section)
4. Start querying — ask your AI agent "model default risk for Turkey" or "run fiscal sustainability analysis for southern Europe" and the server handles data fetching and computation
Claude Desktop
Add to ~/Library/Application Support/Claude/claude_desktop_config.json (macOS) or %APPDATA%\Claude\claude_desktop_config.json (Windows):
{
"mcpServers": {
"sovereign-debt-crisis": {
"url": "https://sovereign-debt-crisis-mcp.apify.actor/mcp?token=YOUR_APIFY_TOKEN"
}
}
}
Cursor
Add to your Cursor MCP settings (Settings → MCP → Add Server):
{
"mcpServers": {
"sovereign-debt-crisis": {
"url": "https://sovereign-debt-crisis-mcp.apify.actor/mcp?token=YOUR_APIFY_TOKEN"
}
}
}
Windsurf / Continue / any MCP client
{
"mcpServers": {
"sovereign-debt-crisis": {
"url": "https://sovereign-debt-crisis-mcp.apify.actor/mcp?token=YOUR_APIFY_TOKEN"
}
}
}
Replace YOUR_APIFY_TOKEN with your token from Apify Console → Settings → Integrations.
MCP tools
| Tool | Model | Description |
|------|-------|-------------|
| simulate_sovereign_default | Eaton-Gersovitz (1981) | Value function iteration on 50×40 (debt, income) state space. Returns default threshold, equilibrium spread, bond price schedule, and optimal borrowing policy function. |
| compute_clearing_contagion | Eisenberg-Noe (2001) + CDS | Scarf-type damped fixed-point finds clearing payments in bank-sovereign network with CDS circularity. Returns systemic loss, defaulted entities, contagion rounds, and recovery rates. |
| estimate_fiscal_sustainability | Hansen (1999) | Panel threshold regression with 200-bootstrap inference. Returns debt/GDP breakpoint, regime classifications, interest-growth differential (r−g), and adjustment paths. |
| design_optimal_restructuring | Myerson (1981) + Rubinstein (1982) | IC-constrained mechanism design + alternating-offers bargaining. Returns per-instrument haircuts, Nash surplus division, holdout risk, and debt sustainability flag. |
| model_speculative_attack | Morris-Shin (2003) | Global games fixed-point finds unique switching equilibrium θ. Returns attack probability, reserves depletion, devaluation magnitude, and speculator/central bank payoffs. |
| detect_crisis_jumps | Lee-Mykland (2008) | Bipower variation + Gumbel asymptotics detect jumps across up to 8 spread series. Returns jump events, intensity λ, clustering coefficient, and critical threshold. |
| forecast_multi_frequency | MIDAS / Ghysels et al. (2004) | Almon exponential lag polynomials mix daily CDS with quarterly GDP. Returns Q+1/Q+2/Q+4/Q+8 forecasts with 95% CIs, MIDAS R², and regime-switching probability. |
| assess_political_transition_risk | Acemoglu-Robinson (2006) | Markov switching between 3 political regimes driven by inequality thresholds. Returns transition matrix, stationary distribution, AR phase, and fiscal impact per regime. |
Tool input parameters
Each tool accepts the same two parameters:
| Parameter | Type | Required | Description |
|-----------|------|----------|-------------|
| query | string | Yes | Country, sovereign debt scenario, or policy topic to analyze. Examples: "Argentina sovereign debt", "Euro area fiscal sustainability", "Turkish lira speculative attack" |
| sources | array of strings | No | Data source categories to include. Options: "macro", "trade", "fx", "regulatory", "geopolitical". Defaults to all five categories if omitted. |
Source category reference
| Source category | Actors called | Data type |
|-----------------|---------------|-----------|
| macro | IMF, World Bank, FRED, BLS, OECD, Eurostat | Fiscal indicators, GDP, inflation, employment |
| trade | UN COMTRADE, World Bank Projects | Bilateral trade flows, development portfolios |
| fx | Exchange Rate Tracker, Exchange Rate History, ECB Rates | Current and historical FX rates |
| regulatory | Federal Register, Congress Bills | US regulatory and legislative signals |
| geopolitical | OpenSanctions, REST Countries | Sanctions exposure, country metadata |
Example tool calls
Full sovereign default simulation:
{
"query": "Argentina sovereign debt default risk 2024",
"sources": ["macro", "fx", "geopolitical"]
}
Targeted fiscal sustainability check (macro only, faster):
{
"query": "Italy fiscal sustainability debt-to-GDP",
"sources": ["macro"]
}
Bank contagion with trade linkages:
{
"query": "European bank sovereign doom loop exposure",
"sources": ["macro", "trade", "fx"]
}
Output examples
simulate_sovereign_default output
{
"states": [
{
"debt": 0.0,
"income": 1.002,
"value": -4.821,
"defaultValue": -5.103,
"defaultProbability": 0.0,
"bondPrice": 0.9697,
"optimalBorrowing": 0.163
},
{
"debt": 0.612,
"income": 1.002,
"value": -5.447,
"defaultValue": -5.103,
"defaultProbability": 1.0,
"bondPrice": 0.8241,
"optimalBorrowing": 0.0
}
],
"defaultThreshold": 87.3,
"equilibriumSpread": 412.7,
"debtLimit": 100.0,
"outputCostOfDefault": 2.0,
"reentryProbability": 0.282,
"policyFunction": [
{ "debt": 0.0, "income": 0.933, "borrow": 0.102 },
{ "debt": 0.0, "income": 1.002, "borrow": 0.163 },
{ "debt": 0.306, "income": 1.002, "borrow": 0.306 },
{ "debt": 0.612, "income": 1.002, "borrow": 0.0 }
]
}
compute_clearing_contagion output
{
"payments": [
{
"bank": "Turkey Banking Sector",
"promised": 847.2,
"actual": 661.3,
"shortfall": 185.9,
"recovery": 0.781
},
{
"bank": "Turkish Sovereign",
"promised": 1203.4,
"actual": 1138.7,
"shortfall": 64.7,
"recovery": 0.946
}
],
"systemicLoss": 312.4,
"defaultedEntities": ["Turkey Banking Sector", "Halkbank"],
"contagionRounds": 8,
"cdsCircularityEffect": 46.9,
"fixedPointIterations": 127,
"largestExposure": {
"from": "European Central Counterparty",
"to": "Turkish Sovereign",
"amount": 584.0
}
}
model_speculative_attack output
{
"equilibrium": {
"fundamentalThreshold": 0.423,
"signalPrecision": 100.0,
"reservesCritical": 423.0,
"attackProbability": 0.3871,
"pegSurvivalProbability": 0.6129,
"uniqueEquilibrium": true
},
"reservesDepleted": 38.71,
"devaluationMagnitude": 28.84,
"speculatorPayoff": 0.0614,
"centralBankLoss": 48.9,
"multipleEquilibria": false,
"morrisShinThreshold": 0.423
}
assess_political_transition_risk output
{
"regimes": [
{
"country": "Brazil",
"currentRegime": "hybrid",
"eliteStrength": 0.441,
"populistPressure": 0.617,
"giniThreshold": 0.42,
"transitionProbability": 0.0821,
"fiscalImpact": -1.34
}
],
"markovTransitionMatrix": [
[0.8700, 0.1200, 0.0100],
[0.2500, 0.5000, 0.2500],
[0.0800, 0.1700, 0.7500]
],
"stationaryDistribution": [0.4312, 0.2891, 0.2797],
"expectedRegimeDuration": 6.84,
"giniTriggerLevel": 0.428,
"acemogluRobinsonPhase": "Democratization Pressure",
"democratizationProbability": 0.0614
}
Output fields reference
simulate_sovereign_default
| Field | Type | Description |
|-------|------|-------------|
| states[] | array | State-space grid values at median income |
| states[].debt | number | Debt/GDP ratio (0–1 scale) |
| states[].value | number | Continuation value V_c(b,y) from VFI |
| states[].defaultProbability | number | 1.0 if optimal to default at this state |
| states[].bondPrice | number | Equilibrium bond price q(b',y) |
| defaultThreshold | number | Debt/GDP % above which default is optimal |
| equilibriumSpread | number | Bond spread in basis points at threshold |
| debtLimit | number | Maximum sustainable debt/GDP % |
| outputCostOfDefault | number | Output loss upon default (% of GDP) |
| reentryProbability | number | θ = 0.282 probability of capital market re-entry per period |
| policyFunction[] | array | Optimal borrowing b' as function of (b, y) |
compute_clearing_contagion
| Field | Type | Description |
|-------|------|-------------|
| payments[].bank | string | Entity name |
| payments[].promised | number | Total liabilities (million USD) |
| payments[].actual | number | Actual clearing payment after iteration |
| payments[].shortfall | number | Promised minus actual (million USD) |
| payments[].recovery | number | Recovery rate (0–1, cents on dollar) |
| systemicLoss | number | Total shortfall across network (million USD) |
| defaultedEntities | array | Entities with recovery < 0.95 |
| contagionRounds | number | Fixed-point iterations until convergence |
| cdsCircularityEffect | number | Additional loss attributable to CDS circularity |
| largestExposure | object | Largest bilateral exposure in network |
estimate_fiscal_sustainability
| Field | Type | Description |
|-------|------|-------------|
| regimes[].regime | string | sustainable, vulnerable, or unsustainable |
| regimes[].thresholdEstimate | number | Hansen panel threshold (debt/GDP %) |
| regimes[].adjustmentNeeded | number | Fiscal adjustment required (% of GDP) |
| regimes[].confidenceInterval | array | Bootstrap 90% CI on threshold |
| panelThreshold | number | Estimated debt/GDP threshold |
| bootstrapPValue | number | Bootstrap p-value for threshold significance |
| interestGrowthDifferential | number | r−g (positive = unstable debt dynamics) |
| debtDynamicsStable | boolean | True if r < g |
design_optimal_restructuring
| Field | Type | Description |
|-------|------|-------------|
| terms[].haircut | number | NPV loss % on instrument |
| terms[].participationRate | number | Expected creditor participation (0–1) |
| aggregateHaircut | number | Average haircut across all instruments |
| nashBargainingSolution | object | Debtor and creditor surplus shares |
| rubinsteinEquilibrium | object | First-mover advantage and discount factor |
| incentiveCompatible | boolean | True if IC constraints satisfied |
| holdoutRisk | number | Fraction of creditors expected to hold out |
model_speculative_attack
| Field | Type | Description |
|-------|------|-------------|
| equilibrium.fundamentalThreshold | number | θ switching point (0–1) |
| equilibrium.attackProbability | number | Probability peg is attacked |
| equilibrium.uniqueEquilibrium | boolean | True when σ < 0.5 (finite signal noise) |
| reservesDepleted | number | Reserves consumed if attack succeeds (%) |
| devaluationMagnitude | number | Expected devaluation if peg breaks (%) |
| speculatorPayoff | number | Expected payoff per unit of attack capital |
| centralBankLoss | number | FX reserve loss in million USD |
detect_crisis_jumps
| Field | Type | Description |
|-------|------|-------------|
| jumps[].date | string | Date of detected jump event |
| jumps[].jumpSize | number | Log-return magnitude at jump |
| jumps[].testStatistic | number | Standardized Lee-Mykland statistic |
| jumps[].pValue | number | Gumbel asymptotic p-value |
| jumpIntensity | number | Annualized jump intensity λ (per year) |
| clusteringCoefficient | number | Fraction of jumps occurring within 5 days of another |
| leeMyklandThreshold | number | Critical value at 5% significance |
forecast_multi_frequency
| Field | Type | Description |
|-------|------|-------------|
| forecasts[].horizon | string | Q+1, Q+2, Q+4, Q+8 |
| forecasts[].forecast | number | Point forecast (GDP growth %) |
| forecasts[].ci95Lower | number | Lower bound of 95% confidence interval |
| forecasts[].ci95Upper | number | Upper bound of 95% confidence interval |
| forecasts[].almonWeights | array | First 10 Almon lag weights |
| midasR2 | number | In-sample MIDAS R² |
| regimeSwitchingProb | number | Probability of regime shift in recent data |
assess_political_transition_risk
| Field | Type | Description |
|-------|------|-------------|
| regimes[].currentRegime | string | democratic, hybrid, or authoritarian |
| regimes[].transitionProbability | number | Probability of regime change |
| regimes[].fiscalImpact | number | Estimated GDP impact of transition (% of GDP) |
| markovTransitionMatrix | array | 3×3 transition probability matrix |
| stationaryDistribution | array | Long-run regime probabilities [D, H, A] |
| expectedRegimeDuration | number | Weighted expected years in current regime |
| acemogluRobinsonPhase | string | AR framework phase classification |
| democratizationProbability | number | Probability of democratization for non-democratic regimes |
How much does it cost to run sovereign debt crisis models?
This MCP server uses pay-per-event pricing — you pay a fixed amount per tool call. Compute costs are included.
| Tool | Price per call |
|------|----------------|
| simulate_sovereign_default | $0.045 |
| compute_clearing_contagion | $0.045 |
| design_optimal_restructuring | $0.040 |
| model_speculative_attack | $0.040 |
| estimate_fiscal_sustainability | $0.035 |
| detect_crisis_jumps | $0.035 |
| forecast_multi_frequency | $0.035 |
| assess_political_transition_risk | $0.035 |
| Usage scenario | Tool calls | Estimated cost |
|---|---|---|
| Single tool query | 1 | $0.035–$0.045 |
| Country deep-dive (3 tools) | 3 | ~$0.12 |
| Full 8-tool analysis | 8 | ~$0.31 |
| Daily monitoring (1 country, 2 tools) | 60/month | ~$2.40/month |
| Research workflow (10 countries, all tools) | 80 | ~$3.10 |
You can set a maximum spending limit per run to control costs. The MCP server stops cleanly when your budget is reached and returns an error message rather than silent failure.
The Apify Free plan includes $5 of monthly platform credits — enough for approximately 130 tool calls per month at no cost.
How the Sovereign Debt Crisis MCP Server works
Phase 1: Multi-source data assembly
Each tool call triggers getOrBuildNetwork(), which checks for a cached SovereignDebtNetwork with a 5-minute TTL. On a cache miss, fetchSovereignData() dispatches parallel runActor() calls across up to 15 actors using Promise.all. Each upstream actor is called with the user's query string and a limit of 50 results, with a 180-second timeout and 256MB memory allocation. Results are partitioned into five typed buckets: macroData, tradeData, fxData, regulatoryData, sanctions, and countryData.
Phase 2: Sovereign debt network construction
buildSovereignDebtNetwork() assembles a typed graph of SovereignNode[] and SovereignEdge[] from raw API results. Macro and country data become sovereign nodes; FX data becomes currency nodes with currency_peg edges; trade data produces trade_flow edges weighted by volume in millions USD; sanctions data creates contagion edges; regulatory data creates institution nodes. When the network has fewer lending edges than sovereign nodes, synthetic bank nodes are generated (bank-{sovereign.id}) with lending weights derived from debt/GDP ratios and cross-border CDS edges to adjacent sovereigns.
Phase 3: Quantitative model execution
All eight models operate on the assembled SovereignDebtNetwork. The Eaton-Gersovitz solver runs up to 200 VFI iterations with CRRA utility (σ=2), discount factor β=0.953, and Tauchen-discretized income grid, converging when max |V_c_new − V_c| < 1e-5. The Eisenberg-Noe solver uses Scarf damping (α=0.7) for non-monotone CDS circularity, capping at 500 iterations. The Hansen threshold solver grid-searches 50 evenly spaced candidate values across the trimmed empirical distribution, then validates with 200 bootstrap replications. The Morris-Shin solver finds θ* by damped fixed-point iteration (0.7 new + 0.3 current), using Abramowitz-Stegun polynomial approximation for Φ. The MIDAS solver grid-searches a 7×5 (θ₁, θ₂) Almon parameter grid and selects the OLS fit with highest R², then forecasts at four horizons with horizon-scaled standard errors.
Phase 4: Pay-per-event charging and response
After model execution, each tool calls Actor.charge({ eventName }) against the pay-per-event price schedule. If eventChargeLimitReached is true, the tool returns a structured error JSON rather than throwing. Results are serialized to JSON with 2-space indentation and returned as MCP content[0].text. The health endpoint at /health exposes network cache status, node and edge counts, and the list of active source categories.
Tips for best results
1. Use targeted source arrays for faster responses. For default threshold analysis, sources: ["macro", "fx"] is sufficient and runs in roughly half the time of a full 5-source fetch. Reserve geopolitical for sanctions-sensitive queries.
2. Run the cheapest tools first for triage. Start with estimate_fiscal_sustainability ($0.035) to screen whether a country warrants deeper analysis before running simulate_sovereign_default ($0.045) or compute_clearing_contagion ($0.045).
3. Batch countries in one query string. Queries like "southern European sovereign debt Italy Spain Portugal" populate the network with multiple sovereign nodes, allowing all eight tools to return multi-country comparisons in a single call.
4. Combine detect_crisis_jumps with model_speculative_attack for early warning. Jump clustering coefficients above 0.4 indicate contagion periods where attack probability is typically elevated — run both tools and compare the jump intensity timeline against the Morris-Shin threshold.
5. Use forecast_multi_frequency before design_optimal_restructuring. The MIDAS Q+4 and Q+8 forecasts provide the growth path assumptions that determine whether Rubinstein equilibrium haircuts restore debt sustainability. Running forecast first gives context for interpreting restructuring output.
6. The 5-minute cache enables multi-tool sessions. Ask your AI agent to run all eight tools in sequence — they share the same network and only charge data-fetch overhead once. A complete 8-tool country analysis costs ~$0.31.
7. Check debtDynamicsStable from estimate_fiscal_sustainability. A false result (r > g) means the interest-growth differential is explosive — this is a strong prior for elevated defaultThreshold findings and should prompt running simulate_sovereign_default immediately.
8. Set explicit spending limits for automated workflows. When running this MCP server in scheduled AI agent pipelines, configure maxTotalChargeUsd to cap per-session costs. The server returns structured errors rather than hanging when the limit is reached.
Combine with other Apify actors
| Actor | How to combine |
|-------|---------------|
| FRED Economic Data | Pull granular US Treasury yield curves and money supply data to calibrate the risk-free rate parameter in the Eaton-Gersovitz model |
| World Bank Data Search | Fetch World Development Indicators (governance, CPIA scores) to enrich political regime classifications in the Acemoglu-Robinson tool |
| OpenSanctions Search | Pre-screen countries for active sanctions exposure before running contagion analysis — heavily sanctioned sovereigns ha
Sign in to leave a review
Use Google, GitHub, or an email account so ratings stay tied to real people.
No reviews posted yet.



