Skip to content

Commit 9477039

Browse files
Merge pull request #41 from drupaltools/39_mcp
2 parents 10382df + 4df1933 commit 9477039

File tree

214 files changed

+6629
-16978
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

214 files changed

+6629
-16978
lines changed

.github/workflows/build-api.yml

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/publish-npm.yml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: Publish to npm
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
workflow_dispatch:
8+
inputs:
9+
version:
10+
description: 'Version to publish (e.g., 1.0.0)'
11+
required: true
12+
default: '1.0.0'
13+
14+
jobs:
15+
publish:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: read
19+
id-token: write
20+
21+
steps:
22+
- name: Checkout repository
23+
uses: actions/checkout@v4
24+
25+
- name: Setup Node.js
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: '18'
29+
registry-url: 'https://registry.npmjs.org'
30+
scope: '@drupaltools'
31+
32+
- name: Install dependencies
33+
run: |
34+
cd mcp-package
35+
npm install
36+
37+
- name: Build the package
38+
run: |
39+
cd mcp-package
40+
npm run build
41+
42+
- name: Run tests
43+
run: |
44+
cd mcp-package
45+
npm test
46+
47+
- name: Determine version
48+
id: version
49+
run: |
50+
if [[ "${{ github.ref_type }}" == "tag" ]]; then
51+
VERSION=${{ github.ref_name }}
52+
VERSION=${VERSION#v} # Remove 'v' prefix if present
53+
else
54+
VERSION=${{ github.event.inputs.version }}
55+
fi
56+
echo "version=$VERSION" >> $GITHUB_OUTPUT
57+
echo "Publishing version: $VERSION"
58+
59+
- name: Update package version
60+
run: |
61+
cd mcp-package
62+
npm version ${{ steps.version.outputs.version }} --no-git-tag-version
63+
cd dist
64+
npm version ${{ steps.version.outputs.version }} --no-git-tag-version
65+
66+
- name: Publish to npm
67+
run: |
68+
cd mcp-package/dist
69+
npm publish
70+
env:
71+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
72+
73+
- name: Create GitHub Release
74+
if: github.ref_type == 'tag'
75+
uses: actions/create-release@v1
76+
env:
77+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
78+
with:
79+
tag_name: ${{ github.ref_name }}
80+
release_name: Release ${{ github.ref_name }}
81+
draft: false
82+
prerelease: false
83+
body: |
84+
## Changes in ${{ github.ref_name }}
85+
86+
This release updates the @drupaltools/mcp npm package with the latest Drupal tools data.
87+
88+
### Installation
89+
```bash
90+
npx @drupaltools/mcp@${{ steps.version.outputs.version }}
91+
```
92+
93+
### Claude Desktop Configuration
94+
```json
95+
{
96+
"mcpServers": {
97+
"drupaltools": {
98+
"type": "stdio",
99+
"command": "npx",
100+
"args": ["@drupaltools/mcp@${{ steps.version.outputs.version }}"]
101+
}
102+
}
103+
}
104+
```
Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Update MCP Package
2+
3+
on:
4+
push:
5+
branches: [ main, master ]
6+
paths:
7+
- '_data/projects/*.yml'
8+
pull_request:
9+
branches: [ main, master ]
10+
paths:
11+
- '_data/projects/*.yml'
12+
workflow_dispatch:
13+
14+
jobs:
15+
update-package:
16+
runs-on: ubuntu-latest
17+
permissions:
18+
contents: write
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
with:
24+
token: ${{ secrets.GITHUB_TOKEN }}
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: '18'
30+
31+
- name: Install dependencies
32+
run: |
33+
cd mcp-package
34+
npm install
35+
36+
- name: Build the MCP package with latest data
37+
run: |
38+
cd mcp-package
39+
npm run build
40+
41+
- name: Run tests
42+
run: |
43+
cd mcp-package
44+
npm test
45+
46+
- name: Check for changes
47+
id: changes
48+
run: |
49+
if [[ -n $(git status --porcelain mcp-package/) ]]; then
50+
echo "has_changes=true" >> $GITHUB_OUTPUT
51+
echo "✅ MCP package data updated"
52+
else
53+
echo "has_changes=false" >> $GITHUB_OUTPUT
54+
echo "ℹ️ No changes to MCP package"
55+
fi
56+
57+
- name: Commit and push changes
58+
if: steps.changes.outputs.has_changes == 'true'
59+
run: |
60+
git config --local user.email "action@github.com"
61+
git config --local user.name "GitHub Action"
62+
git add mcp-package/
63+
git commit -m "chore: Update MCP package with latest Drupal tools data
64+
65+
- Rebuilt projects.json with $(cd mcp-package && node -e "console.log(Object.keys(JSON.parse(require('fs').readFileSync('dist/projects.json', 'utf8'))).length)" tools
66+
- Updated package when _data/projects changed
67+
68+
🤖 Generated with [Claude Code](https://claude.com/claude-code)
69+
70+
Co-Authored-By: Claude <noreply@anthropic.com>"
71+
git push
72+
73+
- name: Create summary
74+
run: |
75+
echo "## MCP Package Update Summary" >> $GITHUB_STEP_SUMMARY
76+
echo "" >> $GITHUB_STEP_SUMMARY
77+
if [[ "${{ steps.changes.outputs.has_changes }}" == "true" ]]; then
78+
echo "✅ MCP package has been updated with the latest tools data" >> $GITHUB_STEP_SUMMARY
79+
echo "" >> $GITHUB_STEP_SUMMARY
80+
echo "The package will include:" >> $GITHUB_STEP_SUMMARY
81+
echo "- Updated projects.json" >> $GITHUB_STEP_SUMMARY
82+
echo "- All 186+ Drupal tools data" >> $GITHUB_STEP_SUMMARY
83+
else
84+
echo "ℹ️ No changes needed - MCP package is already up to date" >> $GITHUB_STEP_SUMMARY
85+
fi

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ node_modules/
88
package-lock.json
99

1010
# Generated files (these are built, not edited)
11-
# Note: api/data/ is committed as it's needed for GitHub Pages
1211
drupaltools.log
1312
*.log
1413
.DS_Store

AUTOMATION.md

Lines changed: 0 additions & 107 deletions
This file was deleted.

LICENSE.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright 2017 TheodorosPloumis
1+
Copyright 2017 - 2025 TheodorosPloumis
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

0 commit comments

Comments
 (0)