fix(scripts): MCP server mapping and CLAUDE.md section markers #395

Merged
lmiranda merged 1 commits from fix/plugin-install-mcp-mapping into development 2026-02-03 00:37:16 +00:00
Owner

Summary

Fixes two issues in the plugin installation scripts:

Issue 1: Shared MCP Server Mapping

  • Added mcp_servers field to plugin.json for plugins using shared MCP servers
  • projman and pr-review now correctly install gitea MCP server
  • cmdb-assistant now correctly installs netbox MCP server
  • Scripts read MCP server names from plugin.json instead of assuming plugin name = server name

Issue 2: CLAUDE.md Section Markers

  • Install script now wraps content with HTML comment markers:
    <!-- BEGIN marketplace-plugin: {name} --> and <!-- END marketplace-plugin: {name} -->
  • Uninstall uses markers for precise section removal (no more code block false positives)
  • Backward compatible: falls back to legacy header detection

Bug Fix

  • Changed ((servers_added++)) to ((++servers_added)) to avoid exit code 1 with set -e when incrementing from 0

Files Changed

File Change
plugins/*/plugin.json Added mcp_servers field
scripts/install-plugin.sh Read from mcp_servers, add HTML markers
scripts/uninstall-plugin.sh Read from mcp_servers, use HTML markers
scripts/list-installed.sh Check against mcp_servers field
CHANGELOG.md Document fixes

Test plan

  • Validated marketplace with ./scripts/validate-marketplace.sh
  • Tested projman installs gitea MCP server (not projman)
  • Tested HTML markers are added to CLAUDE.md
  • Tested uninstall removes section using markers
  • Tested list-installed shows correct status

🤖 Generated with Claude Code

## Summary Fixes two issues in the plugin installation scripts: ### Issue 1: Shared MCP Server Mapping - Added `mcp_servers` field to `plugin.json` for plugins using shared MCP servers - `projman` and `pr-review` now correctly install `gitea` MCP server - `cmdb-assistant` now correctly installs `netbox` MCP server - Scripts read MCP server names from `plugin.json` instead of assuming plugin name = server name ### Issue 2: CLAUDE.md Section Markers - Install script now wraps content with HTML comment markers: `<!-- BEGIN marketplace-plugin: {name} -->` and `<!-- END marketplace-plugin: {name} -->` - Uninstall uses markers for precise section removal (no more code block false positives) - Backward compatible: falls back to legacy header detection ### Bug Fix - Changed `((servers_added++))` to `((++servers_added))` to avoid exit code 1 with `set -e` when incrementing from 0 ## Files Changed | File | Change | |------|--------| | `plugins/*/plugin.json` | Added `mcp_servers` field | | `scripts/install-plugin.sh` | Read from `mcp_servers`, add HTML markers | | `scripts/uninstall-plugin.sh` | Read from `mcp_servers`, use HTML markers | | `scripts/list-installed.sh` | Check against `mcp_servers` field | | `CHANGELOG.md` | Document fixes | ## Test plan - [x] Validated marketplace with `./scripts/validate-marketplace.sh` - [x] Tested projman installs gitea MCP server (not projman) - [x] Tested HTML markers are added to CLAUDE.md - [x] Tested uninstall removes section using markers - [x] Tested list-installed shows correct status 🤖 Generated with [Claude Code](https://claude.ai/code)
lmiranda added the Type/Bug label 2026-02-03 00:34:47 +00:00
lmiranda added 1 commit 2026-02-03 00:34:48 +00:00
Issue 1 - MCP Server Mapping:
- Add mcp_servers field to plugin.json for plugins using shared MCP servers
- projman/pr-review now install gitea MCP server
- cmdb-assistant now installs netbox MCP server
- Scripts read MCP server names from plugin.json

Issue 2 - CLAUDE.md Section Markers:
- Install wraps content with HTML comment markers for precise removal
- Uninstall uses markers first, falls back to legacy header detection
- Fixes code block false positives during uninstall

Bug fix:
- Change ((servers_added++)) to ((++servers_added)) to avoid exit code 1
  with set -e when incrementing from 0

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
lmiranda merged commit 5b1dde694c into development 2026-02-03 00:37:16 +00:00
lmiranda deleted branch fix/plugin-install-mcp-mapping 2026-02-03 00:37:16 +00:00
Sign in to join this conversation.
No Reviewers
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: personal-projects/leo-claude-mktplace#395