drupal-mcp-connector 2.20.0 → 2.22.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +2 -0
- package/config/config.example.json +12 -1
- package/package.json +1 -1
- package/scripts/generate-commands.js +43 -0
- package/scripts/install-commands.js +56 -5
- package/src/index.js +29 -109
- package/src/lib/governance.js +9 -2
- package/src/lib/oauth.js +23 -9
- package/src/lib/principal.js +14 -0
- package/src/lib/server-tools.js +85 -9
- package/src/lib/tool-prompts.js +29 -6
- package/src/lib/workflow-prompts.js +490 -0
- package/src/lib/workflows/builtin.js +134 -0
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Connector-authored workflow definitions (#333).
|
|
3
|
+
*
|
|
4
|
+
* Public names and steps match the previous hand-written prompts in
|
|
5
|
+
* src/index.js. They go through the same loader as module workflows.
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
const SITE = { name: "site", description: "Named site (omit for default)", required: false };
|
|
9
|
+
|
|
10
|
+
export const builtinWorkflowProvider = {
|
|
11
|
+
id: "builtin",
|
|
12
|
+
namespace: "builtin",
|
|
13
|
+
builtin: true,
|
|
14
|
+
workflows: [
|
|
15
|
+
{
|
|
16
|
+
id: "content_audit",
|
|
17
|
+
name: "drupal-content-audit",
|
|
18
|
+
description: "Walk through a full content audit: inventory, staleness, SEO gaps, accessibility issues, and recommendations.",
|
|
19
|
+
readOnly: true,
|
|
20
|
+
tools: [
|
|
21
|
+
"drupal_report_content_summary",
|
|
22
|
+
"drupal_report_stale_content",
|
|
23
|
+
"drupal_report_field_completeness",
|
|
24
|
+
"drupal_report_seo_meta_coverage",
|
|
25
|
+
"drupal_report_seo_audit",
|
|
26
|
+
"drupal_report_accessibility_audit",
|
|
27
|
+
],
|
|
28
|
+
arguments: [SITE],
|
|
29
|
+
instructions:
|
|
30
|
+
"Please run a comprehensive content audit {arg:site_phrase}. Do not assume any particular content type exists — every site has a different model, so discover it first and audit the types this site actually has.\n" +
|
|
31
|
+
"1. Call {tool:drupal_report_content_summary} for the full inventory. Its byContentType list is the set of content types to audit — derive the types from it; never assume a fixed type such as \"article\".\n" +
|
|
32
|
+
"2. For each content type that has nodes, call {tool:drupal_report_stale_content} (days: 180).\n" +
|
|
33
|
+
"3. For each content type that has nodes, call {tool:drupal_report_field_completeness}.\n" +
|
|
34
|
+
"4. For each content type with published nodes, check SEO: prefer {tool:drupal_report_seo_meta_coverage} (it reads the site's actual meta field rather than assuming one) and use {tool:drupal_report_seo_audit} for title-length and thin-content checks.\n" +
|
|
35
|
+
"5. For each content type with published nodes, call {tool:drupal_report_accessibility_audit}.\n" +
|
|
36
|
+
"6. For any content type reporting zero nodes, skip its per-type scans and record it as empty — an empty type is not a clean one.\n" +
|
|
37
|
+
"7. Synthesize findings into: (a) immediate actions, (b) medium-term improvements, (c) process recommendations.\n" +
|
|
38
|
+
"Present results as a structured report with counts, severity, and specific node links where possible. State which content types were scanned so an empty or unexpected model cannot be mistaken for a clean audit.",
|
|
39
|
+
},
|
|
40
|
+
{
|
|
41
|
+
id: "create_article",
|
|
42
|
+
name: "drupal-create-article",
|
|
43
|
+
description: "Guided workflow to research, draft, and publish an article node with all fields, tags, and metadata.",
|
|
44
|
+
readOnly: false,
|
|
45
|
+
tools: [
|
|
46
|
+
"drupal_list_content_types",
|
|
47
|
+
"drupal_get_entity_schema",
|
|
48
|
+
"drupal_list_vocabularies",
|
|
49
|
+
"drupal_get_taxonomy_terms",
|
|
50
|
+
"drupal_create_node",
|
|
51
|
+
],
|
|
52
|
+
arguments: [
|
|
53
|
+
SITE,
|
|
54
|
+
{ name: "topic", description: "Article topic/brief", required: true },
|
|
55
|
+
],
|
|
56
|
+
instructions:
|
|
57
|
+
"I need to create a new article {arg:site_phrase} about: {arg:topic}\n\n" +
|
|
58
|
+
"Please:\n" +
|
|
59
|
+
"1. Call {tool:drupal_list_content_types} to confirm \"article\" exists and check its fields.\n" +
|
|
60
|
+
"2. Call {tool:drupal_get_entity_schema} for node/article to see all available fields.\n" +
|
|
61
|
+
"3. Call {tool:drupal_list_vocabularies} and {tool:drupal_get_taxonomy_terms} for relevant vocabularies.\n" +
|
|
62
|
+
"4. Draft the article — title, body (well-structured HTML), summary, and meta description.\n" +
|
|
63
|
+
"5. Suggest appropriate taxonomy tags.\n" +
|
|
64
|
+
"6. Call {tool:drupal_create_node} with status: false (draft) and show me the result.\n" +
|
|
65
|
+
"7. Ask me to review before publishing.",
|
|
66
|
+
},
|
|
67
|
+
{
|
|
68
|
+
id: "seo_fix",
|
|
69
|
+
name: "drupal-seo-fix",
|
|
70
|
+
description: "Find SEO gaps in content (missing meta descriptions, thin content, title issues) and fix them interactively.",
|
|
71
|
+
readOnly: false,
|
|
72
|
+
tools: ["drupal_report_seo_audit"],
|
|
73
|
+
arguments: [
|
|
74
|
+
SITE,
|
|
75
|
+
{ name: "type", description: "Content type to scan", required: false },
|
|
76
|
+
],
|
|
77
|
+
instructions:
|
|
78
|
+
"Please find and fix SEO issues in \"{arg:type}\" content {arg:site_phrase}.\n\n" +
|
|
79
|
+
"1. Call {tool:drupal_report_seo_audit} to identify all issues.\n" +
|
|
80
|
+
"2. For nodes missing meta descriptions: generate appropriate descriptions (max 160 chars) and update them.\n" +
|
|
81
|
+
"3. For thin content (under 300 words): flag for editorial review — do not auto-expand.\n" +
|
|
82
|
+
"4. For title length issues: suggest better titles but ask before updating.\n" +
|
|
83
|
+
"5. Report what was fixed, what needs human review, and any patterns you noticed.",
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
id: "user_cleanup",
|
|
87
|
+
name: "drupal-user-cleanup",
|
|
88
|
+
description: "Identify inactive, never-logged-in, or overly permissioned user accounts and take action.",
|
|
89
|
+
readOnly: false,
|
|
90
|
+
tools: ["drupal_report_user_activity", "drupal_list_users", "drupal_list_roles"],
|
|
91
|
+
arguments: [SITE],
|
|
92
|
+
instructions:
|
|
93
|
+
"Please audit user accounts {arg:site_phrase} and recommend cleanup actions.\n\n" +
|
|
94
|
+
"1. Call {tool:drupal_report_user_activity} to identify inactive and never-logged-in accounts.\n" +
|
|
95
|
+
"2. Call {tool:drupal_list_users} with no filter to get the full list.\n" +
|
|
96
|
+
"3. Call {tool:drupal_list_roles} to see all available roles.\n" +
|
|
97
|
+
"4. Identify: (a) accounts inactive 90+ days, (b) never-logged-in accounts, (c) accounts with admin roles that look like test/temp accounts.\n" +
|
|
98
|
+
"5. For each category, recommend action (block, delete, or keep) with reasoning.\n" +
|
|
99
|
+
"6. Ask for approval before making any changes.",
|
|
100
|
+
},
|
|
101
|
+
{
|
|
102
|
+
id: "full_audit",
|
|
103
|
+
name: "drupal-full-audit",
|
|
104
|
+
description: "Run a full site-health audit — content, link/404 integrity, and configuration posture — and turn the scored dashboard into a prioritized action plan.",
|
|
105
|
+
readOnly: true,
|
|
106
|
+
tools: [
|
|
107
|
+
"drupal_audit_site_health",
|
|
108
|
+
"drupal_report_404_log",
|
|
109
|
+
"drupal_report_redirect_health",
|
|
110
|
+
"drupal_report_broken_links",
|
|
111
|
+
"drupal_audit_config_best_practices",
|
|
112
|
+
"drupal_report_module_audit",
|
|
113
|
+
"drupal_report_permission_audit",
|
|
114
|
+
"drupal_report_pii_exposure",
|
|
115
|
+
"drupal_report_duplicate_content",
|
|
116
|
+
"drupal_report_readability",
|
|
117
|
+
],
|
|
118
|
+
arguments: [
|
|
119
|
+
SITE,
|
|
120
|
+
{ name: "type", description: "Primary content type to audit", required: false },
|
|
121
|
+
],
|
|
122
|
+
instructions:
|
|
123
|
+
"Please run a full site-health audit {arg:site_phrase} and turn it into a prioritized action plan.\n\n" +
|
|
124
|
+
"1. Call {tool:drupal_audit_site_health} (type: \"{arg:type}\") for the scored dashboard and overall grade.\n" +
|
|
125
|
+
"2. For any section reporting high-severity findings, drill in with the matching tool for detail:\n" +
|
|
126
|
+
" - links/404: {tool:drupal_report_404_log}, {tool:drupal_report_redirect_health}, {tool:drupal_report_broken_links} (checkLive only with approval).\n" +
|
|
127
|
+
" - config: {tool:drupal_audit_config_best_practices}, {tool:drupal_report_module_audit}, {tool:drupal_report_permission_audit}.\n" +
|
|
128
|
+
" - content: {tool:drupal_report_pii_exposure}, {tool:drupal_report_duplicate_content}, {tool:drupal_report_readability}.\n" +
|
|
129
|
+
"3. For sections reported 'unavailable', note what (server-tool bridge or drush) would enable them — do not treat unavailable as 'passing'.\n" +
|
|
130
|
+
"4. Synthesize a prioritized plan: (a) high-severity/security fixes first, (b) content-quality improvements, (c) process recommendations.\n" +
|
|
131
|
+
"5. Present counts, severity, and specific node/config references; propose redirects for the top 404s. Ask before making any changes.",
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
};
|