Repository navigation
Add meta.mcp.public to the media and terms abilities for MCP exposure - #12
Merged
Merged
Conversation
PLAN-mcp-adapter-poc.md step 1.5 (sec. 1 resolution, sec. 4.0): the 8 media/terms abilities — wp/media-query, wp/media-upload, wp/media-update, wp/media-delete, wp/terms-query, wp/term-create, wp/term-update, wp/term-delete — did not carry the public meta, so the MCP adapter's McpAbilityExposure falls back to meta.public and excludes them from the MCP surface. This adds the MCP-specific flag mcp => array( public => true ) to their ability_meta(), which McpAbilityExposure checks first, without changing their high-level publicness (no public key added) — the team decides between the mcp flag and full meta.public before this lands on the package's main. annotations/show_in_rest and every other meta key are untouched; no other ability changes. The Registrar's Gate-6 public_only probe reads the ability's own public meta only — the flag is additive there. Tests: the registered-once tests of the 8 abilities (media-query/upload/ update/delete, terms-query, and the term-writes contract test) each now also assert the exact mcp meta shape ( array( public => true ) ) and that the high-level public meta is unchanged (get_meta_item( 'public', false ) === false). No assertions were deleted.
This was referenced Oct 30, 2026
This was referenced Nov 8, 2026
8 of 9 tasks
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?
Adds
'mcp' => array( 'public' => true )to theability_meta()of the 8 media and terms abilities —wp/media-query,wp/media-upload,wp/media-update,wp/media-delete,wp/terms-query,wp/term-create,wp/term-update,wp/term-delete.Why?
These abilities carry
annotations+show_in_restmeta only — no high-levelpublicflag — so MCP consumers that resolve exposure viameta.publicalone would never surface them. The MCP adapter'sMcpAbilityExposurechecksmeta.mcp.publicfirst (falling back tometa.public), which lets these abilities opt in to the MCP surface without changing their high-level publicness (deliberately — see the open question below).This PR is one half of the PoC pair proving consumer #1 (the MCP adapter) consuming this package end to end (PoC plan, step 1.5); the adapter PoC pins this branch so all 18 abilities are testable.
How?
ability_meta()arrays gain themcpkey appended aftershow_in_rest(additive, line-preserving);annotationsandshow_in_restuntouched; no other abilities touched.mcpexact shape and that high-levelpublicis unchanged, exercised on both wp-env environments (expansion only — zero assertion deletions).Open question for the team (why this PR is deliberately open, not merged)
meta.mcp.public(this PR) vs. promoting the 8 abilities to fullmeta.public— which semantic should the package carry? The MCP-specific flag preserves the abilities' high-level non-public status (upstream-faithful to the WordPress/ai ports); fullpublicis simpler but changes more than the MCP use case needs. The team decides; the adapter PoC works with either resolution.Follow-up noted (not blocking)
The Registrar's
public_onlydocblock calls it "the MCP-tool use case," but the probe checks onlymeta.public— the two layers' semantics should stay consistent (extend the probe to honormeta.mcp.public, or reword the docblock). Tracked for a follow-up issue.Use of AI tools
Tool(s): goose (agent). Model(s): glm-5.3-flash:cloud via the harness. Used for: implementation, tests, and this description's drafting basis (plan-driven per PLAN-mcp-adapter-poc §1/§4.0/§7.3). Reviewed and edited by the committer.
Testing Instructions
composer run lint:phpcs && composer run lint:phpstan && composer run verify:manifest && composer run verify:coreify— all clean.mcpexact-shape andpublic-unchanged assertions pass alongside the full suite (one pre-existing upstream-faithful cast warning, unchanged by this diff).