Skip to content

fix(mcp): run beside the mcp adapter 0.7.0 instead of fatalling (#340) - #342

Merged
ifahimreza merged 1 commit into
mainfrom
fix/340-mcp-adapter-070
Oct 6, 2026
Merged

ifahimreza merged 1 commit into
mainfrom
fix/340-mcp-adapter-070

Conversation

@ifahimreza

@ifahimreza ifahimreza commented Oct 6, 2026 •

Copy link
Copy Markdown
Contributor

Closes #340. Follow-up for full 0.7.0 support: #341

The bug

MCP Adapter 0.7.0 (2026-10-02) took down any Saddle site that installed it:

  1. Activation fatal (builds with the bundled adapter): Cannot declare class WP\MCP\Autoloader. The bundle was already loaded; the plugin's require_once is a different path.
  2. Every request fatal (every build, including WordPress.org 1.5.0): Too few arguments to McpServer::get_tools(). 0.7.0 made get_tools(), get_resources() and get_prompts() require the request's protocol schema; Saddle called them bare in record_server_health() and filter_adapter_initialize().
  3. Right after deactivating the adapter, one more request could fatal: the bundle's Jetpack Autoloader picked the inactive plugin's newer classes from its cache.

The fix

  • Saddle_Bundled_Adapter::standalone_installed(): with an official plugin folder present (mcp-adapter*/mcp-adapter.php, active or not), the bundle stays off. Activation can't collide, and the bundle's autoloader never meets the newer copy.
  • Saddle::adapter_is_current() also probes McpServer::get_tools(): if it wants arguments (0.7.0), the adapter is treated like WooCommerce's too-old 0.1.0 and the built-in transport serves /saddle/v1/mcp. The adapter's own default server keeps running for other plugins (Bridle's abilities included).
  • Saddle_MCP::server_list() wraps every server-list call and skips a method that wants arguments, so a stray path can't fatal again.
  • Changelog under the drafted 1.5.2.

Verified

  • Live on the plug-press dev site (WP 7.1.2, Saddle + Pro + Analytics active): wp plugin activate mcp-adapter now succeeds (was the fatal); home, wp-json, /saddle/v1/mcp and the adapter's default server all answer; adapter_available=false, standalone_installed=true. A real session on /saddle/v1/mcp lists 94 tools (16 Bridle / Bridle KB); mcp-adapter-execute-ability runs bridle/list-conversations on the adapter's server.
  • New tests: the probe (0.6.1-shaped vs 0.7.0-shaped server), server_list(), the guard (temp plugins dir, mcp-adapter-0.7.0 folder). composer test: 1453 OK (1 skipped, as on main). phpcs: no new findings in includes/saddle.php.
  • The test install of the adapter on the dev site was removed afterwards.

🤖 Generated with Claude Code


View with [code]smith Autofix with [code]smith
Need help on this PR? Tag @codesmith-bot with what you need. Autofix is disabled.

MCP Adapter 0.7.0 (2026-10-02) broke Saddle two ways (#340):

- Activating it on a Saddle site redeclared WP\MCP\Autoloader: the
  bundled copy was already loaded and the plugin's require_once is a
  different path. The bundle now stays off whenever an official plugin
  folder (mcp-adapter*/mcp-adapter.php) is installed, active or not, so
  activation can't collide and its Jetpack Autoloader can't pick up the
  plugin's newer classes.
- With both active, every request fatalled: get_tools(), get_resources()
  and get_prompts() now require the request's protocol schema. A server
  with that API is not "current" (adapter_is_current() probes it), so the
  built-in transport serves /saddle/v1/mcp, as with WooCommerce's 0.1.0.
  Saddle's own server-list calls go through server_list(), which skips a
  method that wants arguments.

Full 0.7.0 support (the typed records, a re-vendor) is a follow-up.

Closes #340

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@ifahimreza
ifahimreza merged commit 6295650 into main Oct 6, 2026
9 checks passed
@ifahimreza
ifahimreza deleted the fix/340-mcp-adapter-070 branch October 6, 2026 17:32
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.

Fatal with the WordPress MCP Adapter 0.7.0 (activation and every request)

1 participant