We provide all the information about MCP servers via our MCP API.
curl -X GET 'https://glama.ai/api/mcp/v1/servers/thecombatwombat/replicant-mcp'
If you have feedback or need assistance with the MCP directory API, please join our Discord server
release.shβ’3.01 KiB
#!/bin/bash
set -e
# Usage: ./scripts/release.sh [patch|minor|major] [--dry-run]
# Default: patch
DRY_RUN=false
VERSION_TYPE="patch"
for arg in "$@"; do
case $arg in
--dry-run) DRY_RUN=true ;;
patch|minor|major) VERSION_TYPE=$arg ;;
*)
echo "Usage: $0 [patch|minor|major] [--dry-run]"
exit 1
;;
esac
done
# Pre-flight checks
echo "π Pre-flight checks..."
# Check gh CLI is available (needed for GitHub Release creation)
if ! command -v gh &>/dev/null; then
echo "β GitHub CLI (gh) not found. Install from https://cli.github.com/"
exit 1
fi
# Check we're on master
CURRENT_BRANCH=$(git branch --show-current)
if [[ "$CURRENT_BRANCH" != "master" ]]; then
echo "β Must be on master branch (currently on $CURRENT_BRANCH)"
exit 1
fi
# Check no uncommitted changes to tracked files
if [[ -n $(git status --porcelain | grep -v '^??') ]]; then
echo "β Uncommitted changes to tracked files. Commit or stash first."
git status --short | grep -v '^??'
exit 1
fi
# Check we're up to date with origin
git fetch origin master --quiet
LOCAL=$(git rev-parse HEAD)
REMOTE=$(git rev-parse origin/master)
if [[ "$LOCAL" != "$REMOTE" ]]; then
echo "β Local master differs from origin. Pull or push first."
exit 1
fi
# Calculate new version and check npm
CURRENT_VERSION=$(node -p "require('./package.json').version")
case $VERSION_TYPE in
patch)
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{print $1"."$2"."$3+1}')
;;
minor)
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{print $1"."$2+1".0"}')
;;
major)
NEW_VERSION=$(echo $CURRENT_VERSION | awk -F. '{print $1+1".0.0"}')
;;
esac
echo " Current: $CURRENT_VERSION β New: $NEW_VERSION"
# Check if version already exists on npm
if npm view "replicant-mcp@$NEW_VERSION" version &>/dev/null; then
echo "β Version $NEW_VERSION already exists on npm!"
echo " Run 'npm view replicant-mcp versions' to see published versions."
exit 1
fi
# Check if git tag already exists
if git rev-parse "v$NEW_VERSION" &>/dev/null; then
echo "β Git tag v$NEW_VERSION already exists!"
exit 1
fi
echo "β Pre-flight checks passed"
if [[ "$DRY_RUN" == "true" ]]; then
echo ""
echo "π Dry run - would release v$NEW_VERSION"
echo " Run without --dry-run to execute"
exit 0
fi
echo "π Running tests..."
npm test -- --run
echo "π¦ Bumping to $NEW_VERSION..."
npm version $NEW_VERSION --no-git-tag-version >/dev/null
echo "π¨ Building..."
npm run build
echo "π Committing..."
git add package.json package-lock.json
git commit -m "chore: release v$NEW_VERSION"
echo "π·οΈ Tagging v$NEW_VERSION..."
git tag -a "v$NEW_VERSION" -m "v$NEW_VERSION"
echo "π Pushing to origin..."
git push origin master
git push origin "v$NEW_VERSION"
echo "π€ Publishing to npm..."
npm publish --ignore-scripts # skip prepublishOnly since we already tested
echo "π·οΈ Creating GitHub Release..."
gh release create "v$NEW_VERSION" \
--title "v$NEW_VERSION" \
--generate-notes \
--latest
echo "β Released v$NEW_VERSION"