diff --git a/tools/ui/src/lib/components/app/mcp/McpActiveServersAvatars.svelte b/tools/ui/src/lib/components/app/mcp/McpActiveServersAvatars.svelte index 5ac7a7fae6..3319dcf09f 100644 --- a/tools/ui/src/lib/components/app/mcp/McpActiveServersAvatars.svelte +++ b/tools/ui/src/lib/components/app/mcp/McpActiveServersAvatars.svelte @@ -2,8 +2,8 @@ import McpLogo from './McpLogo.svelte'; import * as Tooltip from '$lib/components/ui/tooltip'; import { ICON_CLASS_DEFAULT, MAX_DISPLAYED_MCP_AVATARS } from '$lib/constants'; - import { HealthCheckStatus } from '$lib/enums'; - import { mcpStore } from '$lib/stores'; + import { HealthCheckStatus, ToolSource } from '$lib/enums'; + import { conversationsStore, mcpStore } from '$lib/stores'; interface Props { class?: string; @@ -13,7 +13,15 @@ let { class: className = '', onclick }: Props = $props(); let mcpServers = $derived(mcpStore.getServers().filter((s) => s.enabled)); - let enabledMcpServersForChat = $derived(mcpServers.filter((s) => s.url.trim())); + // respect the active conversation's tool policy, not just global enablement + let enabledMcpServersForChat = $derived( + mcpServers.filter( + (s) => + s.url.trim() && + conversationsStore.preferences.isCategoryEnabled(ToolSource.MCP) && + conversationsStore.preferences.isServerToolsEnabled(s.id) + ) + ); let healthyEnabledMcpServers = $derived( enabledMcpServersForChat.filter((s) => { const healthState = mcpStore.getHealthCheckState(s.id);