Disable automatic CWD project fallback config discovery - #12
Conversation
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 6d08081f4b
ℹ️ 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".
| func defaultFallbackSourcePathsForCWD(cwd string) []string { | ||
| _ = cwd |
There was a problem hiding this comment.
Restore an opt-in path for project-local fallback configs
Ignoring cwd here removes the only code path that ever added the nearest-parent .mcp.json / .kiro/settings/mcp.json files to the default fallback set. That means any trusted repo that relied on project-local MCP config for zero-config onboarding now regresses to mcpx listing no servers (or unknown server) unless the user manually copies those entries into a global config. fallback_sources is not an equivalent workaround because it is a static path list from config.toml, not “the nearest file under the request CWD”, so this change removes the feature entirely instead of making it explicit/opt-in.
Useful? React with 👍 / 👎.
…shadowing (#36) * fix: stop CWD config discovery, listing probes, and fallback command shadowing Rewrite the still-valid security/correctness fixes from stale PRs #12, #11, and #10 onto current main. Bare mcpx stays config-only, project-local .mcp.json is no longer auto-imported, and fallback merge is skipped when managed servers already exist. * fix: align fallback watch with managed config and keep named virtual servers Skip merge and source watching only when config.toml has MCPXConfig origins, not whenever cfg.Servers is non-empty. Filter reserved CLI names from fallback discovery, and resolve explicit --help / shim install targets via list_tools so Codex virtual servers still work.
|
Superseded by #36 (landed on main). Closing this stale March branch. |
Motivation
.mcp.jsonand.kiro/settings/mcp.json), which allowed untrusted repositories to inject MCP server definitions and enlarged the RCE/SSRF attack surface.Description
nearestUpwardPath(...)indefaultFallbackSourcePathsForCWDand removing the now-unusednearestUpwardPathbehavior ininternal/config/fallback.go.~/.cursor/mcp.json,~/.claude.json, and~/.codex/config.tomlintact to preserve expected default behavior.internal/config/fallback_test.goto reflect that project-local configs are no longer auto-discovered and removed theTestNearestUpwardPathFindsNearestParentunit test that validated upward discovery.CODEX_HOMEwithin the test (t.Setenv("CODEX_HOME", "")) so auth file resolution is not environment-dependent.Testing
go test ./...and all packages passed after test updates (internal/configand the rest of the repo succeeded).go vet ./...andgo build ./...and both completed without errors.internal/configwere executed and validate the new behavior (no project-local upward discovery by default).Codex Task