pub fn build_mcp_config_from_refs(
servers: &[McpServer],
user_mcp_blob: Option<&str>,
agent_slug: &str,
agent_bus_id: &str,
) -> Option<String>Expand description
Build .mcp.json from standalone McpServer ref rows (v1 composable model).
Layering (later wins on key collision, except the reserved agentmux key):
- synthetic
agentmuxentry (always injected) user_mcp_blob’smcpServers— the legacy per-agent blob, merged when the caller passes it (used so a global-only ref set never wipes a legacy agent’s user servers)serversref rows (the agent’s own bound servers + globals) For each ref row theconfigfield is a JSON object used as the server value directly. Falls back tobuild_mcp_configwhen there are no ref rows and no blob.