websiteampel-mcp 0.0.0-stage → 0.1.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/README.md +45 -2
- package/dist/index.js +195 -0
- package/package.json +45 -4
package/README.md
CHANGED
|
@@ -1,3 +1,46 @@
|
|
|
1
|
-
#
|
|
1
|
+
# websiteampel-mcp
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
MCP-Server für [Websiteampel](https://websiteampel.de): Website auf Tracker vor der Einwilligung, externe Schriften,
|
|
4
|
+
Cookie-Banner, Impressum und Datenschutzerklärung, Verschlüsselung und Barrierefreiheit prüfen, und die Funde direkt
|
|
5
|
+
im Editor beheben lassen.
|
|
6
|
+
|
|
7
|
+
## Einrichtung
|
|
8
|
+
|
|
9
|
+
Claude Code:
|
|
10
|
+
|
|
11
|
+
```bash
|
|
12
|
+
claude mcp add websiteampel -- npx -y websiteampel-mcp
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
Cursor, Windsurf, Claude Desktop (`mcp.json` bzw. `claude_desktop_config.json`):
|
|
16
|
+
|
|
17
|
+
```json
|
|
18
|
+
{
|
|
19
|
+
"mcpServers": {
|
|
20
|
+
"websiteampel": { "command": "npx", "args": ["-y", "websiteampel-mcp"] }
|
|
21
|
+
}
|
|
22
|
+
}
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Werkzeuge
|
|
26
|
+
|
|
27
|
+
| Werkzeug | Was es tut |
|
|
28
|
+
|---|---|
|
|
29
|
+
| `check_website` | Prüft eine Adresse, wartet auf den Befund, liefert Ampel, Funde, Belege und Anleitung des schwersten Funds strukturiert. |
|
|
30
|
+
| `get_report` | Holt einen vorhandenen Befund per Scan-ID oder Befund-URL. |
|
|
31
|
+
| `fix_plan` | Priorisierter Maßnahmenplan mit Aufwand, Schritten und Plattform-Hinweisen als Aufgabenliste. |
|
|
32
|
+
| `agent_brief` | Markdown-Arbeitsauftrag mit Funden, Belegen, Blockliste und Aufgaben. |
|
|
33
|
+
| `consent_blocklist` | Hosts, die das Consent-Tool vor der Einwilligung blockieren muss. |
|
|
34
|
+
| `privacy_texts` | Fertige Abschnitte für die Datenschutzerklärung je fehlendem Dienst. |
|
|
35
|
+
| `recheck` | Erneut prüfen und mit einem früheren Befund vergleichen: behoben, neu. |
|
|
36
|
+
|
|
37
|
+
Kostenlos: Ampel, alle Funde mit Einordnung, der schwerste Fund komplett. Belege und Anleitungen für alle Funde,
|
|
38
|
+
Blockliste, Textbausteine und der komplette Agent-Brief sind im Report (19 € einmalig) oder im Monitoring (9 €/Monat)
|
|
39
|
+
enthalten; freigeschaltete Befunde liefert der Server vollständig.
|
|
40
|
+
|
|
41
|
+
Typischer Ablauf im Editor: `check_website` → `fix_plan` → Punkte abarbeiten → `recheck` mit der alten Scan-ID.
|
|
42
|
+
|
|
43
|
+
## Hinweise
|
|
44
|
+
|
|
45
|
+
Der Server ruft nur die öffentliche Websiteampel-API auf. Es werden keine Dateien gelesen oder geschrieben.
|
|
46
|
+
`WEBSITEAMPEL_BASE_URL` erlaubt eine andere Instanz. Lizenz: MIT.
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Websiteampel MCP-Server (stdio).
|
|
4
|
+
* Prüft Websites über die Websiteampel-API und liefert Funde, Belege, Maßnahmenplan, Blockliste,
|
|
5
|
+
* Textbausteine und den Agent-Brief strukturiert an Cursor, Claude Code, Windsurf oder andere MCP-Clients.
|
|
6
|
+
*
|
|
7
|
+
* Konfiguration:
|
|
8
|
+
* WEBSITEAMPEL_BASE_URL (Standard https://websiteampel.de)
|
|
9
|
+
*/
|
|
10
|
+
import { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js";
|
|
11
|
+
import { StdioServerTransport } from "@modelcontextprotocol/sdk/server/stdio.js";
|
|
12
|
+
import { z } from "zod";
|
|
13
|
+
const BASE = (process.env.WEBSITEAMPEL_BASE_URL ?? "https://websiteampel.de").replace(/\/$/, "");
|
|
14
|
+
async function api(path, init) {
|
|
15
|
+
const res = await fetch(`${BASE}${path}`, { ...init, headers: { "Content-Type": "application/json", "User-Agent": "websiteampel-mcp/0.1", ...(init?.headers ?? {}) } });
|
|
16
|
+
const data = (await res.json().catch(() => ({})));
|
|
17
|
+
if (!res.ok)
|
|
18
|
+
throw new Error(data.error || `Websiteampel antwortet mit Status ${res.status}`);
|
|
19
|
+
return data;
|
|
20
|
+
}
|
|
21
|
+
async function startScan(url) {
|
|
22
|
+
return api("/api/scan", { method: "POST", body: JSON.stringify({ url, variant: "pflicht", sessionId: "mcp" }) });
|
|
23
|
+
}
|
|
24
|
+
async function getScan(id) {
|
|
25
|
+
return api(`/api/scan/${id}`);
|
|
26
|
+
}
|
|
27
|
+
async function waitForScan(id, timeoutMs = 90_000) {
|
|
28
|
+
const t0 = Date.now();
|
|
29
|
+
for (;;) {
|
|
30
|
+
const s = await getScan(id);
|
|
31
|
+
if (s.status === "done" || s.status === "error")
|
|
32
|
+
return s;
|
|
33
|
+
if (Date.now() - t0 > timeoutMs)
|
|
34
|
+
throw new Error("Die Prüfung dauert länger als erwartet. Später mit get_report und der ID erneut abrufen: " + id);
|
|
35
|
+
await new Promise((r) => setTimeout(r, 2000));
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
function compact(s) {
|
|
39
|
+
const r = s.result;
|
|
40
|
+
return {
|
|
41
|
+
scanId: s.id,
|
|
42
|
+
reportUrl: `${BASE}/report/${s.id}`,
|
|
43
|
+
domain: r.domain,
|
|
44
|
+
scannedAt: r.scannedAt,
|
|
45
|
+
platform: r.platform ?? null,
|
|
46
|
+
overall: r.counts.rot > 0 ? "rot" : r.counts.gelb > 0 ? "gelb" : "gruen",
|
|
47
|
+
counts: r.counts,
|
|
48
|
+
unlocked: r.unlocked,
|
|
49
|
+
monitored: r.monitored,
|
|
50
|
+
checks: r.checks.map((c) => ({
|
|
51
|
+
id: c.id,
|
|
52
|
+
name: c.name,
|
|
53
|
+
severity: c.severity,
|
|
54
|
+
verdict: c.verdict,
|
|
55
|
+
findings: c.findings.map((f) => ({
|
|
56
|
+
id: f.id,
|
|
57
|
+
severity: f.severity,
|
|
58
|
+
title: f.title,
|
|
59
|
+
summary: f.summary,
|
|
60
|
+
locked: f.locked,
|
|
61
|
+
...(f.locked ? { lockedEvidence: f.evidenceCount, lockedFixSteps: f.fixStepCount } : { evidence: f.evidence ?? [], fix: f.fix ?? [], fixByPlatform: f.fixByPlatform ?? {} }),
|
|
62
|
+
})),
|
|
63
|
+
})),
|
|
64
|
+
worstFindingId: r.worstFindingId,
|
|
65
|
+
deliverables: r.deliverables,
|
|
66
|
+
...(r.unlocked ? { plan: r.plan ?? [], blocklist: r.deliverables.blocklist, privacyTexts: r.privacyTexts ?? [] } : { unlockUrl: `${BASE}/report/${s.id}`, unlockHint: "Belege und Anleitungen für alle Funde, Blockliste, Textbausteine und der komplette Agent-Brief sind im Report (19 € einmalig) oder im Monitoring (9 €/Monat) enthalten. Der schwerste Fund ist immer komplett sichtbar." }),
|
|
67
|
+
};
|
|
68
|
+
}
|
|
69
|
+
const server = new McpServer({ name: "websiteampel", version: "0.1.0" });
|
|
70
|
+
server.registerTool("check_website", {
|
|
71
|
+
title: "Website prüfen",
|
|
72
|
+
description: "Prüft eine Website wie ein neuer Besucher (ein Seitenaufruf, nichts anklicken) auf Tracker und Cookies vor der Einwilligung, externe Schriften, Cookie-Banner, Impressum und Datenschutzerklärung, Verschlüsselung und Barrierefreiheit (WCAG 2.2 AA). Liefert Ampel pro Prüfpunkt, alle Funde mit Einordnung, den schwersten Fund mit Belegen und Anleitung. Dauert 5 bis 60 Sekunden. Ergebnisse derselben Domain werden 30 Minuten wiederverwendet.",
|
|
73
|
+
inputSchema: { url: z.string().describe("Adresse der Website, z. B. https://meine-firma.de oder nur meine-firma.de") },
|
|
74
|
+
}, async ({ url }) => {
|
|
75
|
+
const started = await startScan(url);
|
|
76
|
+
const s = await waitForScan(started.id);
|
|
77
|
+
if (s.status === "error")
|
|
78
|
+
return { content: [{ type: "text", text: `Prüfung nicht möglich: ${s.error}` }], isError: true };
|
|
79
|
+
return { content: [{ type: "text", text: JSON.stringify(compact(s), null, 2) }] };
|
|
80
|
+
});
|
|
81
|
+
server.registerTool("get_report", {
|
|
82
|
+
title: "Befund abrufen",
|
|
83
|
+
description: "Holt einen vorhandenen Befund anhand der Scan-ID (aus check_website oder aus einer Befund-URL websiteampel.de/report/<id>). Bei freigeschalteten Reports mit Maßnahmenplan, Blockliste und Textbausteinen.",
|
|
84
|
+
inputSchema: { scanId: z.string().describe("Scan-ID (UUID) oder vollständige Befund-URL") },
|
|
85
|
+
}, async ({ scanId }) => {
|
|
86
|
+
const id = scanId.match(/[0-9a-f-]{36}/i)?.[0];
|
|
87
|
+
if (!id)
|
|
88
|
+
return { content: [{ type: "text", text: "Keine gültige Scan-ID gefunden." }], isError: true };
|
|
89
|
+
const s = await waitForScan(id);
|
|
90
|
+
if (s.status === "error")
|
|
91
|
+
return { content: [{ type: "text", text: `Prüfung fehlgeschlagen: ${s.error}` }], isError: true };
|
|
92
|
+
return { content: [{ type: "text", text: JSON.stringify(compact(s), null, 2) }] };
|
|
93
|
+
});
|
|
94
|
+
server.registerTool("fix_plan", {
|
|
95
|
+
title: "Maßnahmenplan",
|
|
96
|
+
description: "Liefert den priorisierten Maßnahmenplan eines Befunds mit Aufwand je Punkt sowie je Fund die konkreten Schritte und Plattform-Hinweise, als Aufgabenliste zum Abarbeiten. Vollständig nur bei freigeschaltetem Report oder Monitoring; sonst nur der schwerste Fund.",
|
|
97
|
+
inputSchema: { scanId: z.string().describe("Scan-ID oder Befund-URL") },
|
|
98
|
+
}, async ({ scanId }) => {
|
|
99
|
+
const id = scanId.match(/[0-9a-f-]{36}/i)?.[0];
|
|
100
|
+
if (!id)
|
|
101
|
+
return { content: [{ type: "text", text: "Keine gültige Scan-ID gefunden." }], isError: true };
|
|
102
|
+
const s = await waitForScan(id);
|
|
103
|
+
const r = s.result;
|
|
104
|
+
if (!r)
|
|
105
|
+
return { content: [{ type: "text", text: `Kein Befund: ${s.error ?? s.status}` }], isError: true };
|
|
106
|
+
const findings = r.checks.flatMap((c) => c.findings).filter((f) => f.severity !== "gruen");
|
|
107
|
+
const tasks = (r.plan ?? findings.map((f) => ({ id: f.id, title: f.title, severity: f.severity, check: f.check, effortMin: 0 }))).map((p) => {
|
|
108
|
+
const f = findings.find((x) => x.id === p.id);
|
|
109
|
+
return {
|
|
110
|
+
...p,
|
|
111
|
+
locked: f?.locked ?? true,
|
|
112
|
+
steps: f?.locked ? [] : f?.fix ?? [],
|
|
113
|
+
platformHint: f && !f.locked && r.platform ? f.fixByPlatform?.[r.platform] ?? null : null,
|
|
114
|
+
evidence: f?.locked ? [] : f?.evidence ?? [],
|
|
115
|
+
};
|
|
116
|
+
});
|
|
117
|
+
return {
|
|
118
|
+
content: [
|
|
119
|
+
{
|
|
120
|
+
type: "text",
|
|
121
|
+
text: JSON.stringify({ scanId: s.id, domain: r.domain, platform: r.platform ?? null, unlocked: r.unlocked, totalEffortMin: r.deliverables.effortMin, tasks, ...(r.unlocked ? {} : { unlockUrl: `${BASE}/report/${s.id}` }) }, null, 2),
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
};
|
|
125
|
+
});
|
|
126
|
+
server.registerTool("agent_brief", {
|
|
127
|
+
title: "Agent-Brief",
|
|
128
|
+
description: "Markdown-Brief mit Funden, Belegen, Blockliste und Aufgaben, formuliert als Arbeitsauftrag für einen Coding-Agenten. Vollständig bei freigeschaltetem Report oder Monitoring, sonst nur für den schwersten Fund.",
|
|
129
|
+
inputSchema: { scanId: z.string().describe("Scan-ID oder Befund-URL") },
|
|
130
|
+
}, async ({ scanId }) => {
|
|
131
|
+
const id = scanId.match(/[0-9a-f-]{36}/i)?.[0];
|
|
132
|
+
if (!id)
|
|
133
|
+
return { content: [{ type: "text", text: "Keine gültige Scan-ID gefunden." }], isError: true };
|
|
134
|
+
const s = await waitForScan(id);
|
|
135
|
+
if (!s.brief)
|
|
136
|
+
return { content: [{ type: "text", text: s.error ? `Prüfung fehlgeschlagen: ${s.error}` : "Kein Brief vorhanden (keine Funde)." }] };
|
|
137
|
+
return { content: [{ type: "text", text: s.brief }] };
|
|
138
|
+
});
|
|
139
|
+
server.registerTool("consent_blocklist", {
|
|
140
|
+
title: "Blockliste für das Cookie-Banner",
|
|
141
|
+
description: "Hosts, die das Consent-Tool vor der Einwilligung blockieren muss, aus dem echten Seitenaufruf. Nur bei freigeschaltetem Report oder Monitoring.",
|
|
142
|
+
inputSchema: { scanId: z.string().describe("Scan-ID oder Befund-URL") },
|
|
143
|
+
}, async ({ scanId }) => {
|
|
144
|
+
const id = scanId.match(/[0-9a-f-]{36}/i)?.[0];
|
|
145
|
+
if (!id)
|
|
146
|
+
return { content: [{ type: "text", text: "Keine gültige Scan-ID gefunden." }], isError: true };
|
|
147
|
+
const s = await waitForScan(id);
|
|
148
|
+
const r = s.result;
|
|
149
|
+
if (!r)
|
|
150
|
+
return { content: [{ type: "text", text: `Kein Befund: ${s.error ?? s.status}` }], isError: true };
|
|
151
|
+
if (!r.unlocked)
|
|
152
|
+
return { content: [{ type: "text", text: `Blockliste (${r.deliverables.blocklist.length} Hosts) ist Teil des Reports: ${BASE}/report/${s.id}` }] };
|
|
153
|
+
return { content: [{ type: "text", text: JSON.stringify({ domain: r.domain, blocklist: r.deliverables.blocklist }, null, 2) }] };
|
|
154
|
+
});
|
|
155
|
+
server.registerTool("privacy_texts", {
|
|
156
|
+
title: "Textbausteine für die Datenschutzerklärung",
|
|
157
|
+
description: "Fertige deutsche Abschnitte für Dienste, die die Website lädt, aber die Datenschutzerklärung nicht nennt. Platzhalter in eckigen Klammern ausfüllen. Nur bei freigeschaltetem Report oder Monitoring.",
|
|
158
|
+
inputSchema: { scanId: z.string().describe("Scan-ID oder Befund-URL") },
|
|
159
|
+
}, async ({ scanId }) => {
|
|
160
|
+
const id = scanId.match(/[0-9a-f-]{36}/i)?.[0];
|
|
161
|
+
if (!id)
|
|
162
|
+
return { content: [{ type: "text", text: "Keine gültige Scan-ID gefunden." }], isError: true };
|
|
163
|
+
const s = await waitForScan(id);
|
|
164
|
+
const r = s.result;
|
|
165
|
+
if (!r)
|
|
166
|
+
return { content: [{ type: "text", text: `Kein Befund: ${s.error ?? s.status}` }], isError: true };
|
|
167
|
+
if (!r.unlocked)
|
|
168
|
+
return { content: [{ type: "text", text: `Fehlende Dienste: ${r.deliverables.privacyServices.join(", ") || "keine"}. Die Textbausteine sind Teil des Reports: ${BASE}/report/${s.id}` }] };
|
|
169
|
+
return { content: [{ type: "text", text: JSON.stringify({ domain: r.domain, texts: r.privacyTexts ?? [] }, null, 2) }] };
|
|
170
|
+
});
|
|
171
|
+
server.registerTool("recheck", {
|
|
172
|
+
title: "Erneut prüfen",
|
|
173
|
+
description: "Prüft eine Domain nach Änderungen erneut und vergleicht mit einem früheren Befund: welche Funde sind weg, welche neu. Hinweis: Innerhalb von 30 Minuten nach der letzten Prüfung wird das vorhandene Ergebnis wiederverwendet.",
|
|
174
|
+
inputSchema: { url: z.string().describe("Adresse der Website"), previousScanId: z.string().optional().describe("Scan-ID des früheren Befunds zum Vergleich") },
|
|
175
|
+
}, async ({ url, previousScanId }) => {
|
|
176
|
+
const started = await startScan(url);
|
|
177
|
+
const s = await waitForScan(started.id);
|
|
178
|
+
if (s.status === "error" || !s.result)
|
|
179
|
+
return { content: [{ type: "text", text: `Prüfung nicht möglich: ${s.error}` }], isError: true };
|
|
180
|
+
const now = compact(s);
|
|
181
|
+
let diff = null;
|
|
182
|
+
const prevId = previousScanId?.match(/[0-9a-f-]{36}/i)?.[0];
|
|
183
|
+
if (prevId) {
|
|
184
|
+
const p = await getScan(prevId);
|
|
185
|
+
if (p.result) {
|
|
186
|
+
const ids = (v) => new Set(v.result.checks.flatMap((c) => c.findings).filter((f) => f.severity === "rot" || f.severity === "gelb").map((f) => f.id));
|
|
187
|
+
const before = ids(p);
|
|
188
|
+
const after = ids(s);
|
|
189
|
+
diff = { fixed: [...before].filter((x) => !after.has(x)), new: [...after].filter((x) => !before.has(x)), reused: started.reused };
|
|
190
|
+
}
|
|
191
|
+
}
|
|
192
|
+
return { content: [{ type: "text", text: JSON.stringify({ ...now, diff }, null, 2) }] };
|
|
193
|
+
});
|
|
194
|
+
const transport = new StdioServerTransport();
|
|
195
|
+
await server.connect(transport);
|
package/package.json
CHANGED
|
@@ -1,6 +1,47 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "websiteampel-mcp",
|
|
3
|
-
"version": "0.
|
|
4
|
-
"
|
|
5
|
-
"
|
|
6
|
-
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "MCP-Server für Websiteampel: Website auf Datenschutz, Impressum, Cookie-Banner, Verschlüsselung und Barrierefreiheit prüfen und die Funde direkt im Editor beheben.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"type": "module",
|
|
7
|
+
"bin": {
|
|
8
|
+
"websiteampel-mcp": "dist/index.js"
|
|
9
|
+
},
|
|
10
|
+
"files": [
|
|
11
|
+
"dist",
|
|
12
|
+
"README.md"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"build": "tsc -p tsconfig.json && chmod +x dist/index.js",
|
|
16
|
+
"start": "node dist/index.js"
|
|
17
|
+
},
|
|
18
|
+
"dependencies": {
|
|
19
|
+
"@modelcontextprotocol/sdk": "^1.12.0",
|
|
20
|
+
"zod": "^3.24.0"
|
|
21
|
+
},
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@types/node": "^22",
|
|
24
|
+
"typescript": "^5"
|
|
25
|
+
},
|
|
26
|
+
"engines": {
|
|
27
|
+
"node": ">=18"
|
|
28
|
+
},
|
|
29
|
+
"keywords": [
|
|
30
|
+
"mcp",
|
|
31
|
+
"dsgvo",
|
|
32
|
+
"website-check",
|
|
33
|
+
"barrierefreiheit",
|
|
34
|
+
"cursor",
|
|
35
|
+
"claude-code",
|
|
36
|
+
"lovable"
|
|
37
|
+
],
|
|
38
|
+
"repository": {
|
|
39
|
+
"type": "git",
|
|
40
|
+
"url": "git+https://github.com/iamsaad82/check-landingpage.git",
|
|
41
|
+
"directory": "mcp"
|
|
42
|
+
},
|
|
43
|
+
"homepage": "https://websiteampel.de/mcp",
|
|
44
|
+
"bugs": {
|
|
45
|
+
"url": "https://github.com/iamsaad82/check-landingpage/issues"
|
|
46
|
+
}
|
|
47
|
+
}
|