MCP: 'MCPRuntime built — N tools' boot log undercounts (stdio only) — misleading triage signal #22

Open
opened 2026-05-12 19:05:02 +00:00 by KofTwentyTwo · 0 comments
KofTwentyTwo commented 2026-05-12 19:05:02 +00:00 (Migrated from github.com)

Summary

MCPRuntime built — N tools boot log undercounts: registeredToolNames() only returns stdio helper tools (3), not the 7 in-process tools registered into inProcessToolRegistry. The boot log perpetually shows MCPRuntime built — 3 tools while MCPBootHealthProbe correctly reports 10. A contributor reading the system log will conclude in-process tools didn't register and chase the wrong root cause.

Evidence

  • File: App/AppDelegate.swift:618-619:
    let toolCount = await runtime.client.registeredToolNames().count
    self.systemLogger?.info("MCPRuntime built — \(toolCount) tools")
    
  • runtime.client.registeredToolNames() returns stdio-only (3): get_time, get_clipboard, run_applescript
  • MCPBootHealthProbe at App/Boot/BootHealthProbes.swift:336-391 correctly counts both registries

Root cause / hypothesis

Today's commit 740bed4 addressed a related undercount in the probe; this log line was missed. The log line uses the runtime client's registered-names API which only knows about stdio servers.

Recommended fix

Include inProcessToolRegistry.registered().count in the log line, or just delete the line and rely on MCPBootHealthProbe for the count.

let stdioCount = await runtime.client.registeredToolNames().count
let inProcessCount = await self.inProcessToolRegistry.toolSchemas().count
self.systemLogger?.info("MCPRuntime built — \(stdioCount + inProcessCount) tools (\(stdioCount) stdio + \(inProcessCount) in-process)")

Test

  • After registering 7 in-process tools, assert boot log line includes the in-process count

Source

  • Audit: .planning/audit-2026-05-12/mcp-agent-audit.md (2026-05-12) — finding CRIT-3
## Summary `MCPRuntime built — N tools` boot log undercounts: `registeredToolNames()` only returns stdio helper tools (3), not the 7 in-process tools registered into `inProcessToolRegistry`. The boot log perpetually shows `MCPRuntime built — 3 tools` while `MCPBootHealthProbe` correctly reports 10. A contributor reading the system log will conclude in-process tools didn't register and chase the wrong root cause. ## Evidence - File: `App/AppDelegate.swift:618-619`: ```swift let toolCount = await runtime.client.registeredToolNames().count self.systemLogger?.info("MCPRuntime built — \(toolCount) tools") ``` - `runtime.client.registeredToolNames()` returns stdio-only (3): `get_time`, `get_clipboard`, `run_applescript` - `MCPBootHealthProbe` at `App/Boot/BootHealthProbes.swift:336-391` correctly counts both registries ## Root cause / hypothesis Today's commit `740bed4` addressed a related undercount in the probe; this log line was missed. The log line uses the runtime client's registered-names API which only knows about stdio servers. ## Recommended fix Include `inProcessToolRegistry.registered().count` in the log line, or just delete the line and rely on `MCPBootHealthProbe` for the count. ```swift let stdioCount = await runtime.client.registeredToolNames().count let inProcessCount = await self.inProcessToolRegistry.toolSchemas().count self.systemLogger?.info("MCPRuntime built — \(stdioCount + inProcessCount) tools (\(stdioCount) stdio + \(inProcessCount) in-process)") ``` ## Test - After registering 7 in-process tools, assert boot log line includes the in-process count ## Source - Audit: `.planning/audit-2026-05-12/mcp-agent-audit.md` (2026-05-12) — finding CRIT-3
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: KofTwentyTwo/Jarvis#22