Quantum-Inspired Supply Chain MCP Server

by apifyforge

108 downloads
Not rated
GitHub Website

About

Quantum-inspired supply chain optimization delivered as an MCP server — connect Claude, Cursor, or any MCP client to 8 advanced analysis tools that pull from **17 live data sources** simultaneously.

Details

Author
apifyforge
Downloads
108
Categories
Other

- Tensor train MPS decomposition for network flow optimization
- Correlated hypergraph percolation for cascade failure simulation
- VF2 subgraph isomorphism for sanctions circumvention detection
- N-player newsvendor Bayesian game for supplier competition analysis
- Multivariate GPD climate tail risk and return period estimation
- 17 live data sources called in parallel with sub-5-minute completion

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:

  1. Download and install Highlight from highlightai.com/download
  2. Navigate to the plugins tab and select "Add Custom Plugin"
  3. Configure the plugin with the settings below
    Plugin Name Quantum-Inspired Supply Chain MCP Server
    Command (node, npx, python, etc.)

    Please refer to the README for specific instructions on how to obtain API keys or other required environment variables.

  4. Enable "Start Automatically" if you want the plugin to start when Highlight launches

From the repository

Get your Apify API token, then add a configuration entry to your MCP client (e.g., claude_desktop_config.json) using the URL https://quantum-inspired-supply-chain-mcp.apify.actor/mcp?token=YOUR_API_TOKEN. After connecting, ask your AI assistant a supply chain question (e.g., "assess the semiconductor supply chain for Taiwan and Korea") to trigger up to 17 parallel data calls and structured analysis.

Claude Desktop / Cursor

Paste into your MCP client config file to install this server.

{
    "mcpServers": {
        "quantum-inspired supply chain mcp server": {
            "quantum-inspired-supply-chain-mcp": {
                "url": "https://ryanclinton--quantum-inspired-supply-chain-mcp.apify.actor/mcp"
            }
        }
    }
}

McpServers

{
    "quantum-inspired-supply-chain-mcp": {
        "url": "https://ryanclinton--quantum-inspired-supply-chain-mcp.apify.actor/mcp"
    }
}

Quantum-Inspired Supply Chain MCP Server

> View on ApifyForge | Use on Apify Store

---

Quick Start

Add to your MCP client (Claude Desktop, Cursor, Windsurf):

{
  "mcpServers": {
    "quantum-inspired-supply-chain-mcp": {
      "url": "https://ryanclinton--quantum-inspired-supply-chain-mcp.apify.actor/mcp"
    }
  }
}

---

Quantum-inspired supply chain optimization delivered as an MCP server — connect Claude, Cursor, or any MCP client to 8 advanced analysis tools that pull from 17 live data sources simultaneously. Built for supply chain analysts, risk managers, and compliance teams who need to move beyond spreadsheet-based risk models to real algorithmic intelligence.

Each tool applies a distinct computational method: tensor train MPS decomposition for network flow optimization, correlated hypergraph percolation for cascade failure simulation, VF2 subgraph isomorphism for sanctions circumvention detection, N-player newsvendor Bayesian games for supplier competition, and multivariate Generalized Pareto Distribution fitting for climate tail risk. No coding required — ask your AI assistant and get structured results.

What data can you access?

| Data Point | Source | Example |
|---|---|---|
| 📦 Bilateral trade flows by commodity and country pair | UN COMTRADE | Semiconductor exports: Taiwan → South Korea, $42B |
| 🏛️ US government contract opportunities and awards | SAM.gov | "Advanced Composites" — 847 active solicitations |
| 💰 Federal contract spending by vendor and program | USAspending | Lockheed Martin: $12.3B in defense contracts 2024 |
| 🏢 Corporate registrations and ownership structures | OpenCorporates | Pinnacle Holdings Ltd → 3 shell subsidiaries, BVI |
| 🇬🇧 UK company filings and director relationships | UK Companies House | Nexus Logistics UK — beneficial owner: Chen Wei |
| 🔗 Legal Entity Identifiers and parent-child chains | GLEIF LEI | LEI 5493001KJTIIGC8Y1R12 → Ultimate parent: BASF SE |
| 🚫 OFAC sanctions lists and blocked persons | OFAC | VTB Bank JSC — blocked since February 2022 |
| 🌐 Global sanctions, PEP, and watchlist coverage | OpenSanctions | 2.1M+ entities across 240+ source datasets |
| 🌩️ Severe weather events and storm tracks | NOAA | Category 4 typhoon — landfall Taiwan, Sept 14 |
| 🌍 Earthquake activity, magnitudes, and epicenters | USGS Earthquake | M6.2 — 40km NW of Hualien, Taiwan |
| 🆘 Global disaster alerts and early warnings | GDACS | Red alert: Flood event, Yangtze basin |
| 🇺🇸 US emergency declarations and FEMA disaster data | FEMA | DR-4776: Flooding, Mississippi — $340M approved |
| 📈 Stock quotes, financials, and market signals | Finnhub | TSMC: $142.80, P/E 22.4, revenue $88.9B TTM |
| 💱 Foreign exchange rates and currency volatility | Exchange Rates | TWD/USD: 0.0312, 30-day volatility: 3.8% |
| ⚡ EV charging and energy infrastructure locations | OpenChargeMap | 4,200 fast-charge stations — Greater Tokyo Area |
| 📍 Geocoding and reverse geocoding | Nominatim | "Kaohsiung Port" → 22.6163°N, 120.2796°E |
| 🗺️ Points of interest and industrial facilities | OSM POI | 23 semiconductor fabs — Hsinchu Science Park |

Why use Quantum-Inspired Supply Chain MCP Server?

Manual supply chain risk assessment means pulling trade data from COMTRADE, cross-referencing sanctions lists, searching corporate registries, checking weather alerts — and doing it all in separate tabs with no way to correlate signals. That process takes a specialist analyst 2-3 days per supply chain segment and still misses the non-obvious cascade risks.

This MCP server automates all 17 data collection calls in parallel, then applies computational algorithms — tensor decomposition, graph percolation, game theory — to surface patterns no manual review could find. Your AI assistant gains the ability to answer "what happens to my semiconductor supply chain if the top 3 Taiwan suppliers fail simultaneously?" in a single tool call.

- Standby mode — the server stays warm and responds in seconds, not minutes; no cold-start delays for time-sensitive queries
- API access — trigger analysis from Python, JavaScript, or any HTTP client using the Apify API
- Spend controls — set a maximum spend limit per session so tool call costs stay within budget
- Monitoring — get Slack or email alerts when runs fail or produce unexpected results
- Integrations — connect to Zapier, Make, or custom webhooks to trigger supply chain analysis on schedule

Features

- Tensor train (MPS) decomposition — sequential SVD truncation factorizes the supply network into core matrices connected by bond dimensions, revealing latent dependencies not visible in raw trade flow data
- Multi-commodity flow optimization via LP relaxation — minimizes total cost subject to flow conservation and capacity constraints using projected gradient descent on the Lagrangian dual; identifies bottleneck edges at capacity saturation
- Correlated hypergraph percolation — models shared commodity group failures as hyperedge correlated failures rather than independent edge failures; Monte Carlo estimation of giant component fraction across 1,000 simulation runs by default
- Critical percolation threshold p_c via binary search — pinpoints the exact failure probability at which the network fragments from one connected component into many isolated islands
- VF2 subgraph isomorphism for sanctions circumvention — state space tree search with feasibility pruning matches 5 evasion pattern templates (shell company chains, nominee structures, layered ownership, jurisdiction hopping, beneficial owner concealment) against the live corporate ownership graph
- N-player newsvendor Bayesian game — Nash equilibrium computed via inverse CDF of log-normal demand using Beasley-Springer-Moro rational approximation; Monte Carlo profit simulation with demand splitting across all identified supplier players
- Price of Anarchy quantification — measures efficiency loss between Nash equilibrium total order and social optimum, showing how much supplier competition degrades supply chain performance
- Multivariate GPD climate tail risk — fits GPD parameters (xi shape, sigma scale) via method-of-moments on exceedances above threshold from 4 hazard data sources; computes tail dependence coefficient chi for co-occurrence of extreme events across locations
- 100-year return period estimation — F(x) = 1 - (1 + xix/sigma)^(-1/xi) applied to each supply node location to quantify extreme event exposure
- Algebraic connectivity (Fiedler value) resilience — computes lambda_2 of the graph Laplacian via power iteration with deflation; higher values indicate networks that require more simultaneous failures before fragmenting
- Composite resilience grade A-F — weighted formula R = 0.4
norm(lambda_2) + 0.35p_c + 0.25(1/rank) combining three independent structural measures
- MERA hierarchical coarse-graining — multi-scale entanglement renormalization identifies nodes that remain critical across multiple scales of the network hierarchy, not just locally
- Contingency routing with cost impact — reroutes flows around disrupted nodes to nearest active alternatives and computes exact cost increase percentage and infeasible demands
- 17 data sources called in parallel — all actor calls use Promise.all for sub-timeout concurrent execution; typical tool call completes in 3-5 minutes

Use cases for supply chain risk analysis

Export control and sanctions compliance

Compliance officers running export control programs need to verify that every tier of their supply chain is free of OFAC-blocked entities and sanctions circumvention structures before filing EAR/ITAR paperwork. Manual registry searches miss layered ownership. identify_sanctions_circumvention runs VF2 subgraph matching against live OFAC, OpenSanctions, OpenCorporates, GLEIF, and UK Companies House data simultaneously, returning circumvention risk scores and matched evasion pattern types with ownership chains.

Semiconductor and critical minerals supply chain mapping

Procurement teams managing critical component supply need to understand which geographic nodes carry the most concentration risk. optimize_tensor_network_flow builds the full network from UN COMTRADE bilateral flows and corporate data, runs tensor train decomposition to find latent dependencies, and solves multi-commodity flow to show which nodes are bottlenecks. A query like "rare earth neodymium China Japan" returns the full supplier-manufacturer-distributor graph with capacity and flow data.

Disruption scenario planning and business continuity

Risk managers preparing business continuity plans need to know what a Tier 1 supplier failure actually propagates to. detect_disruption_cascade takes specific trigger nodes and runs 1,000 Monte Carlo hypergraph percolation simulations to estimate how many downstream nodes fail and at what cascade depth. It identifies critical nodes whose removal causes maximum systemic damage — the information needed to prioritize redundancy investments.

Climate physical risk assessment for ESG reporting

ESG teams and insurance underwriters need quantified physical climate risk for each facility in the supply chain. assess_climate_vulnerability fits multivariate GPD to NOAA, USGS, GDACS, and FEMA exceedances at each node location and produces per-node risk tiers (LOW/MEDIUM/HIGH/CRITICAL) with 100-year return period estimates and tail dependence coefficients for correlated multi-location disaster scenarios.

Supplier negotiation and market structure analysis

Category managers entering supplier negotiations benefit from understanding the theoretical Nash equilibrium order quantities and how much supplier competition degrades supply efficiency. simulate_supplier_game identifies suppliers from trade and corporate data, computes each player's optimal order quantity under log-normal demand uncertainty, and quantifies the Price of Anarchy — the gap between competitive equilibrium and social optimum.

Infrastructure monitoring and chokepoint prioritization

Operations teams managing global logistics need a ranked list of the nodes that, if lost, would do the most damage to the overall network. monitor_critical_chokepoints combines four signals — betweenness centrality, MERA persistence across scales, cascade failure impact, and algebraic connectivity contribution — to produce a consolidated chokepoint ranking with system risk summary.

How to connect this MCP server

Step 1: Get your Apify API token

Go to Apify Console and copy your API token. You will need it in the connection URL.

Step 2: Add to your MCP client

Claude Desktop — add to claude_desktop_config.json:

{
  "mcpServers": {
    "quantum-supply-chain": {
      "url": "https://quantum-inspired-supply-chain-mcp.apify.actor/mcp?token=YOUR_API_TOKEN"
    }
  }
}

Cursor — add to your Cursor MCP settings under ~/.cursor/mcp.json:

{
  "mcpServers": {
    "quantum-supply-chain": {
      "url": "https://quantum-inspired-supply-chain-mcp.apify.actor/mcp?token=YOUR_API_TOKEN"
    }
  }
}

Windsurf / Cline / any MCP-compatible client — use the same URL pattern.

Step 3: Start a query

Ask your AI assistant: "Use the quantum supply chain server to assess the semiconductor supply chain for Taiwan and Korea — identify key chokepoints and disruption risks."

The server calls up to 17 data sources in parallel and returns structured results.

Tool reference

optimize_tensor_network_flow

