Add Connect admin page and bundle MCP Adapter via Jetpack Autoloader#3
Merged
Merged
Conversation
Make Root for Agents work standalone and give operators a one-click way to connect a coding agent to the site over MCP. - Bundle wordpress/mcp-adapter (+ wordpress/php-mcp-schema) through Composer, loaded with the Jetpack Autoloader (vendor/autoload_packages.php) so multiple plugins shipping the adapter dedupe to a single newest version instead of fatally redeclaring classes. The main plugin now boots McpAdapter::instance() itself, so the separate MCP Adapter plugin is no longer required. - The src/ PSR-4 fallback autoloader now registers only when vendor/ is absent, avoiding a double-autoload "class already declared" fatal. - Add a "Root for Agents > Connect" admin page. Its Generate button mints a fresh WordPress application password, computes the MCP endpoint URL, and renders three copy-paste artifacts: a natural-language agent prompt, a `claude mcp add` CLI command, and an mcpServers JSON block. Auth is HTTP Basic using the application password. - Update README.md and readme.txt for the bundled adapter and Connect workflow. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Switch the copy-paste connection instructions from a direct HTTP transport (Authorization: Basic header) to Automattic's @automattic/mcp-wordpress-remote stdio proxy, run locally via `npx`. All three artifacts (agent prompt, claude mcp add CLI command, and mcpServers JSON) now pass WP_API_URL, WP_API_USERNAME, and WP_API_PASSWORD (the application password) as environment variables, with OAUTH_ENABLED=false so the proxy uses application-password auth. Update README and readme.txt accordingly. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Committing ~314 Composer-managed vendor files bloated the repo. Instead: - gitignore /vendor/ (and /dist/, *.zip) and remove the tracked vendor tree; composer.lock stays tracked for reproducible installs. - Add .github/workflows/release.yml: on a v* tag (or manual dispatch) it runs `composer install --no-dev --optimize-autoloader`, stages the plugin with dev-only files excluded, bundles the freshly built vendor/, zips it, uploads the artifact, and attaches it to the GitHub release. - Update README install notes: run `composer install` from a source checkout; packaged release zips already include vendor/. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Summary
Makes Root for Agents work standalone and adds a one-click way to connect a coding agent to the site over MCP.
wordpress/mcp-adapter(+wordpress/php-mcp-schema) through Composer, loaded with the Jetpack Autoloader (vendor/autoload_packages.php). When multiple plugins ship the adapter, the Jetpack Autoloader dedupes them to a single newest version instead of fatally redeclaring classes. The main plugin now bootsMcpAdapter::instance()itself, so the separate MCP Adapter plugin is no longer required.src/PSR-4 fallback autoloader now registers only whenvendor/is absent (e.g. a source checkout beforecomposer install), fixing a double-autoload "class already declared" fatal.claude mcp addCLI command, and anmcpServersJSON block./wp-json/mcp/mcp-adapter-default-server; our abilities are surfaced there viaexecute-ability.README.mdandreadme.txt.Testing
Verified inside the running WordPress install:
WP\MCP\*,WP\McpSchema\*, andRootForAgents\*classes autoload; adapter v0.5.0 active; no fatals./mcp/mcp-adapter-default-serverregistered.initialize→ 200 +Mcp-Session-Idtools/list→ returns the adapter toolsAuthorization: Basic …header.🤖 Generated with Claude Code