fix(plugins): remove broken mcpServers references that broke plugin loading

The MCP consolidation commit (afd4c44) deleted plugin-level .mcp.json files
but left references to them in plugin.json and marketplace.json. This caused
7 plugins to fail loading (projman, pr-review, cmdb-assistant, data-platform,
viz-platform, contract-validator, and indirectly git-flow/clarity-assist).

Changes:
- Remove mcpServers field from 6 plugin.json files (file no longer exists)
- Remove mcpServers field from 6 marketplace.json entries
- Add file reference validation to validate-marketplace.sh:
  - Validates mcpServers references point to existing files
  - Validates hooks references point to existing files
  - Validates commands references point to existing paths
- Add pre-commit hook (.git/hooks/pre-commit) to enforce validation

The validation script will now FAIL if any config file references a
non-existent file, preventing this class of bug from happening again.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-29 18:09:08 -05:00
parent ce106ace8a
commit c8b91f6a87
8 changed files with 103 additions and 18 deletions

View File

@@ -20,7 +20,6 @@
}, },
"homepage": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace/src/branch/main/plugins/projman/README.md", "homepage": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace/src/branch/main/plugins/projman/README.md",
"repository": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace.git", "repository": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace.git",
"mcpServers": ["./.mcp.json"],
"category": "development", "category": "development",
"tags": ["sprint", "agile", "gitea", "project-management"], "tags": ["sprint", "agile", "gitea", "project-management"],
"license": "MIT" "license": "MIT"
@@ -84,7 +83,6 @@
}, },
"homepage": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace/src/branch/main/plugins/cmdb-assistant/README.md", "homepage": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace/src/branch/main/plugins/cmdb-assistant/README.md",
"repository": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace.git", "repository": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace.git",
"mcpServers": ["./.mcp.json"],
"category": "infrastructure", "category": "infrastructure",
"tags": ["cmdb", "netbox", "dcim", "ipam", "data-quality", "validation"], "tags": ["cmdb", "netbox", "dcim", "ipam", "data-quality", "validation"],
"license": "MIT" "license": "MIT"
@@ -145,7 +143,6 @@
}, },
"homepage": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace/src/branch/main/plugins/pr-review/README.md", "homepage": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace/src/branch/main/plugins/pr-review/README.md",
"repository": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace.git", "repository": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace.git",
"mcpServers": ["./.mcp.json"],
"category": "development", "category": "development",
"tags": ["code-review", "pull-requests", "security", "quality"], "tags": ["code-review", "pull-requests", "security", "quality"],
"license": "MIT" "license": "MIT"
@@ -161,7 +158,6 @@
}, },
"homepage": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace/src/branch/main/plugins/data-platform/README.md", "homepage": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace/src/branch/main/plugins/data-platform/README.md",
"repository": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace.git", "repository": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace.git",
"mcpServers": ["./.mcp.json"],
"category": "data", "category": "data",
"tags": ["pandas", "postgresql", "postgis", "dbt", "data-engineering", "etl"], "tags": ["pandas", "postgresql", "postgis", "dbt", "data-engineering", "etl"],
"license": "MIT" "license": "MIT"
@@ -177,7 +173,6 @@
}, },
"homepage": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace/src/branch/main/plugins/viz-platform/README.md", "homepage": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace/src/branch/main/plugins/viz-platform/README.md",
"repository": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace.git", "repository": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace.git",
"mcpServers": ["./.mcp.json"],
"category": "visualization", "category": "visualization",
"tags": ["dash", "plotly", "mantine", "charts", "dashboards", "theming", "dmc"], "tags": ["dash", "plotly", "mantine", "charts", "dashboards", "theming", "dmc"],
"license": "MIT" "license": "MIT"
@@ -193,7 +188,6 @@
}, },
"homepage": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace/src/branch/main/plugins/contract-validator/README.md", "homepage": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace/src/branch/main/plugins/contract-validator/README.md",
"repository": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace.git", "repository": "https://gitea.hotserv.cloud/personal-projects/leo-claude-mktplace.git",
"mcpServers": ["./.mcp.json"],
"category": "development", "category": "development",
"tags": ["validation", "contracts", "compatibility", "agents", "interfaces", "cross-plugin"], "tags": ["validation", "contracts", "compatibility", "agents", "interfaces", "cross-plugin"],
"license": "MIT" "license": "MIT"

View File

@@ -19,6 +19,5 @@
"data-quality", "data-quality",
"validation" "validation"
], ],
"commands": ["./commands/"], "commands": ["./commands/"]
"mcpServers": ["./.mcp.json"]
} }

View File

@@ -18,6 +18,5 @@
"interfaces", "interfaces",
"cross-plugin" "cross-plugin"
], ],
"commands": ["./commands/"], "commands": ["./commands/"]
"mcpServers": ["./.mcp.json"]
} }

View File

@@ -19,6 +19,5 @@
"etl", "etl",
"dataframe" "dataframe"
], ],
"commands": ["./commands/"], "commands": ["./commands/"]
"mcpServers": ["./.mcp.json"]
} }

View File

@@ -17,6 +17,5 @@
"performance", "performance",
"multi-agent" "multi-agent"
], ],
"commands": ["./commands/"], "commands": ["./commands/"]
"mcpServers": ["./.mcp.json"]
} }

View File

