Skip to content

fix: scope env warnings to selected server#245

Open
haosenwang1018 wants to merge 1 commit intophilschmid:mainfrom
haosenwang1018:fix/scope-env-warnings-info
Open

fix: scope env warnings to selected server#245
haosenwang1018 wants to merge 1 commit intophilschmid:mainfrom
haosenwang1018:fix/scope-env-warnings-info

Conversation

@haosenwang1018
Copy link
Copy Markdown

Summary

  • scope config env substitution to the selected server when mcp-cli info <server> is used
  • avoid unrelated missing-env warnings from other configured servers
  • add regression coverage for scoped config loading

Problem

Issue #20 reports that mcp-cli info <server> emits missing environment variable warnings for every server in the config, even when only one server is being queried.

Fix

loadConfig() now supports scoping env substitution to a requested server subset. The info command passes the selected server name into config loading, so env placeholders are only expanded (and warned on) for the server actually being inspected. Commands that need the full config still retain the existing whole-config behavior.

Fixes #20

Validation

  • bun test tests/config.test.ts
  • bun test tests/output.test.ts
  • npx tsc --noEmit
  • npx @biomejs/biome check src/config.ts src/commands/info.ts tests/config.test.ts
  • git diff --check

Signed-off-by: haosenwang1018 <haosenwang1018@users.noreply.github.com>
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.

Environment variable warnings shown for all servers, not just the one being queried

1 participant