Skip to content

Commit ac8c2d9

Browse files
garysmurrayclaude
andcommitted
fix: align MCPB manifest with Claude Desktop's 0.2 routing
Surfaced when Disconnect started failing in Claude Desktop with `Invalid server ID format. Expected UUID or mcpsrv_* tagged ID.` on the new install. The error endpoint was the cloud logout API (`/api/.../mcp/logout/<server-id>`) — that path validates server IDs as UUID or `mcpsrv_*` and rejects our slug name. Compared our manifest against `local.mcpb.automattic.context-a8c` (another Automattic MCPB on the same machine that disconnects cleanly). Differences: - We generated `manifest_version: 0.3`; context-a8c is `0.2`. Claude Desktop's 0.3 handling appears to route disconnect through a different code path that's broken for slug-named bundles. - We were missing `display_name`. Without it Claude Desktop's UI falls back to `name` (the long machine slug) for both display AND internal routing, hitting the cloud-logout validator. - We were missing `license`, `homepage`, `repository`, and `compatibility.claude_desktop` / `compatibility.platforms` — fields context-a8c declares. Fix: align the manifest shape with context-a8c's known-working pattern. `manifest_version` pinned to `0.2`; `display_name` now populated as "WooCommerce for Claude — <hostname>" so the UI has a human label distinct from the machine slug; standard `license` / `homepage` / `repository` metadata included; `compatibility` expanded with `claude_desktop` floor and platform list. Verified the rebuilt manifest renders correctly via `McpbBundle::manifest()` — all expected fields present, `name` slug unchanged, `display_name` interpolates the store hostname. User needs to: 1. Manually remove the broken extension dir (Claude Desktop's disconnect button is still broken for the existing 0.3 install, so the workaround stands for THIS install — see PR description) 2. Reinstall the freshly-built woocommerce-claude.zip 3. Try Disconnect on the new bundle to confirm the fix 303 PHPUnit tests still pass; PHPCS clean. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent ffb9291 commit ac8c2d9

1 file changed

Lines changed: 44 additions & 6 deletions

File tree

includes/setup/class-mcpb-bundle.php

Lines changed: 44 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,9 +25,23 @@ class McpbBundle {
2525
/**
2626
* MCPB manifest schema version this bundle conforms to.
2727
*
28+
* Pinned to 0.2 because Claude Desktop's UI handles 0.2 manifests
29+
* along a different code path than 0.3 — disconnect for our 0.3
30+
* bundle was incorrectly routing through the cloud-logout
31+
* endpoint (`/api/.../mcp/logout/<server-id>`) which validates
32+
* server IDs as UUID or `mcpsrv_*`, rejecting our slug name. Other
33+
* working `local.mcpb.automattic.*` extensions on the same machine
34+
* (e.g. context-a8c) ship with 0.2 and disconnect cleanly.
35+
*
2836
* @see https://github.com/anthropics/mcpb/blob/main/MANIFEST.md
2937
*/
30-
const MANIFEST_VERSION = '0.3';
38+
const MANIFEST_VERSION = '0.2';
39+
40+
/**
41+
* Minimum Claude Desktop version required. Matches the floor that
42+
* other Automattic-shipped 0.2 manifests declare (e.g. context-a8c).
43+
*/
44+
const CLAUDE_DESKTOP_MIN_VERSION = '>=0.13.37';
3145

3246
/**
3347
* Minimum Node.js the bundled npx invocation requires.
@@ -84,11 +98,23 @@ public function manifest() {
8498

8599
return array(
86100
'manifest_version' => self::MANIFEST_VERSION,
87-
// Per-store identity so two WooCommerce for Claude stores installed in the
88-
// same Claude Desktop don't overwrite one another's
89-
// extension entries. SetupPage::server_slug() derives this
90-
// from the host (e.g. `woocommerce-claude-example-com`).
101+
// Per-store identity so two WooCommerce for Claude stores
102+
// installed in the same Claude Desktop don't overwrite one
103+
// another's extension entries. SetupPage::server_slug()
104+
// derives this from the host
105+
// (e.g. `woocommerce-claude-example-com`).
91106
'name' => SetupPage::server_slug(),
107+
// Human-facing label used by the Claude Desktop UI.
108+
// Without this, the UI falls back to `name` (the long
109+
// machine slug) which Claude Desktop's disconnect routing
110+
// rejects as malformed. Reproducible: a 0.2 manifest with
111+
// `display_name` set disconnects cleanly; the same shape
112+
// without it errors with `invalid_server_id`.
113+
'display_name' => sprintf(
114+
/* translators: %s: store hostname. */
115+
__( 'WooCommerce for Claude — %s', 'woocommerce-claude' ),
116+
$host
117+
),
92118
'version' => $this->plugin_version,
93119
'description' => sprintf(
94120
/* translators: %s: store hostname. */
@@ -99,6 +125,12 @@ public function manifest() {
99125
'name' => 'Automattic',
100126
'url' => 'https://woocommerce.com/',
101127
),
128+
'license' => 'GPL-3.0-or-later',
129+
'homepage' => 'https://woocommerce.com/',
130+
'repository' => array(
131+
'type' => 'git',
132+
'url' => 'https://github.com/woocommerce/woocommerce-claude',
133+
),
102134
'server' => array(
103135
'type' => 'node',
104136
'entry_point' => 'server/index.js',
@@ -117,7 +149,13 @@ public function manifest() {
117149
),
118150
),
119151
'compatibility' => array(
120-
'runtimes' => array(
152+
// Match the floor declared by other Automattic-shipped
153+
// 0.2 manifests — without this, Claude Desktop may
154+
// treat the install as version-unconstrained and route
155+
// it inconsistently.
156+
'claude_desktop' => self::CLAUDE_DESKTOP_MIN_VERSION,
157+
'platforms' => array( 'darwin', 'linux', 'win32' ),
158+
'runtimes' => array(
121159
'node' => self::NODE_MIN_VERSION,
122160
),
123161
),

0 commit comments

Comments
 (0)