Skip to content

Commit 3d191e8

Browse files
Merge pull request #42 from drupaltools/update_jekyll
2 parents 9477039 + d10f4af commit 3d191e8

File tree

8 files changed

+243
-42
lines changed

8 files changed

+243
-42
lines changed

Gemfile

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,23 @@
11
source 'https://rubygems.org'
2-
gem 'jekyll'
2+
3+
# Jekyll and GitHub Pages
4+
gem 'jekyll', '~> 4.4.1'
35
gem 'liquid'
46
gem "webrick", "~> 1.8"
7+
8+
# GitHub Pages compatible plugins
9+
group :jekyll_plugins do
10+
gem 'jekyll-feed', '~> 0.17'
11+
gem 'jekyll-sitemap', '~> 1.4'
12+
gem 'jekyll-seo-tag', '~> 2.8'
13+
end
14+
15+
# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
16+
# and associated library.
17+
platforms :mingw, :x64_mingw, :mswin, :jruby do
18+
gem "tzinfo", ">= 1", "< 3"
19+
gem "tzinfo-data"
20+
end
21+
22+
# Performance-booster for watching directories on Windows
23+
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]

Gemfile.lock

Lines changed: 83 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,94 @@
11
GEM
22
remote: https://rubygems.org/
33
specs:
4-
albino (1.3.3)
5-
posix-spawn (>= 0.3.6)
6-
classifier (1.3.5)
7-
fast-stemmer (~> 1.0.0)
8-
mathn
9-
rake
10-
directory_watcher (1.5.1)
11-
fast-stemmer (1.0.2)
12-
jekyll (0.11.0)
13-
albino (>= 1.3.2)
14-
classifier (>= 1.3.1)
15-
directory_watcher (>= 1.1.1)
16-
kramdown (>= 0.13.2)
17-
liquid (>= 1.9.0)
18-
maruku (>= 0.5.9)
19-
kramdown (2.4.0)
20-
rexml
21-
liquid (5.4.0)
22-
maruku (0.7.3)
23-
mathn (0.1.0)
24-
posix-spawn (0.3.15)
25-
rake (13.0.6)
26-
rexml (3.3.9)
27-
webrick (1.8.2)
4+
addressable (2.8.8)
5+
public_suffix (>= 2.0.2, < 8.0)
6+
base64 (0.3.0)
7+
bigdecimal (3.3.1)
8+
colorator (1.1.0)
9+
concurrent-ruby (1.3.6)
10+
csv (3.3.5)
11+
em-websocket (0.5.3)
12+
eventmachine (>= 0.12.9)
13+
http_parser.rb (~> 0)
14+
eventmachine (1.2.7)
15+
ffi (1.17.2-x86_64-linux-gnu)
16+
forwardable-extended (2.6.0)
17+
google-protobuf (4.33.2-x86_64-linux-gnu)
18+
bigdecimal
19+
rake (>= 13)
20+
http_parser.rb (0.8.0)
21+
i18n (1.14.7)
22+
concurrent-ruby (~> 1.0)
23+
jekyll (4.4.1)
24+
addressable (~> 2.4)
25+
base64 (~> 0.2)
26+
colorator (~> 1.0)
27+
csv (~> 3.0)
28+
em-websocket (~> 0.5)
29+
i18n (~> 1.0)
30+
jekyll-sass-converter (>= 2.0, < 4.0)
31+
jekyll-watch (~> 2.0)
32+
json (~> 2.6)
33+
kramdown (~> 2.3, >= 2.3.1)
34+
kramdown-parser-gfm (~> 1.0)
35+
liquid (~> 4.0)
36+
mercenary (~> 0.3, >= 0.3.6)
37+
pathutil (~> 0.9)
38+
rouge (>= 3.0, < 5.0)
39+
safe_yaml (~> 1.0)
40+
terminal-table (>= 1.8, < 4.0)
41+
webrick (~> 1.7)
42+
jekyll-feed (0.17.0)
43+
jekyll (>= 3.7, < 5.0)
44+
jekyll-sass-converter (3.1.0)
45+
sass-embedded (~> 1.75)
46+
jekyll-seo-tag (2.8.0)
47+
jekyll (>= 3.8, < 5.0)
48+
jekyll-sitemap (1.4.0)
49+
jekyll (>= 3.7, < 5.0)
50+
jekyll-watch (2.2.1)
51+
listen (~> 3.0)
52+
json (2.18.0)
53+
kramdown (2.5.1)
54+
rexml (>= 3.3.9)
55+
kramdown-parser-gfm (1.1.0)
56+
kramdown (~> 2.0)
57+
liquid (4.0.4)
58+
listen (3.9.0)
59+
rb-fsevent (~> 0.10, >= 0.10.3)
60+
rb-inotify (~> 0.9, >= 0.9.10)
61+
mercenary (0.4.0)
62+
pathutil (0.16.2)
63+
forwardable-extended (~> 2.6)
64+
public_suffix (7.0.0)
65+
rake (13.3.1)
66+
rb-fsevent (0.11.2)
67+
rb-inotify (0.11.1)
68+
ffi (~> 1.0)
69+
rexml (3.4.4)
70+
rouge (4.6.1)
71+
safe_yaml (1.0.5)
72+
sass-embedded (1.96.0-x86_64-linux-gnu)
73+
google-protobuf (~> 4.31)
74+
terminal-table (3.0.2)
75+
unicode-display_width (>= 1.1.1, < 3)
76+
unicode-display_width (2.6.0)
77+
webrick (1.9.2)
2878

