Docs
Biyan Desktop
MCP Routing

MCP Routing Telemetry

This contributor reference describes an optional code callback, not product analytics enabled by default. End users configure routing under Settings → MCP Servers.


import { mcpOrchestrator, type McpRoutingTelemetry } from '@/lib/mcp-orchestrator'
await mcpOrchestrator.getRelevantTools(userMessage, mcpServiceLike, disabledToolKeys, {
routerModel,
abortSignal,
onRoutingTelemetry: (info: McpRoutingTelemetry) => {
console.debug('[mcp-routing]', info)
},
})

Released Biyan builds do not register onRoutingTelemetry. A custom build must add the callback explicitly.

Important fields

FieldMeaning
routingRanWhether server selection ran for the turn.
bypassedRoutingWhether Biyan loaded the full tool list directly.
pickSourcellm, keyword, or null.
selectedServerCountNumber of selected server names.
totalLatencyMsTotal tool-routing latency.
llmRouterLatencyMsRemote router-model latency, or null.
fallbackReasonStable reason code for timeout, abort, error, empty output, or tool-load recovery.
fellBackToFullToolListWhether Biyan widened the tool set after selective loading failed.
llmRouterUsageProvider usage data when the remote provider returns it.

Telemetry handlers must not log prompts, API keys, tool arguments, tool output, full paths, or document content. See MCP Servers.