The last four MCP enabled-flag readers use the shared reader (ACP, hermes tools picker, desktop connector card, health sweep) (#119601)

* fix(mcp): ACP, `hermes tools` and the desktop connector card use the one enabled reader

#119567 left four readers of `mcp_servers.<name>.enabled` on their own rules.
@webtecnica's #119560 found the ACP one:

- `acp_adapter/session.py::_make_agent` used `is not False`, so an ACP
  session kept a server with `enabled: "false"` or `enabled: 0` in its
  toolset while the MCP client skipped it.
- `hermes tools` MCP picker (`tools_config_mcp._configure_mcp_tools_interactive`)
  read `enabled: 0` as on and crashed on a non-dict entry.
- Desktop connector card (`connectors/data/join.ts`) and the MCP health sweep
  (`store/mcp-health.ts`) used `enabled !== false`.

All four now call `mcp_server_enabled` (Python) or `serverEnabled` (renderer),
which share one case table.

Co-authored-by: webtecnica <webtecnica@gmail.com>

* chore: retrigger CI (zero-job dispatch failure, auto-heal)

---------

Co-authored-by: webtecnica <webtecnica@gmail.com>
This commit is contained in:
Siddharth Balyan
2026-09-23 03:54:31 +05:30
committed by GitHub
parent 400f11bd35
commit aaf0fd9273
4 changed files with 10 additions and 6 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

@@ -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