mcp-audit-rgpd
by ISPro02
README.md
# API Audit RGPD & EU AI Act
> πͺπΊ **Commercial Micro-API** β Automated GDPR & EU AI Act compliance auditing for any public website, monetized via the [x402 payment protocol](https://x402.org) (0.25 USDC on Base network).
[](./LICENSE)
[](https://nodejs.org)
[](https://x402.org)
[](https://gdpr.eu)
[](https://artificialintelligenceact.eu)
---
## β¨ What It Does
This API performs a **100% local, zero-cost** compliance audit of any public website against:
| Regulation | Checks |
|---|---|
| **GDPR (Art. 7, 13, 14, 32)** | HTTPS encryption, third-party trackers, cookie consent (CMP), privacy policy, legal notices |
| **ePrivacy Directive** | Trackers loading without prior consent |
| **EU AI Act (Art. 50)** | Generative AI tools detected without transparency disclosure |
| **French LCEN** | Legal notices (mentions lΓ©gales) presence |
**Returns a JSON report** with a compliance score out of 100, detected risks, and prioritized recommendations.
---
## π° Pricing & Payment
| Field | Value |
|---|---|
| **Price** | 0.25 USDC per audit |
| **Network** | Base (mainnet) or Base Sepolia (testnet) |
| **Protocol** | [x402](https://x402.org) β HTTP-native micropayments |
| **Wallet** | `0xB1b0f5a198D1a8344d32172f29D73fa3FaA74B4c` |
The API follows the **x402 standard**: the client receives a `402 Payment Required` response with payment instructions, pays on-chain, and retries the request with proof.
---
## π Quick Start
### Prerequisites
- Node.js 18+
- An x402-compatible wallet with USDC on Base (for paid usage)
### Install & Run
```bash
git clone https://github.com/votre-org/api-audit-rgpd
cd api-audit-rgpd
npm install
cp .env.example .env # Edit NETWORK and WALLET_ADDRESS if needed
npm start
```
The server starts at `http://localhost:3000`.
### Environment Variables
```env
NETWORK=base-sepolia # base | base-sepolia
WALLET_ADDRESS=0xB1b0...4c # Your receiving wallet
PRICE_USDC=0.25 # Price per audit
PORT=3000 # HTTP port
```
---
## π‘ API Reference
### `GET /` β Free Manifest
Returns a JSON description of the API (pricing, endpoints, MCP server info). No payment required.
```bash
curl http://localhost:3000/
```
**Response:**
```json
{
"name": "API Audit RGPD & EU AI Act",
"version": "1.0.0",
"pricing": { "amount": 0.25, "currency": "USDC", "network": "base-sepolia", "protocol": "x402" },
"endpoints": [...]
}
```
---
### `GET /api/audit?url=https://...` β Paid Audit (0.25 USDC)
Audits a public website for GDPR & EU AI Act compliance.
**Without payment** β `402 Payment Required` with x402 instructions.
**With x402 payment header** β Full JSON audit report.
```bash
# Without payment (shows 402 + payment info)
curl "http://localhost:3000/api/audit?url=https://www.example.com"
# With x402 payment (using an x402-compatible client)
x402-client "http://localhost:3000/api/audit?url=https://www.example.com"
```
**Parameters:**
| Param | Type | Required | Description |
|---|---|---|---|
| `url` | string | β
| Full URL to audit (must start with `https://` or `http://`) |
**Response Fields:**
| Field | Type | Description |
|---|---|---|
| `url_auditee` | string | Final URL after redirects |
| `https_detecte` | boolean | Whether HTTPS is active |
| `trackers_detectes` | string[] | List of third-party trackers found |
| `cmp_detecte` | boolean | Whether a cookie consent platform was found |
| `cmp_identifiees` | string[] | Named CMPs detected (Axeptio, Didomi, etc.) |
| `politique_confidentialite` | boolean | Privacy policy link found |
| `mentions_legales` | boolean | Legal notices found |
| `ia_generative_detectee` | boolean | Generative AI tools detected |
| `ia_outils_detectes` | string[] | Named AI tools detected |
| `score_conformite` | number | Compliance score (0β100) |
| `risques_detectes` | string[] | List of detected risks with regulation references |
| `recommandations_prioritaires` | string[] | Prioritized action items |
| `timestamp` | string | ISO 8601 audit date |
| `duree_ms` | number | Analysis duration in milliseconds |
**Example response (Wikipedia):**
```json
{
"url_auditee": "https://www.wikipedia.org/",
"https_detecte": true,
"trackers_detectes": [],
"cmp_detecte": false,
"politique_confidentialite": true,
"mentions_legales": false,
"ia_generative_detectee": false,
"score_conformite": 65,
"risques_detectes": ["π΄ Aucune CMP / bandeau de consentement cookies dΓ©tectΓ©"],
"recommandations_prioritaires": ["ImplΓ©menter une CMP..."],
"timestamp": "2024-01-15T10:30:00.000Z",
"duree_ms": 450
}
```
---
## π MCP Server (Claude Desktop / Cursor / Continue)
This project ships as a **Model Context Protocol (MCP) server**, letting any MCP client (Claude Desktop, Cursor, Continue.dev, etc.) call the audit as a native tool.
### Configure in Claude Desktop
Add to `~/.config/claude-desktop/claude_desktop_config.json`:
```json
{
"mcpServers": {
"audit-rgpd": {
"command": "node",
"args": ["/path/to/api-audit-rgpd/mcp-server.js"],
"env": {
"NETWORK": "base-sepolia",
"WALLET_ADDRESS": "0xB1b0f5a198D1a8344d32172f29D73fa3FaA74B4c"
}
}
}
}
```
### Available MCP Tool
| Tool | Description |
|---|---|
| `audit_eu_compliance` | Audit any URL for GDPR & EU AI Act compliance. Returns full JSON report with score and recommendations. |
---
## π What Gets Detected
### Third-Party Trackers
Google Analytics (GA4), Google Tag Manager, Meta Pixel, TikTok Pixel, Hotjar, DoubleClick, LinkedIn Insight, Twitter/X Pixel, Criteo, HubSpot, Segment, Mixpanel, Amplitude, Intercom.
### Cookie Consent Platforms (CMPs)
Axeptio, Didomi, Cookiebot, OneTrust, Tarteaucitron, TrustArc, Quantcast CMP, Usercentrics, CookieYes, Iubenda.
### Generative AI Tools (EU AI Act Art. 50)
OpenAI widget, Intercom AI (Fin), Crisp, Drift, Tidio, Zendesk AI, Botsify, ManyChat, Cohere, Anthropic/Claude.
---
## ποΈ Architecture
```
api-audit-rgpd/
βββ index.js # Express server + x402 middleware
βββ mcp-server.js # MCP stdio server
βββ lib/
β βββ auditor.js # Core audit engine (100% local, 0 β¬ cost)
βββ test-client.js # Test suite (npm test)
βββ .env # Configuration
βββ README.md
```
**Zero external API cost**: The audit engine uses only Node.js built-in modules and Cheerio for HTML parsing. No LLM calls, no paid APIs. Server cost = **β¬0 per request**.
---
## π§ͺ Testing
```bash
npm test
```
Runs 3 test suites:
1. `GET /` β Valid JSON manifest with correct pricing fields
2. `GET /api/audit` β HTTP 402 without payment (x402 response format)
3. Live audit of `https://www.wikipedia.org` β Valid report structure
---
## π Scoring Methodology
| Criterion | Points |
|---|---|
| β
HTTPS enabled | +20 |
| β
CMP / cookie banner present | +20 |
| β
Privacy policy linked | +20 |
| β
Legal notices present | +15 |
| β
Zero third-party trackers | +25 |
| β Trackers without consent (per 2 trackers) | -10 (max -30) |
| β Generative AI without transparency notice | -10 |
---
## βοΈ Legal Disclaimer
This tool provides **automated indicative analysis only**. It does not constitute legal advice. For full GDPR compliance, consult a qualified DPO (Data Protection Officer) or legal counsel.
---
## π License
[MIT](./LICENSE) Β© 2024 API Audit RGPD
This server cannot be deployed
Maintenance
ActivityMaintained
ResponsivenessNo recent community issues