Skip to content

feat(setup): inspect, refresh and remove five mcp-add-only clients - #10694

Merged
morluto merged 8 commits into
mainfrom
refactor/fold-mcp-add-clients
Nov 15, 2026
Merged

morluto merged 8 commits into
mainfrom
refactor/fold-mcp-add-clients

Conversation

@morluto

@morluto morluto commented Nov 15, 2026 •

Copy link
Copy Markdown
Owner

Summary

Cline VS Code extension, Kiro, Mastra Code, Zed and Amp become rows in the client table. rea mcp add already wrote registrations for them, but doctor, update and uninstall never saw those registrations. Now they do, and setup offers each client when its directory exists.

Refs #7181 (this PR covers 5 of the 10 mcp-add-only clients; the other 5 are listed below).

Problem and expected behavior

rea mcp add --agent zed (likewise cline, kiro-cli, mastracode, amp) wrote a registration from a registration-only catalog entry (McpRegistrationCatalog.ts). Doctor (readClientRegistrationInspections), update (existingMaintenanceScope → rea setup --client) and uninstall only iterate supportedClients(), so:

  • rea doctor did not report the registration;
  • rea update left it pinned to the old entrypoint;
  • rea uninstall reported success while it remained.

Expected: a client REA registers can also be inspected, refreshed and removed by REA.

Change and scope

  • SupportedClients.ts: five new defineClient rows (cline_vscode, kiro, mastracode, zed, amp) with the paths, formats, markers, stdio profiles and add-mcp aliases/project paths the catalog used to declare. SetupClient["format"] gains zed and amp, so ClientConfigurationFormat no longer lists them separately.
  • McpRegistrationCatalog.ts: those ids become tableClient(...) projections. The duplicate location functions are removed from McpRegistrationLocations.ts.
  • Doctor ids follow the table's convention. Remediation text is the shared table text.
  • Docs: the supported-agents table, the mcp add section, a client-configuration section, and the skill's client-id list.

