Skip to content

Add wp-ops mcp-register command - #182

Merged
jasperf merged 1 commit into
mainfrom
feature/mcp-register
Aug 6, 2026
Merged

Add wp-ops mcp-register command#182
jasperf merged 1 commit into
mainfrom
feature/mcp-register

Conversation

@jasperf

@jasperf jasperf commented Aug 6, 2026

Copy link
Copy Markdown
Contributor

What

Detect-and-print helper for wiring wp-ops into an MCP client: checks
~/.claude.json, ~/.vibe/config.toml, and ~/.codex/config.toml for an
existing wp-ops entry, and for whichever ones are missing it, prints the
exact block to paste — with the real resolved path to mcp-server/run.sh
already filled in, not a placeholder.

Why native Go, not a catalog script

Discussed in conversation: the repo's stated convention
(docs/go-mcp-parity.md) is "a new capability lands as a script first" — that
wasn't being overridden here. mcp-register fits the same narrower bucket
doctor/init/list/search/docs already occupy: meta-tooling about
wp-ops's own setup, not a WordPress/Trellis/curl operation, which is what the
script-first rule is actually about. It also gets a real correctness win from
Go's stdlib: Claude's config is validated as actual JSON, and Mistral's/Codex's
as actual TOML (new github.com/BurntSushi/toml dep), rather than
string-matching a file that was never parsed.

Behavior

  • Read-only — never writes to a config file it doesn't own.
  • Resolves mcp-server/run.sh's real path via the existing repoRoot()
    helper (dev checkout via WP_OPS_ROOT/walk-up, or the extracted-assets
    cache dir for a pure Homebrew install) — same resolution every other
    command already uses.
  • Four states handled per client: file missing (prints the full snippet to
    create it with), already registered, needs registration (prints the block
    to add), and parse error (reports it, points at the manual README section).

Manually verified against my own machine: correctly reported "already
registered" for Claude Code's real ~/.claude.json, and correctly parsed my
real (non-trivial, pre-existing) ~/.vibe/config.toml and
~/.codex/config.toml — both of which are already in real use here — finding
no wp-ops entry in either, as expected.

Also

  • mcp-server/README.md: new "Quick check: wp-ops mcp-register" section
    ahead of the three manual "Register with ..." sections.
  • Not a catalog command — no go generate needed, catalog.json untouched.

Version

Minor bump (5.1.4 → 5.2.0) — new capability.

@jasperf
jasperf merged commit f4b0e1d into main Aug 6, 2026
1 check passed
@jasperf
jasperf deleted the feature/mcp-register branch August 6, 2026 01:36
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