Skip to content

Commit e7b4d0f

Browse files
Add script to generate RELEASES for mcp
1 parent 3239899 commit e7b4d0f

File tree

3 files changed

+138
-2
lines changed

3 files changed

+138
-2
lines changed

mcp-package/RELEASES.md

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
# Releases
2+
3+
All notable changes to this project will be documented in this file.
4+
5+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7+
8+
## [Unreleased]
9+
10+
## [1.0.3] - 2024-12-15
11+
12+
### Added
13+
- Model Context Protocol (MCP) server for discovering Drupal development tools
14+
- Semantic search functionality for Drupal tools
15+
- Support for 160+ Drupal tools and utilities
16+
- npm package distribution with `drupaltools-mcp` binary
17+
- Integration with Claude Desktop via stdio transport
18+
19+
### Features
20+
- `list_tools`: List all available Drupal tools with optional filtering
21+
- `search_tools`: Search for tools using semantic matching with weighted scoring
22+
- `get_tool`: Get detailed information about specific tools by ID or name
23+
- Smart scoring algorithm for search relevance (title: 100pts, category: 50pts, tags: 30pts, description: 20pts, homepage: 10pts)
24+
25+
[Unreleased]: https://github.com/drupaltools/drupaltools.github.io/compare/v1.0.3...HEAD
26+
[1.0.3]: https://github.com/drupaltools/drupaltools.github.io/releases/tag/v1.0.3

mcp-package/package.json

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,26 @@
1414
"build": "node build.js",
1515
"test": "node dist/test.js",
1616
"publish:npm": "cd dist && npm publish",
17-
"publish": "./publish.sh"
17+
"publish": "./publish.sh",
18+
"release": "standard-version",
19+
"release:minor": "standard-version --release-as minor",
20+
"release:major": "standard-version --release-as major",
21+
"release:patch": "standard-version --release-as patch",
22+
"release:auto": "./release.sh",
23+
"release:auto:minor": "./release.sh minor",
24+
"release:auto:major": "./release.sh major"
25+
},
26+
"standard-version": {
27+
"changelogFiles": [
28+
{
29+
"filename": "RELEASES.md",
30+
"type": "markdown"
31+
}
32+
],
33+
"skip": {
34+
"tag": true,
35+
"commit": true
36+
}
1837
},
1938
"keywords": [
2039
"mcp",
@@ -44,5 +63,8 @@
4463
},
4564
"publishConfig": {
4665
"access": "public"
66+
},
67+
"devDependencies": {
68+
"standard-version": "^9.5.0"
4769
}
48-
}
70+
}

mcp-package/release.sh

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
#!/bin/bash
2+
3+
# Comprehensive release script for @drupaltools/mcp
4+
# This script will:
5+
# 1. Create a new version using standard-version
6+
# 2. Build the package
7+
# 3. Create and push git tag
8+
# 4. Publish to npm
9+
10+
set -e
11+
12+
echo "🚀 Starting release process for @drupaltools/mcp"
13+
14+
# Check if we're on the main branch
15+
current_branch=$(git rev-parse --abbrev-ref HEAD)
16+
if [ "$current_branch" != "master" ]; then
17+
echo "⚠️ Warning: You're not on the master branch (current: $current_branch)"
18+
read -p "Do you want to continue? (y/N): " -n 1 -r
19+
echo
20+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
21+
exit 1
22+
fi
23+
fi
24+
25+
# Check if working directory is clean
26+
if [ -n "$(git status --porcelain)" ]; then
27+
echo "❌ Working directory is not clean. Please commit or stash changes first."
28+
exit 1
29+
fi
30+
31+
# Get the current version
32+
current_version=$(node -p "require('./package.json').version")
33+
echo "📍 Current version: $current_version"
34+
35+
# Determine release type
36+
release_type="patch"
37+
if [ "$1" = "minor" ] || [ "$1" = "major" ]; then
38+
release_type="$1"
39+
fi
40+
41+
echo "📦 Release type: $release_type"
42+
43+
# Run standard-version to update version and changelog
44+
echo "📝 Updating version and changelog..."
45+
npm run release:$release_type
46+
47+
# Get the new version
48+
new_version=$(node -p "require('./package.json').version")
49+
echo "📍 New version: $new_version"
50+
51+
# Build the package
52+
echo "🔨 Building package..."
53+
npm run build
54+
55+
# Add changes to git
56+
echo "📤 Adding changes to git..."
57+
git add package.json RELEASES.md
58+
git commit -m "chore(release): $new_version"
59+
60+
# Create and push git tag
61+
echo "🏷️ Creating git tag v$new_version..."
62+
git tag -a "v$new_version" -m "Release $new_version"
63+
64+
echo "📤 Pushing changes and tag to origin..."
65+
git push origin master
66+
git push origin "v$new_version"
67+
68+
# Ask if user wants to publish to npm
69+
read -p "📦 Do you want to publish to npm now? (y/N): " -n 1 -r
70+
echo
71+
if [[ $REPLY =~ ^[Yy]$ ]]; then
72+
echo "📦 Publishing to npm..."
73+
npm run publish:npm
74+
echo "✅ Published to npm successfully!"
75+
else
76+
echo "💡 To publish manually, run: npm run publish:npm"
77+
fi
78+
79+
echo ""
80+
echo "🎉 Release $new_version completed successfully!"
81+
echo "📋 Summary:"
82+
echo " - Version bumped from $current_version to $new_version"
83+
echo " - Changelog updated in RELEASES.md"
84+
echo " - Git tag v$new_version created and pushed"
85+
echo " - Package built and ready for distribution"
86+
echo ""
87+
echo "🔗 View release: https://github.com/drupaltools/drupaltools.github.io/releases/tag/v$new_version"
88+
echo "📦 npm package: https://www.npmjs.com/package/@drupaltools/mcp"

0 commit comments

Comments
 (0)