Not included (each needs native read rules modeled first, so its own PR; the research is in the audit's report 18):

  • Goose: system /etc/goose/config.yaml and GOOSE_ADDITIONAL_CONFIG_FILES layers, merged field by field.
  • Junie: the default-location admission currently applies only in mcp add.
  • fx: FX_HOME is ignored; setup's writer has no private-profile (0700/0600) mode.
  • MCPorter: XDG_CONFIG_HOME and MCPORTER_CONFIG are ignored. MCPorter also imports setup-managed clients by default.
  • Kilo: async layered locations and inline config.

Collapsed into this PR from its stack: Cline in VS Code Insiders, VSCodium, Cursor and Windsurf (#10729); Amp settings.jsonc (#10717); Linux Flatpak Zed, including FLATPAK_XDG_CONFIG_HOME and a native folder linked to the Flatpak folder (#10721).

Scope: this was a maintainer request ("research and address"). Clients are not providers, and nothing here adds target execution, injection, mutation or protection recovery.

Contract and boundary impact

  • Semantic owner and earliest changed stage: the client table (SUPPORTED_CLIENT_DEFINITIONS) now owns these five clients. The mcp-add catalog projects the rows, so the registration-only descriptors and their location functions are deleted.

  • Contribution scope fit and linked maintainer decision: maintainer-requested W8/D5 workstream.

  • CLI and MCP/tool-catalog contract: rea setup --client, rea doctor --client and uninstall accept and report cline_vscode, kiro, mastracode, zed and amp. rea mcp add ids and aliases are unchanged.

  • Provider, bridge, target-format, or platform compatibility: paths are unchanged from the mcp-add catalog on macOS, Linux and Windows.

  • Evidence, artifact, provenance, or reconstruction contract: none.

  • Target selection, authority, upstream behavior, and cleanup details: setup writes only after approval, with backups, as for every row. Uninstall removes only REA-owned rows.

  • Generated metadata: the product catalog's setup_clients gains five ids (generated in CI). The cursor-plugin skill copy was regenerated.

  • Read existing files or captured data.

  • Launch or attach to a process.

  • Inject instrumentation or run scripts/code.

  • Change process memory, registers, files, or configuration.

  • Contact network services.

  • Recover protected code or work around protections.

  • Documentation or usability only; no target interaction.

  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

  • Tests added or updated:
    • tests/boundary/filesystem/mcpAddClientLifecycle.test.ts covers each of the five clients through production code. It registers with resolveMcpRegistrationClients + registerMcpClients, checks the path is the table row's, then:
      • doctor reports the row as owned;
      • existingMaintenanceScope selects it for update;
      • setup inspection is not invalid;
      • uninstall reports it removed and leaves the file without rea.
    • clientLifecycle.test.ts: the detection list includes the five new ids.
  • Base reproduction: with src reverted to origin/main, all five cases of the new test fail.
  • Remaining proof gaps: no installed Cline, Kiro, Mastra Code, Zed or Amp was run. Locations and formats follow each client's docs and source (cited in the audit report), not runtime loading.

Validation performed

  • CI shard 8 failed tests/boundary/cli/packageRunnerRegistration.test.ts: doctor --client omp now also reports the Amp registration mcp add --agent amp wrote, because Amp is a table row (doctor reports every detected registration; --client only forces inclusion). The test now expects both amp and omp aligned (30a89ba). npm run test:focused -- tests/boundary/cli/packageRunnerRegistration.test.ts plus 12 related setup/doctor/mcp-add boundary and acceptance files — 242 passed, 11 skipped.
  • npm run test:focused -- tests/boundary/filesystem/mcpAddClientLifecycle.test.ts tests/boundary/filesystem/clientLifecycle.test.ts — 68 passed. With src stashed: 5 failed.
  • npm run test:focused -- tests/boundary/filesystem/clientRegistrationStatus.test.ts tests/boundary/filesystem/clientLifecycle.test.ts tests/boundary/filesystem/clientConfigurationDialects.test.ts tests/process-global/updateMaintenance.test.ts tests/acceptance/setup/automaticClientSetup.test.ts tests/boundary/cli/cliSetup.test.ts — 219 passed. The one failure was the expected detection list, now updated.
  • npm run test:local -- src/application/McpRegistrationCatalog.test.ts src/application/McpClientRegistration*.test.ts src/application/SetupPlan.test.ts src/application/Setup.planning.test.ts src/application/Doctor.test.ts src/application/Uninstall.test.ts — 215 passed, 1 skipped.
  • npm run test:local -- src/cliMcpRegistration.test.ts src/application/ClientRegistration.test.ts src/application/ClientConfigurationDocument.shape.test.ts src/setupEnvironment.test.ts src/application/Setup.configuration.test.ts — 96 passed.
  • npm run check:fast — passed.
  • npm run docs:check — passed.
  • Linux Flatpak Zed (collapsed fix(setup): find a Linux Flatpak Zed's configuration #10721) review fix: npm run test:focused -- tests/boundary/filesystem/mcpAddClientLifecycle.test.ts — 11 passed; the new linked-folder case failed with the zedLocation change reverted. Pre-push npm run check:fast passed.

Compatibility, safety, and release

  • Breaking changes or migration steps: none. Behavior change: rea setup now detects and offers these five clients, and setup's plan shows each change before approval.
  • Real Hopper/Ghidra, browser, or OS coverage: macOS filesystem tests only. Windows and Linux paths are unchanged from the existing mcp-add catalog.
  • Package or release metadata impact: the docs say these ids require a release after 6.9.0.
  • Security, privacy, process, or containment review: no new write locations. Writes go through the existing setup and uninstall transactions, with backups.

Author readiness

Human owner:

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

Before merge

  • This PR addresses a concrete problem or an agreed enhancement.
  • Material scope and authority questions are resolved, and any required maintainer scope decision covers the final diff.
  • The PR has one focused outcome and the title follows type(scope): outcome.
  • Related issue is linked, or the reason for not linking one is stated above.
  • Tests cover changed observable behavior and meaningful failure paths.
  • Owning docs, contracts, and generated metadata are updated where needed.
  • User-visible CLI/MCP changes include representative output.
  • I checked the final diff for secrets, unrelated cleanup, and unsupported claims.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-15T06:21:32.082000Z 5a3672f New commits
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@greptile-apps

greptile-apps Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5 Tier: plus

[Medium impact] The reviewed changes appear safe to merge.

Summary

Moves Cline’s editor extensions, Kiro, Mastra Code, Zed and Amp into the shared client table so setup, doctor, update and uninstall use the same definitions.

  • Five MCP clients now share setup rows with doctor, update, and uninstall.
  • Cline registrations work in four more editor settings folders.
  • Zed and Amp registrations follow the configuration files those clients read.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  Table["Shared client table"] --> Add["mcp add"]
  Table --> Setup["Setup"]
  Table --> Doctor["Doctor"]
  Table --> Update["Update"]
  Table --> Uninstall["Uninstall"]
Loading

Reviews (8) · Last reviewed commit: "test(setup): expect doctor to report the..." · Reviewed by Greptile

Cline VS Code extension, Kiro, Mastra Code, Zed and Amp move from
registration-only catalog entries to rows in the client table. rea mcp add
projects those rows, so doctor, update and uninstall now inspect, refresh
and remove what it wrote, and setup offers each client when detected.

Refs #7181
The client helpers added for the folded mcp-add clients were inserted
between FreeBuff's profile-directory comment and its declaration. Move
them above it, and drop an import the folded locations no longer use.
Address review: seed each folded client with an older REA-owned package
runner launcher, then check that doctor reports it stale, update selects
it, setup plans and applies the update, and doctor then reads the
current launcher.
…file (#10717)

Amp reads ~/.config/amp/settings.json or settings.jsonc. REA always
used settings.json, creating a second file beside an existing
settings.jsonc. Use settings.jsonc when it is the only file, and refuse
when both exist because Amp does not document which one it reads.
@morluto
morluto force-pushed the refactor/fold-mcp-add-clients branch from e00a1c5 to 02f9936 Compare November 15, 2026 03:44
…indsurf (#10729)

* feat(setup): manage Cline in VS Code Insiders, VSCodium, Cursor and Windsurf

The Cline extension keeps its MCP settings in the global storage of
whichever editor runs it. REA resolved only VS Code's, so a Cline in
another editor was never configured, inspected or cleaned. Add one
client-table row per editor, resolved through the shared Code-OSS user
data rule, and detected where that editor's Cline settings exist.

* test(setup): cover VSCODE_PORTABLE for Cline's editor hosts

Address review: VSCODE_PORTABLE moves only VS Code's own storage, so the other editors keep their settings path; and the older-release note now says which hosts mcp add could register before.
* fix(setup): find a Linux Flatpak Zed's configuration

Zed's config_dir honors FLATPAK_XDG_CONFIG_HOME first, and a Flathub Zed
reads ~/.var/app/dev.zed.Zed/config/zed inside its sandbox. REA always
wrote ~/.config/zed, which that Zed never reads. Honor the override, use
the sandbox folder when it is the only one, and refuse when both a
native and a Flatpak configuration exist.

* fix(setup): treat an XDG_CONFIG_HOME naming the Flatpak folder as one Zed folder
Comment thread src/application/SupportedClients.ts Resolved
Comment thread src/application/SupportedClients.ts Resolved
@morluto
morluto merged commit d044f44 into main Nov 15, 2026
97 of 101 checks passed
@morluto
morluto deleted the refactor/fold-mcp-add-clients branch November 15, 2026 09:04
@morluto morluto added area: setup Setup, packaging, upgrade, install, Doctor, and client registration enhancement New feature or request labels Nov 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: setup Setup, packaging, upgrade, install, Doctor, and client registration enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant