Add wp-ops mcp-register command - #182
Merged
Merged
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Detect-and-print helper for wiring wp-ops into an MCP client: checks
~/.claude.json,~/.vibe/config.toml, and~/.codex/config.tomlfor anexisting 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.shalready 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" — thatwasn't being overridden here.
mcp-registerfits the same narrower bucketdoctor/init/list/search/docsalready occupy: meta-tooling aboutwp-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/tomldep), rather thanstring-matching a file that was never parsed.
Behavior
mcp-server/run.sh's real path via the existingrepoRoot()helper (dev checkout via
WP_OPS_ROOT/walk-up, or the extracted-assetscache dir for a pure Homebrew install) — same resolution every other
command already uses.
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 myreal (non-trivial, pre-existing)
~/.vibe/config.tomland~/.codex/config.toml— both of which are already in real use here — findingno wp-ops entry in either, as expected.
Also
mcp-server/README.md: new "Quick check:wp-ops mcp-register" sectionahead of the three manual "Register with ..." sections.
go generateneeded,catalog.jsonuntouched.Version
Minor bump (5.1.4 → 5.2.0) — new capability.