Merge remote-tracking branch 'origin/main' into ethie/pm-clean

This commit is contained in:
ethernet
2026-09-22 18:36:40 -04:00
5 changed files with 10 additions and 7 deletions

View File

@@ -475,9 +475,11 @@ class SessionManager:
elif isinstance(model_cfg, str):
default_model = model_cfg.strip()
from tools.mcp_tool_common import mcp_server_enabled
configured_mcp_servers = [
name for name, cfg in (config.get("mcp_servers") or {}).items()
if not isinstance(cfg, dict) or cfg.get("enabled", True) is not False
if not isinstance(cfg, dict) or mcp_server_enabled(cfg)
]
kwargs = {
"platform": "acp", "quiet_mode": True, "session_id": session_id, "session_db": self._get_db(),

View File

@@ -11,7 +11,7 @@ import type {
import type { McpCatalogEntry } from '@/hermes'
import { connectorTitle } from '@/lib/connector-tools'
import type { McpServers } from '@/lib/mcp-servers'
import { type McpServers, serverEnabled } from '@/lib/mcp-servers'
import { canAuthenticate } from '../../mcp/mcp-status'
import { toolRows } from '../derive-tools'
@@ -237,7 +237,7 @@ export function joinLocalServers({ catalog, servers, status, toolCounts, usage }
canAuthenticate: canAuthenticate(entry, raw),
connectorSlug: text(bundled?.connector_slug),
description: text(bundled?.description),
enabled: entry.enabled !== false,
enabled: serverEnabled(entry),
inCatalog: bundled !== undefined,
name,
status: raw,

View File

@@ -7,7 +7,6 @@ import { NEEDS_AUTH_RE } from '@/lib/mcp-probe-cache'
import { type McpServerEntry, serverEnabled } from '@/lib/mcp-servers'
import { countEnabledTools } from '@/lib/mcp-tool-filter'
export const MCP_CATALOG_KEY = ['mcp-catalog'] as const
export type Probe = McpTestResult | 'probing'

View File

@@ -17,7 +17,7 @@
import { getHermesConfigRecord, type McpTestResult, setMcpServerEnabled, testMcpServer } from '@/hermes'
import { translateNow } from '@/i18n'
import { classifyProbe, freshProbe, probeCache, probeKey } from '@/lib/mcp-probe-cache'
import { getServers } from '@/lib/mcp-servers'
import { getServers, serverEnabled } from '@/lib/mcp-servers'
import { persistString, storedString } from '@/lib/storage'
import { notify, notifyError } from '@/store/notifications'
import { $activeGatewayProfile, normalizeProfileKey } from '@/store/profile'
@@ -148,7 +148,7 @@ function recordResult(profileKey: string, name: string, status: McpHealthStatus)
}
const isUrlServer = (server: Record<string, unknown>): boolean =>
typeof server.url === 'string' && server.enabled !== false
typeof server.url === 'string' && serverEnabled(server)
async function sweep(): Promise<void> {
const epoch = sweepEpoch

View File

@@ -83,7 +83,9 @@ def _configure_mcp_tools_interactive(config: dict):
_print_info("No MCP servers configured.")
return
enabled_names = [k for k, v in mcp_servers.items() if v.get("enabled", True) not in {False, "false", "0", "no", "off"}]
from tools.mcp_tool_common import mcp_server_enabled
enabled_names = [k for k, v in mcp_servers.items() if isinstance(v, dict) and mcp_server_enabled(v)]
if not enabled_names:
_print_info("All MCP servers are disabled.")
return