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
- Receives an incoming POST request via an n8n webhook.
- Validates the payload, derives required capabilities and constraints (region and cost tier), and loads a catalog of candidate servers.
- Probes Server A, Server B, and Server C over HTTP (with short waits between probes) to capture live availability signals.
- 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.
- Forwards the original request and preserved context to the selected server via an HTTP request.
- Builds an audit-friendly decision and recovery report (including health snapshot, scores, and routing outcome) and returns it in the webhook response.
Setup
- Configure the webhook endpoint path (mcp-route) and copy the production webhook URL into the system that will call this router.
- Replace the sample health and routing URLs (currently httpbin.org) with your real MCP server health and route endpoints in the server catalog.
- Adjust the server catalog (capabilities, regions, cost tiers, concurrency limits) and scoring weights to match your infrastructure and routing policy.
- If needed, tune HTTP timeouts and the wait durations between health probes for your network conditions.