mattrguerra/meridian-crm-mcpmainPrivate on GitHub, published here in full

build.sh

Language Shell1.5 KB42 lines

mcpb/build.sh

  1. #!/usr/bin/env bash
  2. # Build the Bitrix24 desktop extension (.mcpb) from ../server.py.
  3. #
  4. # Usage: ./build.sh
  5. #
  6. # This bundle uses the MCPB **uv** runtime (server.type = "uv"): dependencies are
  7. # declared in pyproject.toml and resolved ON THE USER'S MACHINE by uv, which also
  8. # provisions a compatible Python. So there are NO bundled native wheels, NO
  9. # Python-version pin, and NO per-OS builds: one tiny bundle runs on macOS,
  10. # Windows, and Linux. It can be built on any OS.
  11. #
  12. # Requires: Node/npm (for the `mcpb` CLI). No Python or internet-fetched wheels.
  13. set -euo pipefail
  14. HERE="$(cd "$(dirname "$0")" && pwd)"
  15. cd "$HERE"
  16. # mcpb CLI
  17. if ! command -v mcpb >/dev/null 2>&1; then
  18. echo "Installing mcpb CLI (npm i -g @anthropic-ai/mcpb)…"
  19. npm install -g @anthropic-ai/mcpb
  20. fi
  21. # Fresh server payload from the single source of truth (../server.py).
  22. # The uv runtime launches src/server.py (see manifest server.entry_point).
  23. rm -rf src
  24. mkdir -p src
  25. cp ../server.py src/server.py
  26. # Version stamp for the output filename (from the manifest).
  27. VER="$(python3 -c 'import json;print(json.load(open("manifest.json"))["version"])' 2>/dev/null || echo dev)"
  28. # Validate + pack. .mcpbignore keeps .venv/, caches, docs, and old artifacts out.
  29. mcpb validate manifest.json
  30. OUT="bitrix24-crm-${VER}.mcpb"
  31. mcpb pack . "$OUT"
  32. echo
  33. echo "Built: $HERE/$OUT"
  34. echo "One universal bundle: installs on macOS, Windows, and Linux."
  35. echo "Next: Organization settings → Connectors → Add → Custom → Desktop → upload this .mcpb,"
  36. echo " then add it to the Desktop extension allowlist."