2979
PLATFORMS
30-
x86_64-linux
80+
x86_64-linux-gnu
3181

3282
DEPENDENCIES
33-
jekyll
83+
jekyll (~> 4.4.1)
84+
jekyll-feed (~> 0.17)
85+
jekyll-seo-tag (~> 2.8)
86+
jekyll-sitemap (~> 1.4)
3487
liquid
88+
tzinfo (>= 1, < 3)
89+
tzinfo-data
90+
wdm (~> 0.1.1)
3591
webrick (~> 1.8)
3692

3793
BUNDLED WITH
38-
2.3.20
94+
2.4.19

_config.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,23 @@ copyright: '<a href="https://www.drupal.org">Drupal</a> is a <a href="http://dru
1111
# Build settings
1212
markdown: kramdown
1313

14+
# GitHub Pages compatible settings
15+
plugins:
16+
- jekyll-feed
17+
- jekyll-sitemap
18+
- jekyll-seo-tag
19+
20+
# Exclude from processing
21+
exclude:
22+
- Gemfile
23+
- Gemfile.lock
24+
- node_modules
25+
- vendor
26+
- .git
27+
- .github
28+
- mcp-package
29+
- api
30+
1431
# yml_files = Dir.glob("_data/projects/*.yml")
1532
# puts "page_gen:"
1633
# yml_files.each do |file|

mcp-package/build.js

