Skip to content

Import cc-switch MCP servers selectively#2499

Open
SivanCola wants to merge 2 commits into
esengine:main-v2from
SivanCola:codex/mcp-selective-import
Open

Import cc-switch MCP servers selectively#2499
SivanCola wants to merge 2 commits into
esengine:main-v2from
SivanCola:codex/mcp-selective-import

Conversation

@SivanCola
Copy link
Copy Markdown
Collaborator

Summary

Adds a focused cc-switch MCP import path without bringing over the closed v1 desktop port:

  • reasonix mcp import imports Codex-enabled MCP servers from cc-switch into Reasonix config.
  • /mcp import in chat opens a selectable picker so risky or personal servers can be left unchecked.
  • Supports the current cc-switch SQLite store and legacy JSON backups.
  • Treats an existing but empty SQLite DB as authoritative, avoiding stale backup imports.

Root Cause

Users who already curate MCP servers in cc-switch had to re-enter those servers manually in Reasonix. The previous large PR mixed this useful import behavior with a wholesale v1 desktop frontend port, making the valuable MCP piece hard to review and merge independently.

Technical Approach

This PR keeps the change scoped to MCP import and config mutation:

  • Reads ~/.cc-switch/cc-switch.db with deterministic ORDER BY name filtering on Codex-enabled servers.
  • Falls back to legacy config.json, config.json.migrated, and config.json.bak only when the SQLite DB is absent.
  • Maps cc-switch server specs onto existing config.PluginEntry values and validates them through the existing plugin validator.
  • Adds a chat picker that defaults obviously risky candidates unchecked, while still allowing explicit selection.
  • Persists selected entries and attempts a live connection for the selected import, without changing startup behavior by itself.

Focused Optimization Points

  • Keeps successful import ordering deterministic.
  • Does not introduce auto_start semantics in this PR.
  • Does not touch internal/boot or plugin startup behavior.
  • Does not include any v1 frontend files, compatibility CSS, screenshots, attachments, or autoscroll changes.

Cache / Tool Schema Notes

This PR does not change the default provider-visible tool schema during normal startup. Tool schema changes only happen after an explicit user action (/mcp import) or on the next session after imported MCP servers are present in config, which matches existing MCP add behavior.

Verification

Passed:

  • go test ./internal/config ./internal/control ./internal/cli
  • go test ./internal/agent -run TestPlanModeDoesNotMutateSystemOrTools
  • go test ./internal/plugin ./internal/config ./internal/control ./internal/cli

Also ran go test ./...; it failed in internal/boot TestBuildDiscoversSkills because this local machine's global skills were discovered and included in the boot prompt. The failure is environment-dependent and unrelated to this PR's MCP import changes.

@github-actions github-actions Bot added the v2 Go rewrite (1.x) — main-v2 branch, active development label Jun 1, 2026
Copy link
Copy Markdown

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: aabac57156

ℹ️ 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".

Comment thread internal/config/ccswitch.go Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

v2 Go rewrite (1.x) — main-v2 branch, active development

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant