Skip to content

Drop platform_overrides from resolved mcp_config; honour empty-string overrides#272

Open
aosmcleod wants to merge 1 commit into
modelcontextprotocol:mainfrom
aosmcleod:fix/platform-overrides-leak
Open

Drop platform_overrides from resolved mcp_config; honour empty-string overrides#272
aosmcleod wants to merge 1 commit into
modelcontextprotocol:mainfrom
aosmcleod:fix/platform-overrides-leak

Conversation

@aosmcleod

Copy link
Copy Markdown

Problems

  1. platform_overrides leaks into the resolved config (Resolved mcp_config still contains the full platform_overrides map #265). getMcpConfigForManifest builds result by spreading the base mcp_config (which includes platform_overrides), applies the current platform's overrides, but never removes the platform_overrides map — so the resolved runtime config handed to the host still carries the entire block, including other platforms' commands/env.
  2. Empty-string command override is dropped (item 1 of Minor correctness/robustness fixes: empty-string override, secret logging, version precedence, ZIP bounds #267). result.command = platformConfig.command || result.command uses ||, so a deliberate empty-string override is falsy and falls back to the base command.

Fix

  • delete result.platform_overrides after resolving (src/shared/config.ts).
  • Use explicit !== undefined presence checks for the command/args override merge.

Test

Adds cases to test/config.test.ts: the resolved config has no platform_overrides (incl. when an override exists for a non-current platform), and an empty-string command override is honoured. New assertions fail against the old code and pass with the fix. yarn lint + yarn test (config suite) green.

Fixes #265.

…rrides

getMcpConfigForManifest spreads the base mcp_config (including platform_overrides)
and never removes it, so the full platform_overrides map — other platforms'
commands/env included — leaked into the resolved runtime config handed to the
host. Delete it after resolving.

Also switch the command/args override merge from `||` to explicit `!== undefined`
checks so a deliberate empty-string command (or empty args) override is honoured
instead of silently falling back to the base value.

Fixes modelcontextprotocol#265 (empty-string override is item 1 of modelcontextprotocol#267)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Resolved mcp_config still contains the full platform_overrides map

1 participant