Builds a supply network from all 17 data sources. Applies tensor train MPS decomposition via sequential SVD truncation to expose latent supply chain structures. Solves multi-commodity flow via LP relaxation with projected gradient descent on the Lagrangian dual.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Supply chain query, e.g. "semiconductor chips Taiwan Korea" |
| commodities | string[] | No | Specific commodities to track, e.g. ["chips", "lithium"] |
| source_nodes | string[] | No | Known supplier node names to anchor the flow problem |
| sink_nodes | string[] | No | Known destination/demand node names |

Cost: $200-300 per call. Calls 17 actors in parallel.

---

detect_disruption_cascade

Simulates cascading failures through the network using correlated random hypergraph percolation. Runs Monte Carlo estimation of giant component fraction and computes critical percolation threshold p_c via binary search.

Input parameters:

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| query | string | Yes | — | Supply chain query to build the network |
| trigger_nodes | string[] | No | First network node | Node IDs to simulate as initially disrupted |
| propagation_probability | number | No | 0.3 | Base probability of disruption propagating along an edge (0-1) |
| monte_carlo_runs | number | No | 1000 | Number of Monte Carlo cascade simulations |

Cost: $200-300 per call.

---

identify_sanctions_circumvention

Detects sanctions evasion patterns using VF2 subgraph isomorphism. Matches 5 known evasion pattern templates against the live corporate ownership graph built from OpenCorporates, UK Companies House, GLEIF LEI, OFAC, and OpenSanctions.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Entity or supply chain query for sanctions screening |
| entity_name | string | No | Specific entity name to investigate |

Cost: $150-250 per call. Calls 8 actors.

---

simulate_supplier_game

N-player newsvendor Bayesian game simulation. Computes Nash equilibrium via inverse CDF of log-normal demand with Beasley-Springer-Moro rational approximation. Monte Carlo profit simulation with demand splitting. Measures efficiency loss (Price of Anarchy).

Input parameters:

| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
| query | string | Yes | — | Supply chain query to identify supplier players |
| total_demand | number | No | 1000 | Total market demand in units |
| demand_uncertainty | number | No | 0.3 | Demand volatility — log-normal sigma |
| unit_price | number | No | 10 | Selling price per unit |
| unit_cost | number | No | 6 | Cost per unit ordered |
| monte_carlo_runs | number | No | 5000 | Number of Monte Carlo simulation runs |

Cost: $100-200 per call. Calls 5 actors.

---

assess_climate_vulnerability

Fits multivariate GPD parameters (xi, sigma) via method-of-moments to exceedances from NOAA, USGS, GDACS, and FEMA data. Computes tail dependence coefficient chi for multi-location co-occurrence risk. Returns per-node risk tiers and 100-year return period estimates.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Location or supply chain query |
| region | string | No | Geographic region to focus on, e.g. "Southeast Asia" |

Cost: $150-250 per call. Calls 8 actors.

---

compute_resilience_score

Three-measure composite resilience: (1) algebraic connectivity lambda_2 via power iteration with deflation, (2) percolation threshold p_c from hypergraph Monte Carlo, (3) tensor train rank. Formula: R = 0.4norm(lambda_2) + 0.35p_c + 0.25(1/rank). Returns grade A-F.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Supply chain query to build and assess |
| trigger_nodes | string[] | No | Nodes to use as cascade triggers for percolation analysis |

Cost: $200-300 per call. Calls 17 actors in parallel.

---

plan_contingency_routing

Solves optimal multi-commodity flow for the current network, then reroutes all flows around the specified disrupted nodes to nearest active alternatives. Computes exact cost increase and identifies demands that become infeasible after disruption.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Supply chain query to build the network |
| disrupted_nodes | string[] | Yes | Node IDs that are disrupted or offline |
| commodities | string[] | No | Specific commodities to reroute |

Cost: $200-300 per call. Calls 17 actors in parallel.

---

monitor_critical_chokepoints

Full pipeline: betweenness centrality (BFS-based), MERA hierarchical coarse-graining for scale-free structure detection, cascade failure impact scoring, and algebraic connectivity resilience. Nodes flagged as chokepoints at multiple analysis levels are ranked highest.

Input parameters:

| Parameter | Type | Required | Description |
|---|---|---|---|
| query | string | Yes | Supply chain query for comprehensive monitoring |
| trigger_nodes | string[] | No | Nodes to test as failure triggers |

Cost: $250-400 per call. Full analysis pipeline.

Output examples

optimize_tensor_network_flow — example output

