From f35707c9f3d9113a255e1fd151fb44d793c9453b Mon Sep 17 00:00:00 2001 From: Claude Date: Tue, 30 Jun 2026 18:30:21 +0800 Subject: [PATCH] docs(mcp): fix spec inconsistency: empty MCP_SERVICES means zero services Self-review caught a contradiction: the spec's prose said 'MCP_SERVICES="" (empty) -> zero services mount' but the code example in the spec used 'if not raw: return services' which conflates unset and empty (both fall through to 'all mount'). Fix: _filter_by_env now uses 'MCP_SERVICES' not in os.environ to distinguish unset (backward compat: all mount) from empty (explicit choice: zero mount). Test cases already specified the correct behavior. Co-Authored-By: Claude Fable 5 --- .../superpowers/specs/2026-06-30-pluggable-mcp-design.md | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/docs/superpowers/specs/2026-06-30-pluggable-mcp-design.md b/docs/superpowers/specs/2026-06-30-pluggable-mcp-design.md index cfd7243..8007833 100644 --- a/docs/superpowers/specs/2026-06-30-pluggable-mcp-design.md +++ b/docs/superpowers/specs/2026-06-30-pluggable-mcp-design.md @@ -121,10 +121,13 @@ BUILTIN_SERVICES: list[str] = [ def _filter_by_env(services: list[McpService]) -> list[McpService]: - """Whitelist by `MCP_SERVICES` env. Unset = no filter (backward compat).""" - raw = os.environ.get("MCP_SERVICES") - if not raw: + """Whitelist by `MCP_SERVICES` env. Unset = no filter (backward compat). + Empty string = zero services (explicit operator choice, distinct from unset).""" + if "MCP_SERVICES" not in os.environ: return services + raw = os.environ["MCP_SERVICES"] + if not raw: + return [] allowed = {n.strip() for n in raw.split(",") if n.strip()} return [s for s in services if s.name in allowed]