Skip to main content
Glama
bhanu403

DarkLens Compliance & Dark Pattern Auditor

README.md
# DarkLens MCP Server πŸ€–πŸ”

> **Real-time deceptive design and dark pattern compliance auditor for AI coding agents.**

[![npm version](https://img.shields.io/npm/v/darklens-mcp.svg)](https://www.npmjs.com/package/darklens-mcp)
[![License: MIT](https://img.shields.io/badge/License-MIT-purple.svg)](https://opensource.org/licenses/MIT)

DarkLens MCP connects **Cursor, Windsurf, Claude Desktop, Antigravity, Lovable, v0, and Cline** directly to the DarkLens compliance auditing engine. Your AI coding agent can automatically audit staging URLs, check newly generated JSX/HTML components for deceptive patterns (GDPR, FTC Act Sec. 5, CCPA, EU DSA), and fix non-compliant UI before code is committed.

---

## ⚑ Quickstart Configuration by Coding Agent

### 1. πŸ–±οΈ Cursor
1. Go to **Cursor Settings** (`Ctrl + ,` or `Cmd + ,`) β†’ **Features** β†’ **MCP**.
2. Click **+ Add New MCP Server**.
3. Fill in:
   * **Name:** `darklens`
   * **Type:** `command`
   * **Command:** `npx -y darklens-mcp`
   * **Environment Variables:** `DARKLENS_API_KEY=dl_live_YOUR_KEY`
4. In Cursor Chat or Composer, prompt:
   > *"@darklens audit my checkout page and fix any illegal dark patterns."*

---

### 2. 🌊 Windsurf (Codeium)
Add to `~/.codeium/windsurf/mcp_config.json`:
```json
{
  "mcpServers": {
    "darklens": {
      "command": "npx",
      "args": ["-y", "darklens-mcp"],
      "env": {
        "DARKLENS_API_KEY": "dl_live_YOUR_KEY"
      }
    }
  }
}
```

---

### 3. 🧠 Claude Desktop / Claude Code (Anthropic)
Add to your `claude_desktop_config.json`:
```json
{
  "mcpServers": {
    "darklens": {
      "command": "npx",
      "args": ["-y", "darklens-mcp"],
      "env": {
        "DARKLENS_API_KEY": "dl_live_YOUR_KEY"
      }
    }
  }
}
```

---

### 4. πŸš€ Antigravity (Google / DeepMind)
Add to your Antigravity MCP settings or call via native MCP config:
```json
{
  "mcpServers": {
    "darklens": {
      "command": "npx",
      "args": ["-y", "darklens-mcp"],
      "env": {
        "DARKLENS_API_KEY": "dl_live_YOUR_KEY"
      }
    }
  }
}
```

---

### 5. ❀️ Lovable & v0 / Bolt.new
In Lovable, Bolt.new, or v0 terminal or agent custom tool integrations, execute:
```bash
npx -y darklens-mcp --key dl_live_YOUR_KEY
```
Or instruct the agent to run DarkLens CLI on preview URLs:
```bash
npx darklens <your-preview-url> --key $DARKLENS_API_KEY
```

---

### 6. πŸ’» VS Code (Cline / Roo Code)
1. Open the **Cline / Roo Code** sidebar tab.
2. Click the **MCP** icon β†’ **Configure MCP Servers**.
3. Add:
```json
{
  "mcpServers": {
    "darklens": {
      "command": "npx",
      "args": ["-y", "darklens-mcp"],
      "env": {
        "DARKLENS_API_KEY": "dl_live_YOUR_KEY"
      }
    }
  }
}
```

---

## πŸ› οΈ Exposed MCP Tools

| Tool | Description |
| :--- | :--- |
| **`darklens_audit_url`** | Audits any public or staging URL. Returns compliance score (0-100), pass/fail, and full findings with legal citations. |
| **`darklens_audit_html`** | Audits raw HTML/JSX markup generated by the AI agent before it writes files to disk. |
| **`darklens_get_fair_pattern_guide`** | Returns exact compliant alternatives and regulatory articles for any pattern (e.g. `forced_continuity`, `confirmshaming`). |

---

## πŸ”‘ Authentication

Every request requires a DarkLens API key (`dl_live_...`).
Get your key at [darklens.dev/dashboard](https://darklens.dev/dashboard).

---

## πŸ“„ License

MIT Β© [DarkLens](https://darklens.dev)

TDQS

A3.9/5.0

Scored across 3 tools

Disambiguation5/5

The three tools are cleanly separated by input type and purpose: auditing a live URL, auditing raw markup, and retrieving reference guidance. An agent can pick the right tool from the target artifact alone, with no overlap between them.

Naming Consistency5/5

All names use a uniform darklens_ prefix plus consistent verb_noun structure (audit_url, audit_html, get_fair_pattern_guide). The convention is predictable and the intent is readable from the name.

Tool Count4/5

Three tools map neatly to the domain's core actions (live audit, pre-commit audit, reference lookup), so nothing feels padded. It is slightly thinβ€”no batch, history, or export toolsβ€”but the scope is deliberately focused rather than incomplete by accident.

Completeness4/5

The audit lifecycle is covered from both a live-URL and a pre-production markup angle, plus a knowledge lookup for remediation, which suits the stated purpose well. Minor gaps exist around saving/comparing past audits or exporting reports, but agents can work around them by re-running audits.

Maintenance

ActivityMaintained
ResponsivenessNo issues