Skip to content

feat: improve MCP sync UX (enable/disable/status, *bool semantics)#45

Open
sametbrr wants to merge 1 commit into
tawanorg:mainfrom
sametbrr:feat/mcp-sync-ux
Open

feat: improve MCP sync UX (enable/disable/status, *bool semantics)#45
sametbrr wants to merge 1 commit into
tawanorg:mainfrom
sametbrr:feat/mcp-sync-ux

Conversation

@sametbrr

Copy link
Copy Markdown

This is one of two focused PRs that replace #40 (which bundled paths + MCP + docs into a single 688-line change). This PR contains only the MCP sync UX work; the paths redesign is a separate PR.

What changed

New mcp subcommands:

  • mcp status — shows auto-sync state, configured server count, and whether there are unpushed local changes.
  • mcp enable — writes mcp_sync: true and immediately pushes the current MCP state, so enabling auto-sync syncs right away. Subsequent push/pull auto-include MCP.
  • mcp disable — writes mcp_sync: false explicitly so the disabled state is visible in config.

--include-mcp on push/pull still works for one-off syncs without changing config.

On the *bool design (re: review feedback on #40)

The MCPSync config field becomes *bool with omitempty. This was a deliberate choice over a config migration, and I think it's the simpler option here:

  • nil (field absent) reads as disabled — every existing config keeps working untouched, so there is no migration step and no risk of rewriting users' config files on load.
  • &true = auto-sync enabled.
  • &false = explicitly disabled, written to config so the state is visible/inspectable (a plain bool + omitempty can't distinguish "off" from "unset").

So the three states (unset / on / off) are encoded in the type itself. A migration would have to detect old configs and rewrite them on first load to achieve the same backward compatibility; the pointer keeps that logic out of the load path entirely.

Docs

CLAUDE.md and README.md updated to document the new mcp subcommands and the *bool field semantics.

Scope

Diff is limited to MCP only: cmd/claude-sync/main.go (3 new subcommands + 2 push/pull check sites), internal/config/config.go (field type), internal/config/config_test.go (adapt existing test to the new type), and the MCP doc sections.

Add `mcp status`, `mcp enable`, and `mcp disable` subcommands and make the
auto-sync setting an explicit, inspectable tri-state.

- `mcp status` shows auto-sync state, configured server count, and whether
  there are unpushed local changes.
- `mcp enable` writes `mcp_sync: true` and immediately pushes the current MCP
  state, so enabling auto-sync syncs right away. Subsequent push/pull
  auto-include MCP.
- `mcp disable` writes `mcp_sync: false` explicitly so the disabled state is
  visible in config.

The `MCPSync` config field becomes `*bool` with `omitempty`:
- nil (field absent) reads as disabled, so old configs keep working with no
  migration step;
- &true = auto-sync enabled;
- &false = explicitly disabled and visible in config.

This keeps full backward compatibility while encoding all three states in the
type itself, avoiding a separate config-migration path.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant