genat-mcp 2.1.0 → 2.1.2
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/README.md +21 -0
- package/index.js +7 -2
- package/package.json +2 -2
- package/rules/genat-mcp.mdc +29 -0
package/README.md
CHANGED
|
@@ -85,6 +85,27 @@ N8N_WEBHOOK_URL='https://your-n8n/webhook-test/webhook-genat-login' N8N_INSECURE
|
|
|
85
85
|
|
|
86
86
|
**Important:** Use `webhook-genat-login` (not `webhook-genat`). Import and activate [genat-accessibility-tests-with-login.json](../workflows/genat-accessibility-tests-with-login.json) in n8n.
|
|
87
87
|
|
|
88
|
+
**Optional – Cursor rule:** Copy the rule so the AI uses the correct webhook when creating workarounds (the MCP error responses also include this hint):
|
|
89
|
+
```bash
|
|
90
|
+
mkdir -p .cursor/rules
|
|
91
|
+
# If genat-mcp is installed in the project:
|
|
92
|
+
cp node_modules/genat-mcp/rules/genat-mcp.mdc .cursor/rules/
|
|
93
|
+
# Or from the n8n_playwright_tests repo (if you have it):
|
|
94
|
+
cp /path/to/n8n_playwright_tests/mcp-genat/rules/genat-mcp.mdc .cursor/rules/
|
|
95
|
+
```
|
|
96
|
+
If the rule file is missing (e.g. genat-mcp installed from npm before rules were added), create `.cursor/rules/genat-mcp.mdc` with:
|
|
97
|
+
|
|
98
|
+
```markdown
|
|
99
|
+
---
|
|
100
|
+
description: GenAT MCP and run-genat workaround - use webhook-genat-login
|
|
101
|
+
alwaysApply: true
|
|
102
|
+
---
|
|
103
|
+
|
|
104
|
+
# GenAT MCP and run-genat.mjs Workaround
|
|
105
|
+
|
|
106
|
+
When creating run-genat.mjs: Use webhook-genat-login, NOT webhook-genat. Prefer `node node_modules/genat-mcp/run-genat.mjs <url> .` Never use webhook-genat.
|
|
107
|
+
```
|
|
108
|
+
|
|
88
109
|
## Tool: GenAT
|
|
89
110
|
|
|
90
111
|
- **url** (string): Page URL to analyze for accessibility.
|
package/index.js
CHANGED
|
@@ -51,7 +51,7 @@ function insecureHttpsFetch(url, { method = 'GET', headers = {}, body }) {
|
|
|
51
51
|
const server = new McpServer(
|
|
52
52
|
{
|
|
53
53
|
name: 'GenAT',
|
|
54
|
-
version: '2.1.
|
|
54
|
+
version: '2.1.2',
|
|
55
55
|
},
|
|
56
56
|
{
|
|
57
57
|
capabilities: {
|
|
@@ -64,7 +64,7 @@ server.registerTool(
|
|
|
64
64
|
'GenAT',
|
|
65
65
|
{
|
|
66
66
|
description:
|
|
67
|
-
'Generate accessibility tests for a URL based on the project folder. Analyzes the page (DOM + a11y), detects project framework (TypeScript, JavaScript, or Python, BDD, Page Object), and returns generated test files (feature, spec/step defs, page objects). Optionally write files to the project folder.',
|
|
67
|
+
'Generate accessibility tests for a URL based on the project folder. Analyzes the page (DOM + a11y), detects project framework (TypeScript, JavaScript, or Python, BDD, Page Object), and returns generated test files (feature, spec/step defs, page objects). Optionally write files to the project folder. On failure: use node node_modules/genat-mcp/run-genat.mjs (webhook-genat-login). Do not create run-genat.mjs with webhook-genat.',
|
|
68
68
|
inputSchema: {
|
|
69
69
|
url: z.string().describe('Page URL to analyze for accessibility (e.g. https://example.com)'),
|
|
70
70
|
parentProjectFolder: z
|
|
@@ -142,6 +142,7 @@ server.registerTool(
|
|
|
142
142
|
error: 'Failed to call n8n webhook',
|
|
143
143
|
message: err instanceof Error ? err.message : String(err),
|
|
144
144
|
hint: 'Set N8N_WEBHOOK_URL to your n8n webhook URL. For self-signed/internal certs, set N8N_INSECURE_TLS=1',
|
|
145
|
+
workaround: 'Run: N8N_WEBHOOK_URL=\'https://your-n8n/webhook-test/webhook-genat-login\' N8N_INSECURE_TLS=1 node node_modules/genat-mcp/run-genat.mjs "<url>" . Use webhook-genat-login (not webhook-genat). Do not create run-genat.mjs with webhook-genat.',
|
|
145
146
|
}),
|
|
146
147
|
},
|
|
147
148
|
],
|
|
@@ -151,6 +152,7 @@ server.registerTool(
|
|
|
151
152
|
|
|
152
153
|
if (!response.ok) {
|
|
153
154
|
const text = await response.text();
|
|
155
|
+
const is404 = response.status === 404;
|
|
154
156
|
return {
|
|
155
157
|
content: [
|
|
156
158
|
{
|
|
@@ -158,6 +160,9 @@ server.registerTool(
|
|
|
158
160
|
text: JSON.stringify({
|
|
159
161
|
error: `n8n returned ${response.status}`,
|
|
160
162
|
body: text.slice(0, 1000),
|
|
163
|
+
...(is404 && {
|
|
164
|
+
workaround: 'Use webhook-genat-login (not webhook-genat). Run: N8N_WEBHOOK_URL=\'https://your-n8n/webhook-test/webhook-genat-login\' N8N_INSECURE_TLS=1 node node_modules/genat-mcp/run-genat.mjs "<url>" . Do not create run-genat.mjs with webhook-genat.',
|
|
165
|
+
}),
|
|
161
166
|
}),
|
|
162
167
|
},
|
|
163
168
|
],
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "genat-mcp",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.2",
|
|
4
4
|
"mcpName": "io.github.asokans@oclc.org/genat",
|
|
5
5
|
"description": "MCP server GenAT: generate accessibility tests via n8n workflow (url + project folder)",
|
|
6
6
|
"type": "module",
|
|
7
7
|
"main": "index.js",
|
|
8
8
|
"bin": { "genat-mcp": "index.js" },
|
|
9
9
|
"engines": { "node": ">=20" },
|
|
10
|
-
"files": ["index.js", "detect-framework.js", "detect-login.js", "write-files.js", "run-genat.mjs"],
|
|
10
|
+
"files": ["index.js", "detect-framework.js", "detect-login.js", "write-files.js", "run-genat.mjs", "rules/genat-mcp.mdc"],
|
|
11
11
|
"keywords": ["mcp", "accessibility", "playwright", "n8n", "model-context-protocol", "a11y", "testing"],
|
|
12
12
|
"repository": {
|
|
13
13
|
"type": "git",
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
---
|
|
2
|
+
description: GenAT MCP and run-genat workaround - use webhook-genat-login
|
|
3
|
+
alwaysApply: true
|
|
4
|
+
---
|
|
5
|
+
|
|
6
|
+
# GenAT MCP and run-genat.mjs Workaround
|
|
7
|
+
|
|
8
|
+
## When GenAT MCP fails
|
|
9
|
+
|
|
10
|
+
- **Do NOT** write files from a previous successful MCP run or cached output
|
|
11
|
+
- **Do** inform the user that the MCP call failed and why
|
|
12
|
+
- **Do** suggest steps to fix (webhook URL, network, n8n workflow activation)
|
|
13
|
+
- **Do** wait for the user to resolve the MCP connection before generating files
|
|
14
|
+
|
|
15
|
+
Only write generated files when the MCP tool returns a successful response.
|
|
16
|
+
|
|
17
|
+
## When creating run-genat.mjs as a workaround
|
|
18
|
+
|
|
19
|
+
**CRITICAL: Use webhook-genat-login, NOT webhook-genat.** The webhook path must end with `webhook-genat-login`. Using `webhook-genat` causes 404.
|
|
20
|
+
|
|
21
|
+
- **Prefer:** Have the user run `node node_modules/genat-mcp/run-genat.mjs <url> .` (if genat-mcp is installed). This script defaults to webhook-genat-login.
|
|
22
|
+
- **If creating a new run-genat.mjs:** Copy from `node_modules/genat-mcp/run-genat.mjs` or ensure the default webhook is `.../webhook-test/webhook-genat-login`. Never use `webhook-genat`.
|
|
23
|
+
- **N8N_WEBHOOK_URL** must point to `.../webhook-test/webhook-genat-login`
|
|
24
|
+
- **N8N_INSECURE_TLS=1** for self-signed certs (e.g. K8s)
|
|
25
|
+
|
|
26
|
+
Example:
|
|
27
|
+
```bash
|
|
28
|
+
N8N_WEBHOOK_URL='https://your-n8n/webhook-test/webhook-genat-login' N8N_INSECURE_TLS=1 node node_modules/genat-mcp/run-genat.mjs https://example.com .
|
|
29
|
+
```
|