Skip to content

Try: Update wordpress/mcp-adapter to v0.5.0 (dev-trunk) - #64052

Draft
galatanovidiu wants to merge 2 commits into
trunkfrom
try/update-to-mcp-adapter-version-0.5.0
Draft

galatanovidiu wants to merge 2 commits into
trunkfrom
try/update-to-mcp-adapter-version-0.5.0

Conversation

@galatanovidiu

Copy link
Copy Markdown

Submission Review Guidelines:

Changes proposed in this Pull Request:

Updates the wordpress/mcp-adapter Composer dependency from ^0.3.0 to dev-trunk (upcoming v0.5.0). This is a draft for others to try the new adapter — not intended for merge yet.

What changed in the adapter:

  • Typed protocol DTOs via new wordpress/php-mcp-schema ^0.1.0 dependency
  • MCP spec updated from 2025-06-18 to 2025-11-25
  • Interfaces moved from WP\MCP\Transport\Interfaces\ to WP\MCP\Transport\Contracts\
  • HttpTransport::check_permission() now casts results to bool and uses fail-closed security (returns false on error)
  • McpTransportContext constructor now validates required/optional keys strictly
  • Composer package type changed from library to wordpress-plugin

What changed in WooCommerce:

  • composer.json: Version bump + installer-paths override to keep the package in vendor/ (needed because the package type changed)
  • composer.lock: Regenerated with new dependency tree
  • No PHP code changes — all public APIs used by WooCommerce (McpAdapter::create_server(), HttpTransport, transport interfaces) are backward compatible

Pre-existing issues found during E2E testing (not caused by this update):

Full MCP Inspector E2E testing revealed issues that exist on trunk today and are unrelated to the adapter update:

  1. Output schema validation failures (8 of 9 tools) — All product/order tools (except products-delete) fail strict schema validation because:

    • Date-time fields lack timezone suffix (2026-04-07T16:06:06 instead of RFC 3339 2026-04-07T16:06:06Z)
    • Nullable fields (date_on_sale_from, stock_quantity, date_paid, etc.) return null but schemas declare them as string/integer without allowing null
    • shipping_class_id schema says string, API returns integer
    • external_url and billing.email use format constraints (uri, email) but return empty strings
  2. isError flag not set on error responses — When tools like products-get or orders-get receive a non-existent ID, the server returns the error payload but with isError: false. MCP clients rely on isError: true to distinguish errors from successful results.

These issues should be tracked and addressed in separate PRs.

How to test the changes in this Pull Request:

  1. Check out this branch and run composer install from plugins/woocommerce/
  2. Start wp-env: pnpm --filter=@woocommerce/plugin-woocommerce wp-env start
  3. Enable the MCP feature: pnpm --filter=@woocommerce/plugin-woocommerce wp-env run cli wp option update woocommerce_feature_mcp_integration_enabled yes
  4. Run unit tests:
    pnpm --filter=@woocommerce/plugin-woocommerce test:php:env -- --filter MCPAdapterProviderTest
    pnpm --filter=@woocommerce/plugin-woocommerce test:php:env -- --filter WooCommerceRestTransportTest
    
  5. Verify all 25 tests pass (10 + 15)
  6. For E2E testing, use the woocommerce-mcp-inspector skill or follow the manual steps:
    • Set up insecure transport mu-plugin (for local HTTP)
    • Create a WooCommerce API key
    • Run npx @modelcontextprotocol/inspector@latest --cli against the endpoint
    • Verify tools/list returns all 9 tools and tools/call executes successfully

Testing that has already taken place:

  • PHPStan: No errors on MCPAdapterProvider.php and WooCommerceRestTransport.php
  • Unit tests: 25 tests, 37 assertions — all pass
  • PHP lint: Clean on all changed files
  • API surface diff: Full comparison of v0.3.0 vs v0.5.0 public APIs — all WooCommerce-used classes/interfaces/methods are backward compatible
  • Integration test: MCP initialize handshake returns valid response with protocol version 2025-11-25
  • E2E test: Full CRUD cycle (products + orders) via MCP Inspector CLI — all operations succeed server-side
  • Autoload verification: All MCP classes/interfaces load correctly in wp-env (including renamed Contracts namespace)

Milestone

Changelog entry

  • This Pull Request does not require a changelog entry. (Comment required below)
Changelog Entry Comment

Comment

Draft PR for testing the new MCP adapter version — not intended for merge yet.

Typed protocol DTOs via wordpress/php-mcp-schema, updated MCP spec
to 2025-11-25. All WooCommerce public API usage is backward compatible.
Added installer-paths override to keep package in vendor/ after its
Composer type changed from library to wordpress-plugin.
E2E testing skill for the WooCommerce MCP server using the official
MCP Inspector CLI against a local wp-env instance. Covers environment
setup, authentication, tool discovery, CRUD testing, and debugging.
@github-actions github-actions Bot added focus: monorepo infrastructure Issues and PRs related to monorepo tooling. plugin: woocommerce Issues related to the WooCommerce Core plugin. labels Apr 7, 2026
@galatanovidiu

Copy link
Copy Markdown
Author

MCP Inspector Testing Skill

This PR includes a new Claude Code skill (woocommerce-mcp-inspector) that automates E2E testing of the WooCommerce MCP server using the official MCP Inspector CLI.

To use it, invoke /woocommerce-mcp-inspector in Claude Code. It handles:

  • wp-env environment setup (feature flag, insecure transport mu-plugin, API key creation)
  • Full tool discovery via tools/list
  • CRUD testing for all discovered resource groups (products, orders)
  • Error handling verification
  • A structured test report at the end

The skill is read-only / test-only — it will never modify source code.

@FawadNL

FawadNL commented Apr 21, 2026

Copy link
Copy Markdown

When creating an order, it returns an error about a count, even though the order gets created:
image

@FawadNL

FawadNL commented May 15, 2026

Copy link
Copy Markdown

@galatanovidiu the error mentioned before only comes when using Gemini Flash model, but there are no errors when using Claude Sonnet 4.6 for example. So its dependent on the power of the model. Have decided to only allow Claude Sonnet as model as its the most reliable so far.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

focus: monorepo infrastructure Issues and PRs related to monorepo tooling. plugin: woocommerce Issues related to the WooCommerce Core plugin.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants