Repository navigation
Description
Summary
mecatui in embedded (bare-local) mode silently ignores static MCP servers configured via the operator settings file (~/.config/mecatl/settings.yaml → mcp.servers) — and exposes no --mcp-server flag. On a host without a working ToolHive container runtime, the result is MCP DISABLED (no servers resolved from any source) even though the user has a valid server configured. Nothing in the log points at why.
Reported by a user who had a valid mcp.servers entry that never activated, and lost time tracing it.
Root cause
app.Build only folds the operator-tier mcp: settings block into cfg.MCPServers when a MCPProfileLoader is installed (internal/app/build.go:1314). The three server-head command roots install it:
cmd/mecated/main.go:1117—MCPProfileLoader: cliconfig.NewMCPProfileResolver(cfg.mcpServers, os.LookupEnv)cmd/mecak8s/flags.go:527— samecmd/mecatequi/flags.go:410— same
cmd/mecatui installs no MCPProfileLoader and registers no --mcp-server flag (embeddedConfig at cmd/mecatui/main.go only sets ToolHiveEnabled: true, MCPResourceTools: true, MCPPrompts: true). The 2026-06-02 wiring comment is explicit that "Static --mcp-server stays off (heavier opt-in)" — mecatui's embedded MCP story was deliberately ToolHive-centric and predates the operator-settings profile seam. That seam was never back-fitted to mecatui, so the settings-half is now a silent no-op there.
LoadMCPProfiles(nil-legacy) already handles the no---mcp-server-flag case cleanly, so the seam itself needs no new code.
Why this hurts
- A user with settings-file MCP servers gets
static=0, no error, no deepwiki/server mention — the loader fails soft by design, so there's zero diagnostic signal that the config was parsed and dropped. - ToolHive is not a fallback on a laptop with no container runtime (
No available runtime foundin the diagnostic), so for that population the TUI's only MCP source is the settings file — which is exactly the one that's skipped. - The
user-docsMCP page describes the settings-file +mecated mcp loginflow without noting it doesn't apply to embedded mecatui.
Proposal
-
Add an opt-in that lets embedded mecatui honor static MCP config (settings-file
mcp.serversand/or--mcp-server), wired viaMCPProfileLoader: cliconfig.NewMCPProfileResolver(cfg.mcpServers, os.LookupEnv)on the embedded path. Suggested surface: a--mcp-static(or--mcp-server) flag;ToolHiveEnabledstays as-is and composes freely. -
Default OFF — preserves the current posture and the 2026-06 design intent ("heavier opt-in"). No behavior change for existing launches.
-
Warn when config is present but unused. When the loader is NOT installed but
resolver.OperatorMCP()(or the parsedmcp:block) is non-empty, emit a single one-line WARN naming the count, e.g.:
mcp: N static server(s) configured in settings.yaml are NOT loaded in embedded mecatui without --mcp-static; see docs
so the next person sees the config was seen and deliberately not used, instead of silent darkness.
Acceptance
mecatui --mcp-static(or equivalent) with a valid settingsmcp.serversentry logsMCP servers connected ... servers=Nand exposesmcp__<name>__*tools.- Without the flag, behavior is byte-identical to today except the one WARN line above.
mecated/mecak8s/mecatequibehavior unchanged.- A regression test pins that the embedded config surfaces the configured server when the opt-in is set, and emits the WARN when it isn't.
Activity
fix(mecatui): load operator mcp.servers in embedded mode (#658) (#660)