fix: move mcp_servers to metadata.json to prevent silent plugin.json rejection
Claude Code's strict schema validation silently rejects plugins with unknown root-level fields in plugin.json (anthropics/claude-code#20409). Moved mcp_servers to separate metadata.json files. Updated install/uninstall/list scripts to read from new location. Added cache clearing to switch-profile.sh. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -68,16 +68,16 @@ get_available_plugins() {
|
||||
}
|
||||
|
||||
# --- Get MCP Servers for Plugin ---
|
||||
# Reads the mcp_servers array from plugin.json
|
||||
# Reads the mcp_servers array from metadata.json (separate from plugin.json to avoid schema validation issues)
|
||||
get_mcp_servers() {
|
||||
local plugin_name="$1"
|
||||
local plugin_json="$REPO_ROOT/plugins/$plugin_name/.claude-plugin/plugin.json"
|
||||
local metadata_json="$REPO_ROOT/plugins/$plugin_name/.claude-plugin/metadata.json"
|
||||
|
||||
if [[ ! -f "$plugin_json" ]]; then
|
||||
if [[ ! -f "$metadata_json" ]]; then
|
||||
return
|
||||
fi
|
||||
|
||||
jq -r '.mcp_servers // [] | .[]' "$plugin_json" 2>/dev/null || true
|
||||
jq -r '.mcp_servers // [] | .[]' "$metadata_json" 2>/dev/null || true
|
||||
}
|
||||
|
||||
# --- Check if plugin has any MCP servers defined ---
|
||||
|
||||
Reference in New Issue
Block a user