@wcag-checkr/mcp 1.0.0-rc.98 → 1.0.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/package.json +1 -1
- package/wcagcheckr-mcp.mjs +54 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@wcag-checkr/mcp",
|
|
3
|
-
"version": "1.0.0
|
|
3
|
+
"version": "1.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "Model Context Protocol server for wcagcheckr. Lets LLM-IDEs (Claude Code, Cursor, Continue, etc.) drive accessibility audits, verify forensic receipts, and look up tier features programmatically. Same audit engine as the Chrome extension and CI runner.",
|
|
6
6
|
"license": "UNLICENSED",
|
package/wcagcheckr-mcp.mjs
CHANGED
|
@@ -77,6 +77,13 @@ const TOOLS = [
|
|
|
77
77
|
type: 'number',
|
|
78
78
|
description: 'Audit timeout in milliseconds. Default: 120000.',
|
|
79
79
|
},
|
|
80
|
+
license: {
|
|
81
|
+
type: 'string',
|
|
82
|
+
description:
|
|
83
|
+
'wcagcheckr license token. Required during the private build phase (team license only). ' +
|
|
84
|
+
'Falls back to WCAGCHECKR_LICENSE environment variable if omitted. ' +
|
|
85
|
+
'Email cliff@locustware.com for beta access.',
|
|
86
|
+
},
|
|
80
87
|
},
|
|
81
88
|
required: ['url'],
|
|
82
89
|
},
|
|
@@ -124,10 +131,27 @@ server.setRequestHandler(ListToolsRequestSchema, async () => ({
|
|
|
124
131
|
// ─── Tool implementations ────────────────────────────────────────────────────
|
|
125
132
|
|
|
126
133
|
async function auditUrl(args) {
|
|
127
|
-
const { url, format = 'json', threshold = 'serious', timeout_ms = 120_000 } = args;
|
|
134
|
+
const { url, format = 'json', threshold = 'serious', timeout_ms = 120_000, license } = args;
|
|
128
135
|
if (!url) {
|
|
129
136
|
return { isError: true, content: [{ type: 'text', text: 'Missing required field: url' }] };
|
|
130
137
|
}
|
|
138
|
+
// rc.124 — Headless-build lockdown gate. License required during private
|
|
139
|
+
// build. Accept from tool args first, fall back to WCAGCHECKR_LICENSE env.
|
|
140
|
+
const licenseToken = license ?? process.env.WCAGCHECKR_LICENSE;
|
|
141
|
+
if (!licenseToken) {
|
|
142
|
+
return {
|
|
143
|
+
isError: true,
|
|
144
|
+
content: [
|
|
145
|
+
{
|
|
146
|
+
type: 'text',
|
|
147
|
+
text:
|
|
148
|
+
'wcagcheckr is in private build phase. A team license is required. ' +
|
|
149
|
+
'Pass `license: "<token>"` in the audit_url args OR set WCAGCHECKR_LICENSE in your environment. ' +
|
|
150
|
+
'Email cliff@locustware.com for beta access.',
|
|
151
|
+
},
|
|
152
|
+
],
|
|
153
|
+
};
|
|
154
|
+
}
|
|
131
155
|
if (!existsSync(CI_RUNNER_PATH)) {
|
|
132
156
|
return {
|
|
133
157
|
isError: true,
|
|
@@ -139,12 +163,41 @@ async function auditUrl(args) {
|
|
|
139
163
|
],
|
|
140
164
|
};
|
|
141
165
|
}
|
|
166
|
+
// rc.342 — Per-feature tier gate. Hit the license validate endpoint
|
|
167
|
+
// directly to read the features blob; refuse if mcpServer is explicitly
|
|
168
|
+
// disabled. `features.mcpServer === undefined` falls through as permissive.
|
|
169
|
+
try {
|
|
170
|
+
const validateRes = await fetch(`${SERVER_BASE_URL}/v1/products/wcagcheckr/license/validate`, {
|
|
171
|
+
method: 'POST',
|
|
172
|
+
headers: { 'content-type': 'application/json' },
|
|
173
|
+
body: JSON.stringify({ token: licenseToken }),
|
|
174
|
+
});
|
|
175
|
+
if (validateRes.ok) {
|
|
176
|
+
const body = await validateRes.json();
|
|
177
|
+
if (body?.features && body.features.mcpServer === false) {
|
|
178
|
+
return {
|
|
179
|
+
isError: true,
|
|
180
|
+
content: [{
|
|
181
|
+
type: 'text',
|
|
182
|
+
text: 'wcagcheckr MCP server is not available on your current plan. Upgrade at https://wcagcheckr.com/pricing.',
|
|
183
|
+
}],
|
|
184
|
+
};
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
// Non-ok or parse failure: fall through. The CLI delegate will fail
|
|
188
|
+
// license validation itself if the token is bad; per-feature gating
|
|
189
|
+
// requires a successful validate, so a network glitch shouldn't lock
|
|
190
|
+
// out a paying customer.
|
|
191
|
+
} catch {
|
|
192
|
+
/* swallow — same fall-through rationale */
|
|
193
|
+
}
|
|
142
194
|
|
|
143
195
|
return new Promise((resolveResult) => {
|
|
144
196
|
const args = [
|
|
145
197
|
CI_RUNNER_PATH,
|
|
146
198
|
'audit',
|
|
147
199
|
url,
|
|
200
|
+
'--license', licenseToken,
|
|
148
201
|
'--format', format,
|
|
149
202
|
'--threshold', threshold,
|
|
150
203
|
'--timeout', String(timeout_ms),
|