Lines changed: 15 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,17 @@ if (existsSync(readmeSrc)) {
7171
const testContent = `#!/usr/bin/env node
7272
7373
import { spawn } from 'child_process';
74+
import { fileURLToPath } from 'url';
75+
import { dirname, join } from 'path';
76+
77+
const __filename = fileURLToPath(import.meta.url);
78+
const __dirname = dirname(__filename);
7479
7580
console.log('Testing @drupaltools/mcp server...');
7681
77-
const server = spawn('node', ['${serverDest}'], {
82+
const server = spawn('node', [join(__dirname, 'index.js')], {
7883
stdio: ['pipe', 'pipe', 'inherit'],
79-
cwd: '${distDir}'
84+
cwd: __dirname
8085
});
8186
8287
let responseCount = 0;
@@ -143,6 +148,14 @@ console.log('✓ Created test.js');
143148
// Create package.json for distribution
144149
const packageSrc = join(__dirname, 'package.json');
145150
const packageContent = JSON.parse(readFileSync(packageSrc, 'utf8'));
151+
152+
// Update paths for distribution
153+
// When published from dist/, these files become the package root
154+
packageContent.main = 'index.js';
155+
packageContent.bin = {
156+
'drupaltools-mcp': 'index.js'
157+
};
158+
146159
// Update files list to include only what's in dist
147160
packageContent.files = ['*.js', '*.json', '*.md'];
148161
writeFileSync(join(distDir, 'package.json'), JSON.stringify(packageContent, null, 2));

mcp-package/dist/package.json

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,17 @@
33
"version": "1.0.0",
44
"description": "Model Context Protocol (MCP) server for discovering Drupal development tools, utilities, and plugins",
55
"type": "module",
6-
"main": "dist/index.js",
6+
"main": "index.js",
77
"bin": {
8-
"drupaltools-mcp": "dist/index.js"
8+
"drupaltools-mcp": "index.js"
99
},
1010
"files": [
1111
"*.js",
1212
"*.json",
1313
"*.md"
1414
],
1515
"scripts": {
16-
"build": "node build.js",
17-
"prepublishOnly": "npm run build",
18-
"test": "node dist/test.js",
19-
"publish:npm": "cd dist && npm publish",
20-
"publish": "./publish.sh"
16+
"test": "node test.js"
2117
},
2218
"keywords": [
2319
"mcp",

mcp-package/dist/test.js

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,17 @@
11
#!/usr/bin/env node
22

33
import { spawn } from 'child_process';
4+
import { fileURLToPath } from 'url';
5+
import { dirname, join } from 'path';
6+
7+
const __filename = fileURLToPath(import.meta.url);
8+
const __dirname = dirname(__filename);
49

510
console.log('Testing @drupaltools/mcp server...');
611

7-
const server = spawn('node', ['/var/www/html/NON-DRUPAL/drupaltools.github.io/mcp-package/dist/index.js'], {
12+
const server = spawn('node', [join(__dirname, 'index.js')], {
813
stdio: ['pipe', 'pipe', 'inherit'],
9-
cwd: '/var/www/html/NON-DRUPAL/drupaltools.github.io/mcp-package/dist'
14+
cwd: __dirname
1015
});
1116

1217
let responseCount = 0;

mcp-package/package.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,12 @@
88
"drupaltools-mcp": "dist/index.js"
99
},
1010
"files": [
11-
"dist/",
12-
"README.md"
11+
"dist/"
1312
],
1413
"scripts": {
1514
"build": "node build.js",
1615
"prepublishOnly": "npm run build",
17-
"test": "node dist/test.js",
16+
"test": "node test.js",
1817
"publish:npm": "cd dist && npm publish",
1918
"publish": "./publish.sh"
2019
},

mcp-server/index.html

Lines changed: 96 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,96 @@
1+
---
2+
layout: default
3+
title: Drupal Tools MCP Server
4+
---
5+
6+
<div class="container">
7+
<div class="row">
8+
<div class="col-md-12">
9+
<h1>Drupal Tools MCP Server</h1>
10+
11+
<p>A simple MCP (Model Context Protocol) server that suggests Drupal tools from the <code>_data/projects</code> folder. This server provides semantic search and discovery of Drupal development tools, utilities, and projects.</p>
12+
13+
<h2>Features</h2>
14+
<ul>
15+
<li><strong>list_tools</strong>: List all available Drupal tools/projects with optional filtering</li>
16+
<li><strong>search_tools</strong>: Search for tools using semantic matching</li>
17+
<li><strong>get_tool</strong>: Get detailed information about a specific tool</li>
18+
</ul>
19+
20+
<h2>Installation with npm</h2>
21+
22+
<p>The easiest way to use the MCP server is with npm:</p>
23+
24+
<div class="highlight">
25+
<pre>npm install -g @drupaltools/mcp</pre>
26+
</div>
27+
28+
<h2>Usage with Claude Desktop</h2>
29+
30+
<p>Add the following to your Claude Desktop configuration file:</p>
31+
32+
<div class="highlight">
33+
<pre>{
34+
"mcpServers": {
35+
"drupal-tools": {
36+
"command": "drupaltools-mcp"
37+
}
38+
}
39+
}</pre>
40+
</div>
41+
42+
<h2>Available Tools</h2>
43+
44+
<h3>1. list_tools</h3>
45+
<p>Lists all available Drupal tools/projects.</p>
46+
47+
<p><strong>Parameters:</strong></p>
48+
<ul>
49+
<li><code>category</code> (optional): Filter by category (e.g., 'testing', 'cli', 'deployment')</li>
50+
<li><code>limit</code> (optional, default: 50): Maximum number of tools to return</li>
51+
</ul>
52+
53+
<h3>2. search_tools</h3>
54+
<p>Search for tools using a query string. Uses smart scoring:</p>
55+
<ul>
56+
<li>Title matches: 100 points</li>
57+
<li>Category matches: 50 points</li>
58+
<li>Tag matches: 30 points</li>
59+
<li>Description matches: 20 points</li>
60+
<li>Homepage/source matches: 10 points</li>
61+
</ul>
62+
63+
<p><strong>Parameters:</strong></p>
64+
<ul>
65+
<li><code>query</code> (required): Search query</li>
66+
<li><code>limit</code> (optional, default: 10): Maximum results to return</li>
67+
</ul>
68+
69+
<h3>3. get_tool</h3>
70+
<p>Get detailed information about a specific tool by ID or name.</p>
71+
72+
<p><strong>Parameters:</strong></p>
73+
<ul>
74+
<li><code>tool_id</code> (required): The tool ID (filename without .yml) or tool name</li>
75+
</ul>
76+
77+
<h2>Development</h2>
78+
79+
<p>The server is built using the JavaScript/TypeScript MCP SDK (<code>@modelcontextprotocol/sdk</code> v1.24.3) with ES modules.</p>
80+
81+
<h2>Testing</h2>
82+
83+
<div class="highlight">
84+
<pre>npx @modelcontextprotocol/inspector node mcp-server/index.js</pre>
85+
</div>
86+
87+
<p>This opens a web UI where you can:</p>
88+
<ul>
89+
<li>See all available tools and their schemas</li>
90+
<li>Test each tool with custom parameters</li>
91+
<li>View real-time responses</li>
92+
<li>Debug issues</li>
93+
</ul>
94+
</div>
95+
</div>
96+
</div>

0 commit comments

Comments
 (0)