@@ -17,6 +17,5 @@
"agile", "agile",
"lessons-learned" "lessons-learned"
], ],
"commands": ["./commands/"], "commands": ["./commands/"]
"mcpServers": ["./.mcp.json"]
} }

View File

@@ -20,6 +20,5 @@
"visualization", "visualization",
"dmc" "dmc"
], ],
"commands": ["./commands/"], "commands": ["./commands/"]
"mcpServers": ["./.mcp.json"]
} }

View File

@@ -158,9 +158,106 @@ for plugin_dir in "$PLUGINS_DIR"/*/; do
echo "WARNING: Missing README.md in $plugin_name/" echo "WARNING: Missing README.md in $plugin_name/"
fi fi
# CRITICAL: Validate file references exist (mcpServers, hooks, commands)
# This prevents broken references that silently break plugin loading
# Check mcpServers references
mcp_servers=$(jq -r '.mcpServers // [] | .[]' "$plugin_json" 2>/dev/null)
for mcp_ref in $mcp_servers; do
mcp_path="$plugin_dir/$mcp_ref"
if [[ ! -f "$mcp_path" ]]; then
echo "ERROR: BROKEN REFERENCE in $plugin_name/plugin.json"
echo " mcpServers references '$mcp_ref' but file does not exist at:"
echo " $mcp_path"
echo ""
echo " FIX: Either create the file or remove the mcpServers entry"
exit 1
fi
echo " ✓ mcpServers reference: $mcp_ref exists"
done
# Check hooks references (can be array of file paths OR object with handlers)
hooks_type=$(jq -r '.hooks | type' "$plugin_json" 2>/dev/null)
if [[ "$hooks_type" == "array" ]]; then
# Array format: ["./hooks/hooks.json"]
hooks=$(jq -r '.hooks[]' "$plugin_json" 2>/dev/null)
for hook_ref in $hooks; do
hook_path="$plugin_dir/$hook_ref"
if [[ ! -f "$hook_path" ]]; then
echo "ERROR: BROKEN REFERENCE in $plugin_name/plugin.json"
echo " hooks references '$hook_ref' but file does not exist at:"
echo " $hook_path"
echo ""
echo " FIX: Either create the file or remove the hooks entry"
exit 1
fi
echo " ✓ hooks reference: $hook_ref exists"
done
elif [[ "$hooks_type" == "object" ]]; then
# Object format: { "PostToolUse": [...] } - inline hooks, no file reference to validate
echo " ✓ hooks: inline object format (no file references)"
fi
# Check commands directory references
commands=$(jq -r '.commands // [] | .[]' "$plugin_json" 2>/dev/null)
for cmd_ref in $commands; do
cmd_path="$plugin_dir/$cmd_ref"
if [[ ! -d "$cmd_path" ]] && [[ ! -f "$cmd_path" ]]; then
echo "ERROR: BROKEN REFERENCE in $plugin_name/plugin.json"
echo " commands references '$cmd_ref' but path does not exist at:"
echo " $cmd_path"
echo ""
echo " FIX: Either create the path or remove the commands entry"
exit 1
fi
echo " ✓ commands reference: $cmd_ref exists"
done
echo "$plugin_name valid" echo "$plugin_name valid"
done done
# CRITICAL: Validate marketplace.json file references
echo ""
echo "=== Validating Marketplace File References (CRITICAL) ==="
for i in $(seq 0 $((PLUGIN_COUNT - 1))); do
PLUGIN_NAME=$(jq -r ".plugins[$i].name" "$MARKETPLACE_JSON")
PLUGIN_SOURCE=$(jq -r ".plugins[$i].source" "$MARKETPLACE_JSON")
PLUGIN_DIR="$ROOT_DIR/$PLUGIN_SOURCE"
# Check mcpServers in marketplace.json
mcp_servers=$(jq -r ".plugins[$i].mcpServers // [] | .[]" "$MARKETPLACE_JSON" 2>/dev/null)
for mcp_ref in $mcp_servers; do
mcp_path="$PLUGIN_DIR/$mcp_ref"
if [[ ! -f "$mcp_path" ]]; then
echo "ERROR: BROKEN REFERENCE in marketplace.json for $PLUGIN_NAME"
echo " mcpServers references '$mcp_ref' but file does not exist at:"
echo " $mcp_path"
echo ""
echo " FIX: Either create the file or remove the mcpServers entry from marketplace.json"
exit 1
fi
echo "$PLUGIN_NAME: mcpServers reference $mcp_ref exists"
done
# Check hooks in marketplace.json
hooks=$(jq -r ".plugins[$i].hooks // [] | .[]" "$MARKETPLACE_JSON" 2>/dev/null)
for hook_ref in $hooks; do
hook_path="$PLUGIN_DIR/$hook_ref"
if [[ ! -f "$hook_path" ]]; then
echo "ERROR: BROKEN REFERENCE in marketplace.json for $PLUGIN_NAME"
echo " hooks references '$hook_ref' but file does not exist at:"
echo " $hook_path"
echo ""
echo " FIX: Either create the file or remove the hooks entry from marketplace.json"
exit 1
fi
echo "$PLUGIN_NAME: hooks reference $hook_ref exists"
done
done
echo "✓ All file references validated"
# v5.4.0: Validate agent model fields # v5.4.0: Validate agent model fields
echo "" echo ""
echo "=== Validating Agent Model Fields (v5.4.0+) ===" echo "=== Validating Agent Model Fields (v5.4.0+) ==="