{
  "nodeCount": 142,
  "edgeCount": 387,
  "tensorTrainRank": 8,
  "truncationError": 0.0023,
  "bondDimensions": [4, 8, 8, 6, 4, 4, 3, 2],
  "hyperedgeCount": 31,
  "flowOptimization": {
    "totalCost": 284700,
    "feasible": true,
    "bottleneckCount": 7,
    "topBottlenecks": [
      { "edge": "TSMC_Hsinchu -> Samsung_Pyeongtaek", "utilization": 0.97 },
      { "edge": "Shanghai_Port -> Rotterdam_Port", "utilization": 0.94 },
      { "edge": "Shenzhen_Foxconn -> Apple_Distribution_US", "utilization": 0.91 }
    ]
  },
  "nodes": [
    { "id": "TSMC_Hsinchu", "type": "manufacturer", "country": "TW", "capacity": 10000 },
    { "id": "Samsung_Pyeongtaek", "type": "manufacturer", "country": "KR", "capacity": 7500 },
    { "id": "Kaohsiung_Port", "type": "port", "country": "TW", "capacity": 15000 }
  ]
}

detect_disruption_cascade — example output

{
  "triggerNodes": ["TSMC_Hsinchu"],
  "affectedNodeCount": 67,
  "cascadeDepth": 5,
  "percolationThreshold": 0.42,
  "giantComponentFraction": 0.73,
  "systemicDisruptionRisk": 0.81,
  "criticalNodes": [
    { "id": "Kaohsiung_Port", "removalImpact": 0.64 },
    { "id": "Shanghai_Distribution_Hub", "removalImpact": 0.58 },
    { "id": "Samsung_Pyeongtaek", "removalImpact": 0.51 }
  ],
  "networkSize": 142
}

identify_sanctions_circumvention — example output

{
  "circumventionRisk": 0.78,
  "patternsDetected": 3,
  "patterns": [
    {
      "matchedNodes": ["Nexus Global BVI Ltd", "Nexus Trading HK", "Pinnacle Tech SZ"],
      "patternType": "shell_company_chain",
      "confidence": 0.89,
      "ownershipChain": ["Nexus Global BVI Ltd -> Nexus Trading HK -> Pinnacle Tech SZ"],
      "riskScore": 0.91
    }
  ],
  "suspiciousEntities": ["Nexus Global BVI Ltd", "Pinnacle Tech SZ"],
  "networkSize": 94
}

compute_resilience_score — example output

{
  "overallResilience": 0.61,
  "grade": "C",
  "algebraicConnectivity": 0.34,
  "percolationThreshold": 0.44,
  "tensorRank": 8,
  "weakPoints": [
    { "node": "Taiwan_Strait_Shipping", "contribution": -0.18 },
    { "node": "TSMC_Hsinchu", "contribution": -0.14 }
  ],
  "networkSize": 142,
  "edgeCount": 387
}

Output fields reference

| Field | Tool | Type | Description |
|---|---|---|---|
| nodeCount | flow, resilience, chokepoints | number | Total supply chain nodes in network |
| edgeCount | flow, resilience, chokepoints | number | Total directed edges in network |
| tensorTrainRank | flow, resilience | number | MPS bond rank from SVD truncation |
| truncationError | flow | number | Frobenius norm error from SVD truncation |
| bondDimensions | flow | number[] | Bond dimension at each MPS boundary |
| hyperedgeCount | flow | number | Number of shared commodity group hyperedges |
| flowOptimization.totalCost | flow | number | Total LP-optimal flow cost |
| flowOptimization.feasible | flow | boolean | Whether LP relaxation found a feasible solution |
| flowOptimization.topBottlenecks | flow | object[] | Edges at >85% capacity utilization |
| affectedNodeCount | cascade | number | Nodes reached by cascade from trigger nodes |
| cascadeDepth | cascade | number | Maximum propagation depth from triggers |
| percolationThreshold | cascade, resilience | number | Critical p_c: failure probability at fragmentation |
| giantComponentFraction | cascade | number | Fraction of network in largest connected component |
| systemicDisruptionRisk | cascade | number | Composite systemic risk score 0-1 |
| criticalNodes | cascade, chokepoints | object[] | Nodes ranked by removal impact score |
| circumventionRisk | sanctions | number | Aggregate evasion risk score 0-1 |
| patterns[].patternType | sanctions | string | Detected evasion pattern type |
| patterns[].confidence | sanctions | number | VF2 match confidence 0-1 |
| patterns[].ownershipChain | sanctions | string[] | Full ownership chain of matched pattern |
| overallResilience | resilience, chokepoints | number | Composite resilience score 0-1 |
| grade | resilience, chokepoints | string | Resilience grade A through F |
| algebraicConnectivity | resilience | number | Fiedler value lambda_2 of graph Laplacian |
| systemicClimateRisk | climate | number | Composite climate risk across all nodes 0-1 |
| tailDependenceCoeff | climate | number | Chi statistic for multivariate extreme co-occurrence |
| vulnerabilities[].riskTier | climate | string | Per-node risk tier: LOW/MEDIUM/HIGH/CRITICAL |
| vulnerabilities[].returnPeriod100yr | climate | number | 100-year return period event magnitude |
| vulnerabilities[].gpdShape | climate | number | GPD xi parameter from method-of-moments fit |
| nashEquilibriumTotal | game | number | Sum of all player Nash equilibrium order quantities |
| socialOptimum | game | number | Centrally coordinated optimal total order quantity |
| efficiencyLoss | game | number | Price of Anarchy — Nash / social optimum |
| players[].nashEquilibriumQuantity | game | number | Individual supplier's Nash equilibrium order |
| players[].riskOfStockout | game | number | Stockout probability at Nash equilibrium |
| originalCost | routing | number | Optimal flow cost before disruption |
| reroutedCost | routing | number | Flow cost after rerouting around disrupted nodes |
| costIncreasePct | routing | number | Percentage cost increase from rerouting |
| infeasibleDemands | routing | object[] | Demands that cannot be satisfied after disruption |
| meraHierarchyDepth | chokepoints | number | Number of MERA coarse-graining levels |
| meraScaleInvariance | chokepoints | number | Scale invariance measure across MERA hierarchy |
| chokepoints | chokepoints | object[] | Consolidated chokepoint ranking with multi-signal scores |

How much does it cost to run supply chain analysis?

This MCP server uses pay-per-event pricing — you pay a fixed amount per tool call. The cost covers all underlying data actor calls.

| Tool | Data sources called | Cost per call |
|---|---|---|
| simulate_supplier_game | 5 actors | $100-200 |
| identify_sanctions_circumvention | 8 actors | $150-250 |
| assess_climate_vulnerability | 8 actors | $150-250 |
| optimize_tensor_network_flow | 17 actors | $200-300 |
| detect_disruption_cascade | 17 actors | $200-300 |
| compute_resilience_score | 17 actors | $200-300 |
| plan_contingency_routing | 17 actors | $200-300 |
| monitor_critical_chokepoints | 17 actors | $250-400 |

You can set a maximum spending limit per session in your MCP client configuration. The server checks the charge limit before each tool call and returns a clear error message if the limit is reached rather than continuing to charge.

These tools are priced for professional use — a full supply chain risk assessment session using 4-5 tools runs $700-1,200. Compare this to specialized supply chain risk platforms (Resilinc, Riskmethods, Everstream Analytics) that charge $30,000-100,000+ per year in SaaS subscriptions. With this server you pay only for the analyses you run.

How Quantum-Inspired Supply Chain MCP Server works

Phase 1: Parallel data collection

Every tool call fires up to 17 Apify actor calls concurrently via Promise.all. Actors run with 256MB memory and a 180-second timeout each. Data sources cover the full supply chain intelligence stack: UN COMTRADE trade flows, SAM.gov and USAspending procurement, five corporate registries, two sanctions databases, four natural hazard feeds, two financial data sources, and three geospatial sources. Each actor returns structured JSON items that the scoring engine can consume directly.

Phase 2: Network construction

buildSupplyNetwork() ingests all 17 actor result arrays and constructs a typed supply graph of SupplyNode and SupplyEdge objects. Nodes are typed as supplier, manufacturer, distributor, retailer, port, or hub. Nodes carry capacity, reliability, sanctioned flag, disaster exposure, and climate risk attributes derived from the source data. The network also computes tensor train decomposition immediately: the adjacency-weighted capacity matrix is factorized via sequential SVD with a rank-4 truncation, yielding bond dimensions, truncation error, and MPS core matrices stored in TensorTrainFactor.

Phase 3: Algorithmic analysis

Each tool applies its specific algorithm to the constructed network:

- Flow tools call solveMultiCommodityFlow() which implements LP relaxation: minimize sum(c_ij f_ij^k) subject to flow conservation at every internal node and capacity constraints on every edge. Solved via 200 iterations of projected gradient descent on the Lagrangian dual with step size 1/(iteration+1).
- Cascade tools call detectDisruptionCascade() which seeds disruption at trigger nodes, propagates via BFS with each hop drawing from a Bernoulli distribution parameterized by edge weight and base propagation probability. Monte Carlo across N runs estimates the giant component fraction. Binary search on propagation probability finds p_c where giant component fraction first drops below 0.5.
- Sanctions tool calls identifySanctionsCircumvention() which constructs a directed ownership graph, generates 5 evasion pattern templates as subgraph templates, and runs VF2 state-space tree search with semantic feasibility pruning (sanctioned-node adjacency constraints) to find isomorphic matches.
- Climate tool calls assessClimateVulnerability() which, for each network node, collects co-located hazard event magnitudes, identifies exceedances above a rolling threshold, and fits GPD (xi, sigma) via method-of-moments. The tail dependence coefficient chi is estimated from bivariate extreme co-occurrence across node pairs.
- Resilience tool calls computeResilienceScore() which builds the n×n graph Laplacian L = D - A, then runs power iteration with deflation to find the Fiedler vector and lambda_2. Combined with p_c and 1/rank in the weighted composite formula, it produces the 0-1 resilience score and maps it to letter grades.
- MERA tool calls computeMERA() which iteratively coarse-grains the network by contracting lowest-weight edges into super-nodes, recording node counts, edge counts, and renormalized weights at each level until fewer than 4 nodes remain. Scale invariance is measured as the ratio of coarse-to-fine edge weight standard deviations.

Phase 4: Result assembly

All tools return structured JSON via the json() helper which wraps results in MCP CallToolResult format. Output includes raw computed values, ranked lists truncated to top-10, and human-readable summaries. The spending limit guard runs synchronously before each analysis: if Actor.charge() returns eventChargeLimitReached: true, the tool exits immediately with a clear error message.

Tips for best results

1. Start with optimize_tensor_network_flow for any new supply chain. The network it builds is representative of the full data state. Use the returned node IDs as inputs for subsequent tools — feeding exact node IDs as trigger_nodes or disrupted_nodes produces more precise results than letting the tools pick defaults.

2. Use identify_sanctions_circumvention before any supplier onboarding decision. The VF2 algorithm matches patterns that manual OFAC searches miss because they span multiple ownership layers. An entity_name input focused on the specific supplier significantly improves match precision.

3. Tune propagation_probability for your industry. The default 0.3 (30% propagation per edge) suits moderately connected supply chains. For tightly integrated just-in-time automotive supply chains, try 0.5-0.7. For commodity supply chains with many alternative suppliers, try 0.1-0.2.

4. Pair detect_disruption_cascade with plan_contingency_routing. Run cascade analysis first to identify which trigger nodes cause the highest affectedNodeCount. Then feed those same nodes as disrupted_nodes to the contingency routing tool to get the exact cost impact and alternative routes.

5. For climate assessment, always specify region. Narrowing from a global query to "Southeast Asia" or "Taiwan Strait" focuses NOAA, USGS, GDACS, and FEMA data pulls on relevant events and significantly improves GPD fit quality.

6. Use simulate_supplier_game before contract renegotiation. The Nash equilibrium quantities and Price of Anarchy figure give you leverage: if the game shows suppliers are over-ordering by 40% relative to social optimum, you have a quantitative basis for coordinated purchasing proposals.

7. monitor_critical_chokepoints is the highest-cost but most comprehensive tool — best used periodically (weekly or monthly) rather than on every query. Run the lighter compute_resilience_score for routine monitoring and reserve the full chokepoint analysis for strategic reviews.

Combine with other Apify actors

| Actor | How to combine |
|---|---|
| UN COMTRADE Search | Run standalone to explore trade flow data before passing commodity and node context to this MCP server |
| OFAC Sanctions Search | Use for quick single-entity sanctions checks; use this MCP server when you need full ownership graph traversal |
| [OpenSanction

No reviews yet — be the first

Sign in to leave a review

Use Google, GitHub, or an email account so ratings stay tied to real people.

Email sign in

No reviews posted yet.