Repository navigation
fix(mcp): register fx and MCPorter where they read their configuration - #10698
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
[Medium impact] The PR appears safe to merge with the checked stack, including PR #10712’s lifecycle-test isolation fix. SummaryMakes fx and MCPorter registrations follow their selected configuration paths.
Diagram%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[Client configuration selection] --> B{Client}
B -->|fx| C[Check FX_HOME or use default]
C --> D[Resolve physical folder]
D --> E[Reject home folder before chmod]
B -->|MCPorter| F[Explicit override or first existing candidate]
F --> G[Shared supported-client definition]
G --> H[Setup / doctor / update / uninstall]
H --> I{Location known?}
I -->|No| J[Report unknown and recovery]
I -->|Yes| K[Inspect or maintain selected registration]
Reviews (4) · Last reviewed commit: "feat(setup): let doctor, update and unin..." · Reviewed by Greptile |
9f96c73 to
6b7d00c
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9f96c73508
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
6b7d00c to
e395912
Compare
d47e88f to
bb48de8
Compare
478e09b to
17d3f35
Compare
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 17d3f3507b
ℹ️ 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".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
|
Fixed in 441e26c (carried into #10709's shared |
441e26c to
a646960
Compare
e00a1c5 to
02f9936
Compare
015b60d to
d0ed155
Compare
fx reads $FX_HOME/mcp.json when FX_HOME is set, and MCPorter reads MCPORTER_CONFIG exclusively or prefers an absolute XDG_CONFIG_HOME file. rea mcp add always wrote ~/.fx/mcp.json and ~/.mcporter/mcporter.json, which those clients then ignored. Resolve both from the clients' own rules, and refuse an FX_HOME fx itself refuses.
…ases Address review findings: MCPORTER_CONFIG now also names the detection marker, so default registration includes MCPorter when only that file exists, and is resolved with path.resolve as MCPorter does. FX_HOME with . or .. segments is refused, so the private profile mode cannot reach the home folder through an alias. Override tests use the host's path rules for real temporary paths.
A linked parent in FX_HOME can name the caller's home folder after the textual root and home checks pass. The private profile writer now compares the opened folder's identity with the caller's home folder and refuses before changing modes or publishing.
…ons (#10702) * feat(setup): let doctor, update and uninstall see MCPorter registrations MCPorter becomes a client-table row, so a registration rea mcp add or rea setup --client mcporter wrote is inspected, refreshed and removed like other clients. MCPorter already imports setup-managed clients' registrations, so the row is applicable only through REA's own registration: setup never selects it from detection and doctor reports it only when its file holds a rea row or the caller selects it. A relative MCPORTER_CONFIG is refused because MCPorter resolves it per command directory. * fix(setup): detect MCPorter by the folder of the file it loads With an absolute XDG_CONFIG_HOME and only a legacy ~/.mcporter file, the row returned the legacy file but the absent XDG folder as its detection evidence, so default registration and setup skipped MCPorter. * fix(setup): keep an unresolved client unknown without blocking others' maintenance A client whose configuration location cannot be resolved (for example a relative MCPORTER_CONFIG) is reported as unknown, never missing or absent. Update maintenance leaves each unresolved client out of its scope and names it with its own recovery, while still maintaining the other clients; uninstall still stops, because it cannot tell whether that client's file holds REA's row. * docs(setup): restore MCPorter's release note and client-table row after rebase * fix(update): keep unknown clients in every failed maintenance plan
d0ed155 to
72d05c9
Compare
When a client's configuration location cannot be resolved, such as Claude Desktop with migrated Claude-Data storage, setup refuses to write it and the user has to register REA by hand. The client picker still said "Existing configuration needs repair before setup" (6.9.0, where the state is invalid) or "Detected · choose to configure" (main, where morluto#10698 records it as unknown), and neither is true. Show "Configuration location unresolved · register REA manually" for any client with a location error, and keep the repair hint for configurations that are actually malformed. Fixes morluto#11697
* fix(setup): name an unresolved client location in the picker When a client's configuration location cannot be resolved, such as Claude Desktop with migrated Claude-Data storage, setup refuses to write it and the user has to register REA by hand. The client picker still said "Existing configuration needs repair before setup" (6.9.0, where the state is invalid) or "Detected · choose to configure" (main, where #10698 records it as unknown), and neither is true. Show "Configuration location unresolved · register REA manually" for any client with a location error, and keep the repair hint for configurations that are actually malformed. Fixes #11697 * test(setup): type picker fixtures as SetupClientState The journey fixtures used array paths and a marker field that setup never sends, and omitted registrationProfile. They now satisfy the production contract so the type checker rejects drift. --------- Co-authored-by: morluto <[email protected]>
Summary
rea mcp addregistered fx and MCPorter at fixed home paths that those clients may not read. It now resolves each path with the client's own override rules.Refs #7181. This bug was found while researching the mcp-add-only clients, and fixing it is a prerequisite for folding fx and MCPorter into the client table.
Problem and expected behavior
FX_HOMEis set, fx reads$FX_HOME/mcp.json. It accepts only an absolute path other than/and the home folder, and ignores trailing slashes (useFxHome, profile_paths.zig). REA always wrote~/.fx/mcp.json.MCPORTER_CONFIG(trimmed,~expanded, resolved against the cwd) is the only file loaded. Otherwise MCPorter loads the first existing of$XDG_CONFIG_HOME/mcporter/mcporter.json[c](absolute only), then~/.mcporter/mcporter.json[c]. A new home file goes to the XDG path when that is set (listConfigLayerPaths,mcporterConfigCandidates,expandHomein openclaw/mcporter; config.md). REA always used~/.mcporter.Either way, the result was
configuredwhile the client never loaded the registration.Change and scope
McpRegistrationLocations.ts:fxLocationhonorsFX_HOMEand refuses a value fx refuses, with aConfigurationErrorbefore any write.mcporterLocationfollows MCPorter's candidate order andMCPORTER_CONFIG.FLATPAK_XDG_CONFIG_HOME;settings.jsonc;Contract and boundary impact
Semantic owner and earliest changed stage: the fx and MCPorter location resolvers.
Contribution scope fit and linked maintainer decision: maintainer-requested W8/D5 workstream; ordinary fix within existing boundaries.
CLI and MCP/tool-catalog contract:
config_pathin the report reflects the overrides. An invalidFX_HOMEnow fails that client with aConfigurationError.Provider, bridge, target-format, or platform compatibility: none.
Evidence, artifact, provenance, or reconstruction contract: none.
Target selection, authority, upstream behavior, and cleanup details: writes go only where the client reads. No new authority.
Generated metadata, package, or installation impact: none.
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
src/application/McpRegistrationCatalog.test.ts.FX_HOMEwith a trailing slash, and refusal of a relative path,/, the home folder, and the home folder with a trailing slash..jsoncunder XDG, an XDG file taking precedence over a legacy file, a relative XDG value being ignored, andMCPORTER_CONFIGwith whitespace and~.Validation performed
npm run test:local -- src/application/McpRegistrationCatalog.test.ts— 31 passed. 8 failed withMcpRegistrationLocations.tsstashed.npm run test:local -- src/application/McpClientRegistration.test.ts src/application/McpClientRegistration.formats.test.ts— 47 passed, 1 skipped.npm run check:fast— passed.npm run docs:check— passed.Compatibility, safety, and release
FX_HOMEorMCPORTER_CONFIG/XDG set now gets a registration the client loads. Earlier stray files at the old default paths are left as they were.platform: "linux"on macOS.FX_HOMEfolder, as they were to~/.fx.Author readiness
Human owner:
Before merge
type(scope): outcome.