Skip to content

fix(cli): the MCP exclusion strips nothing from a manifest a real install recorded #806

Closed

Description

@blafourcade

Description

UninstallMcpExclusionUseCase rebuilds the manifest's merge entries for every merge file of the tool, not only the ones it edited, and it keys the rebuild on sectionKey. Every real install records sectionKey: null, so on a real project the use case removes MCP keys from disk and then strips nothing from the manifest's merge entries. Found by the mutation pass of #798; no test drives it with the manifest a real install writes.

Affected file(s)

cli/src/contexts/framework/application/uninstall/uninstall-mcp-exclusion-use-case.ts — execute calls rebuildMergeEntries(toolId, manifest, mcpFilter) for all merge files after processOneMergeFile touched a subset.

Expected behaviour

Only the merge entries of the files the use case edited are rewritten, and a manifest recorded by a real install (sectionKey: null) loses the excluded keys the same way a fixture with a section key does.

Observed behaviour

With sectionKey: null the manifest's merge entries are unchanged after the exclusion.

AI tool

Any tool declaring MCP merge files

aidd-cli version

5.2.2 (branch next)

OS

Any

Additional context

Surfaced in #804. The test to write first: a manifest as plugin install records it, then uninstall --mcp, then the merge entries no longer name the excluded keys.

Activity

  1. added theissue type on Sep 9, 2026
  2. moved this from Ideation to Todo in AIDD Roadmapon Sep 9, 2026
  3. blafourcade commented on Sep 10, 2026

    @blafourcade
    ContributorAuthor

    Read before fixing, and the defect is larger than the title says.

    • framework remove is the only caller of UninstallUseCase, and it passes mcpFilter: [] (cli/src/presentation/commands/framework.ts:105). No command exposes an MCP filter, so UninstallMcpExclusionUseCase has run with an empty filter since the CLI moved into this repository (daeef56a): nothing is ever removed, and nothing is ever recorded.
    • Manifest.addExcludedMcp / excludedMcp is written by that use case and read by nothing outside manifest/tool-entry.ts: no install step consults it, so even a recorded exclusion would not keep an entry out.
    • The shape mismatch the title names is real too: real installs record MCP merge files with sectionKey: null and whole-top-level-key hashes (install-runtime-config-use-case.ts:187), while the exclusion expects per-server keys under a section, so the two would not meet even with a filter.

    Two ways to close this, both a product call rather than a patch:

    1. Wire it: framework remove --mcp <server…> passing the filter, installs recording MCP files under their entrySection (mcpServers) so per-server tracking exists, and an install step that honours excludedMcp.
    2. Delete it: UninstallMcpExclusionUseCase, McpExclusion, excludedMcp on the manifest (with a manifest read that tolerates the old field), and the tests test(cli): kill the surviving mutants of the framework context #804 wrote for the dead path.

    Recommendation: 2, unless someone asked for per-server MCP removal. The feature has had no user-reachable entry point for its whole life here, and #804's 95 % floor now pins dead code.

  4. blafourcade commented on Sep 10, 2026

    @blafourcade
    ContributorAuthor

    Decision: delete. The exclusion was never reachable (no command passes a non-empty filter, nothing reads excludedMcp, installs record sectionKey: null), so it goes rather than gets wired. Work on refactor/drop-unreachable-mcp-exclusion; an existing manifest carrying excludedMcp must keep loading.

  5. moved this from Todo to In Progress in AIDD Roadmapon Sep 10, 2026
  6. moved this from In Progress to In review in AIDD Roadmapon Sep 10, 2026
  7. moved this from In review to Done in AIDD Roadmapon Sep 10, 2026
  8. closed this as completedby moving to Done in AIDD Roadmapon Sep 10, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    Fields

    Priority

    Low

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions