Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 20 additions & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,23 @@
source 'https://rubygems.org'
gem 'jekyll'

# Jekyll and GitHub Pages
gem 'jekyll', '~> 4.4.1'
gem 'liquid'
gem "webrick", "~> 1.8"

# GitHub Pages compatible plugins
group :jekyll_plugins do
gem 'jekyll-feed', '~> 0.17'
gem 'jekyll-sitemap', '~> 1.4'
gem 'jekyll-seo-tag', '~> 2.8'
end

# Windows and JRuby does not include zoneinfo files, so bundle the tzinfo-data gem
# and associated library.
platforms :mingw, :x64_mingw, :mswin, :jruby do
gem "tzinfo", ">= 1", "< 3"
gem "tzinfo-data"
end

# Performance-booster for watching directories on Windows
gem "wdm", "~> 0.1.1", :platforms => [:mingw, :x64_mingw, :mswin]
110 changes: 83 additions & 27 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,38 +1,94 @@
GEM
remote: https://rubygems.org/
specs:
albino (1.3.3)
posix-spawn (>= 0.3.6)
classifier (1.3.5)
fast-stemmer (~> 1.0.0)
mathn
rake
directory_watcher (1.5.1)
fast-stemmer (1.0.2)
jekyll (0.11.0)
albino (>= 1.3.2)
classifier (>= 1.3.1)
directory_watcher (>= 1.1.1)
kramdown (>= 0.13.2)
liquid (>= 1.9.0)
maruku (>= 0.5.9)
kramdown (2.4.0)
rexml
liquid (5.4.0)
maruku (0.7.3)
mathn (0.1.0)
posix-spawn (0.3.15)
rake (13.0.6)
rexml (3.3.9)
webrick (1.8.2)
addressable (2.8.8)
public_suffix (>= 2.0.2, < 8.0)
base64 (0.3.0)
bigdecimal (3.3.1)
colorator (1.1.0)
concurrent-ruby (1.3.6)
csv (3.3.5)
em-websocket (0.5.3)
eventmachine (>= 0.12.9)
http_parser.rb (~> 0)
eventmachine (1.2.7)
ffi (1.17.2-x86_64-linux-gnu)
forwardable-extended (2.6.0)
google-protobuf (4.33.2-x86_64-linux-gnu)
bigdecimal
rake (>= 13)
http_parser.rb (0.8.0)
i18n (1.14.7)
concurrent-ruby (~> 1.0)
jekyll (4.4.1)
addressable (~> 2.4)
base64 (~> 0.2)
colorator (~> 1.0)
csv (~> 3.0)
em-websocket (~> 0.5)
i18n (~> 1.0)
jekyll-sass-converter (>= 2.0, < 4.0)
jekyll-watch (~> 2.0)
json (~> 2.6)
kramdown (~> 2.3, >= 2.3.1)
kramdown-parser-gfm (~> 1.0)
liquid (~> 4.0)
mercenary (~> 0.3, >= 0.3.6)
pathutil (~> 0.9)
rouge (>= 3.0, < 5.0)
safe_yaml (~> 1.0)
terminal-table (>= 1.8, < 4.0)
webrick (~> 1.7)
jekyll-feed (0.17.0)
jekyll (>= 3.7, < 5.0)
jekyll-sass-converter (3.1.0)
sass-embedded (~> 1.75)
jekyll-seo-tag (2.8.0)
jekyll (>= 3.8, < 5.0)
jekyll-sitemap (1.4.0)
jekyll (>= 3.7, < 5.0)
jekyll-watch (2.2.1)
listen (~> 3.0)
json (2.18.0)
kramdown (2.5.1)
rexml (>= 3.3.9)
kramdown-parser-gfm (1.1.0)
kramdown (~> 2.0)
liquid (4.0.4)
listen (3.9.0)
rb-fsevent (~> 0.10, >= 0.10.3)
rb-inotify (~> 0.9, >= 0.9.10)
mercenary (0.4.0)
pathutil (0.16.2)
forwardable-extended (~> 2.6)
public_suffix (7.0.0)
rake (13.3.1)
rb-fsevent (0.11.2)
rb-inotify (0.11.1)
ffi (~> 1.0)
rexml (3.4.4)
rouge (4.6.1)
safe_yaml (1.0.5)
sass-embedded (1.96.0-x86_64-linux-gnu)
google-protobuf (~> 4.31)
terminal-table (3.0.2)
unicode-display_width (>= 1.1.1, < 3)
unicode-display_width (2.6.0)
webrick (1.9.2)

PLATFORMS
x86_64-linux
x86_64-linux-gnu

DEPENDENCIES
jekyll
jekyll (~> 4.4.1)
jekyll-feed (~> 0.17)
jekyll-seo-tag (~> 2.8)
jekyll-sitemap (~> 1.4)
liquid
tzinfo (>= 1, < 3)
tzinfo-data
wdm (~> 0.1.1)
webrick (~> 1.8)

BUNDLED WITH
2.3.20
2.4.19
17 changes: 17 additions & 0 deletions _config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,23 @@ copyright: '<a href="https://www.drupal.org">Drupal</a> is a <a href="http://dru
# Build settings
markdown: kramdown

# GitHub Pages compatible settings
plugins:
- jekyll-feed
- jekyll-sitemap
- jekyll-seo-tag

# Exclude from processing
exclude:
- Gemfile
- Gemfile.lock
- node_modules
- vendor
- .git
- .github
- mcp-package
- api

