See llms.txt for all machine-readable content.

Back to Templates

Route resilient MCP requests with HTTP health checks and multi-server failover

Quick overview

This workflow exposes a webhook that probes multiple MCP servers for health, scores eligible providers by capabilities, constraints, and preferences, routes the incoming request to the best available server, and returns a detailed routing decision and recovery report.

How it works

  1. Receives an incoming POST request via an n8n webhook.
  2. Validates the payload, derives required capabilities and constraints (region and cost tier), and loads a catalog of candidate servers.
  3. Probes Server A, Server B, and Server C over HTTP (with short waits between probes) to capture live availability signals.
  4. Scores each server using the probe results plus capability match, constraint checks, and preference weighting, then selects a primary server and up to two fallbacks.
  5. Forwards the original request and preserved context to the selected server via an HTTP request.
  6. Builds an audit-friendly decision and recovery report (including health snapshot, scores, and routing outcome) and returns it in the webhook response.

Setup

  1. Configure the webhook endpoint path (mcp-route) and copy the production webhook URL into the system that will call this router.
  2. Replace the sample health and routing URLs (currently httpbin.org) with your real MCP server health and route endpoints in the server catalog.
  3. Adjust the server catalog (capabilities, regions, cost tiers, concurrency limits) and scoring weights to match your infrastructure and routing policy.
  4. If needed, tune HTTP timeouts and the wait durations between health probes for your network conditions.