# yml_files = Dir.glob("_data/projects/*.yml")
# puts "page_gen:"
# yml_files.each do |file|
Expand Down
17 changes: 15 additions & 2 deletions mcp-package/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,12 +71,17 @@ if (existsSync(readmeSrc)) {
const testContent = `#!/usr/bin/env node

import { spawn } from 'child_process';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

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

const server = spawn('node', ['${serverDest}'], {
const server = spawn('node', [join(__dirname, 'index.js')], {
stdio: ['pipe', 'pipe', 'inherit'],
cwd: '${distDir}'
cwd: __dirname
});

let responseCount = 0;
Expand Down Expand Up @@ -143,6 +148,14 @@ console.log('✓ Created test.js');
// Create package.json for distribution
const packageSrc = join(__dirname, 'package.json');
const packageContent = JSON.parse(readFileSync(packageSrc, 'utf8'));

// Update paths for distribution
// When published from dist/, these files become the package root
packageContent.main = 'index.js';
packageContent.bin = {
'drupaltools-mcp': 'index.js'
};

// Update files list to include only what's in dist
packageContent.files = ['*.js', '*.json', '*.md'];
writeFileSync(join(distDir, 'package.json'), JSON.stringify(packageContent, null, 2));
Expand Down
10 changes: 3 additions & 7 deletions mcp-package/dist/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,17 @@
"version": "1.0.0",
"description": "Model Context Protocol (MCP) server for discovering Drupal development tools, utilities, and plugins",
"type": "module",
"main": "dist/index.js",
"main": "index.js",
"bin": {
"drupaltools-mcp": "dist/index.js"
"drupaltools-mcp": "index.js"
},
"files": [
"*.js",
"*.json",
"*.md"
],
"scripts": {
"build": "node build.js",
"prepublishOnly": "npm run build",
"test": "node dist/test.js",
"publish:npm": "cd dist && npm publish",
"publish": "./publish.sh"
"test": "node test.js"
},
"keywords": [
"mcp",
Expand Down
9 changes: 7 additions & 2 deletions mcp-package/dist/test.js
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
#!/usr/bin/env node

import { spawn } from 'child_process';
import { fileURLToPath } from 'url';
import { dirname, join } from 'path';

const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);

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

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

let responseCount = 0;
Expand Down
5 changes: 2 additions & 3 deletions mcp-package/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,12 @@
"drupaltools-mcp": "dist/index.js"
},
"files": [
"dist/",
"README.md"
"dist/"
],
"scripts": {
"build": "node build.js",
"prepublishOnly": "npm run build",
"test": "node dist/test.js",
"test": "node test.js",
"publish:npm": "cd dist && npm publish",
"publish": "./publish.sh"
},
Expand Down
96 changes: 96 additions & 0 deletions mcp-server/index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
---
layout: default
title: Drupal Tools MCP Server
---

<div class="container">
<div class="row">
<div class="col-md-12">
<h1>Drupal Tools MCP Server</h1>

<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>

<h2>Features</h2>
<ul>
<li><strong>list_tools</strong>: List all available Drupal tools/projects with optional filtering</li>
<li><strong>search_tools</strong>: Search for tools using semantic matching</li>
<li><strong>get_tool</strong>: Get detailed information about a specific tool</li>
</ul>

<h2>Installation with npm</h2>

<p>The easiest way to use the MCP server is with npm:</p>

<div class="highlight">
<pre>npm install -g @drupaltools/mcp</pre>
</div>

<h2>Usage with Claude Desktop</h2>

<p>Add the following to your Claude Desktop configuration file:</p>

<div class="highlight">
<pre>{
"mcpServers": {
"drupal-tools": {
"command": "drupaltools-mcp"
}
}
}</pre>
</div>

<h2>Available Tools</h2>

<h3>1. list_tools</h3>
<p>Lists all available Drupal tools/projects.</p>

<p><strong>Parameters:</strong></p>
<ul>
<li><code>category</code> (optional): Filter by category (e.g., 'testing', 'cli', 'deployment')</li>
<li><code>limit</code> (optional, default: 50): Maximum number of tools to return</li>
</ul>

<h3>2. search_tools</h3>
<p>Search for tools using a query string. Uses smart scoring:</p>
<ul>
<li>Title matches: 100 points</li>
<li>Category matches: 50 points</li>
<li>Tag matches: 30 points</li>
<li>Description matches: 20 points</li>
<li>Homepage/source matches: 10 points</li>
</ul>

<p><strong>Parameters:</strong></p>
<ul>
<li><code>query</code> (required): Search query</li>
<li><code>limit</code> (optional, default: 10): Maximum results to return</li>
</ul>

<h3>3. get_tool</h3>
<p>Get detailed information about a specific tool by ID or name.</p>

<p><strong>Parameters:</strong></p>
<ul>
<li><code>tool_id</code> (required): The tool ID (filename without .yml) or tool name</li>
</ul>

<h2>Development</h2>

<p>The server is built using the JavaScript/TypeScript MCP SDK (<code>@modelcontextprotocol/sdk</code> v1.24.3) with ES modules.</p>

<h2>Testing</h2>

<div class="highlight">
<pre>npx @modelcontextprotocol/inspector node mcp-server/index.js</pre>
</div>

<p>This opens a web UI where you can:</p>
<ul>
<li>See all available tools and their schemas</li>
<li>Test each tool with custom parameters</li>
<li>View real-time responses</li>
<li>Debug issues</li>
</ul>
</div>
</div>
</div>