mcp-server

v1.4.1
io.consentease/mcp-server Checked 3 days ago Published 1 month ago

Manage ConsentEase consent banners and cookie inventories from your coding agent.

An MCP server that lets coding agents (Cursor, Claude, Windsurf, VS Code, and others) inspect ConsentEase websites and consent statistics, and perform scoped website/cookie operations. It is a thin client over the ConsentEase Connect REST API (/api/v1) — it holds your API key and inherits exactly that key's access and scopes, nothing more. The server is published on npm as @consentease/mcp-server and listed in the official MCP Registry as io.consentease/mcp-server. Run it locally over stdio, with your API key in CONSENTEASE_API_KEY:

Summary extracted from the README.

ConsentEase MCP Server

An MCP server that lets coding agents (Cursor, Claude, Windsurf, VS Code, and others) inspect ConsentEase websites and consent statistics, and perform scoped website/cookie operations. It is a thin client over the ConsentEase Connect REST API (/api/v1) — it holds your API key and inherits exactly that key's access and scopes, nothing more.

Consent data and scan status support review; they do not certify legal compliance. MCP cannot record visitor consent or change banner design/publication. The public MCP guide and REST reference explain the supported contracts.

Installation

The server is published on npm as @consentease/mcp-server and listed in the official MCP Registry as io.consentease/mcp-server.

Run it locally over stdio, with your API key in CONSENTEASE_API_KEY:

npx -y @consentease/mcp-server

Create a key in your dashboard under Settings → API Keys (the full ce_live_… key is shown once — store it safely), then add the server to your agent using one of the copy-paste blocks below. Prefer no local install? Use the remote HTTP endpoint instead.

Requirements

  • Node.js >= 18
  • A ConsentEase API key (ce_live_…)

Remote (HTTP)

The host application now includes a stateless Streamable HTTP endpoint:

https://consentease.io/mcp

Remote clients need no local Node.js installation.

Authenticate every POST, including initialization and discovery, using either:

Authorization: Bearer ce_live_YOUR_KEY

or:

X-API-Key: ce_live_YOUR_KEY

Do not put keys in URLs, query strings, prompts, or committed configuration files. Dashboard/Clerk cookies are not accepted as MCP authentication. Invalid, missing, expired or revoked keys return 401 with a WWW-Authenticate: Bearer challenge; they cannot obtain a tool list. There is no OAuth flow or anonymous discovery. GET, HEAD, DELETE, OPTIONS, PUT and PATCH return 405 (Allow: POST); there are no persistent MCP sessions or GET event streams. POST bodies are limited to 1 MB. No wildcard CORS or credentialed browser CORS is enabled.

For POST only, Accept: application/json, */*, or a missing Accept header is accepted and normalized for the SDK; responses stay JSON. A genuinely incompatible Accept (such as only text/html, or an explicit refusal of JSON) returns 406. ClickUp does not need legacy SSE: GET still returns 405.

JSON-RPC array batches are processed element by element through the same tool registration and v1 authorization. Tool calls retain one non-billable attempt audit row each, with the existing null idempotency key; RPC IDs are not dedupe keys. Notifications have no response entry; a notifications-only batch returns 202. The maximum batch size is 20 elements. Larger batches return HTTP 400 with JSON-RPC -32600, Invalid Request: batch too large (max 20), before any audit insert or SDK server creation. Nested arrays and primitive elements are rejected individually with id null, -32600, Invalid Request; they are never dispatched or audited. A null element retains the SDK's existing -32700 response.

Each HTTP request emits one structured mcp.request log containing its method, known RPC/tool labels, status, duration, original Accept/Content-Type/protocol-version/ User-Agent headers, authentication outcome and numeric toolErrors (the count of tools/call results with isError: true, including HTTP-200 scope denials). It never logs auth/cookie headers, tool arguments or response bodies. Credentials copied into allowed headers are redacted; unknown caller-provided method/tool strings are logged as unknown. If authentication rejects a request before parsing, RPC/tool labels are empty. Existing raw-exception diagnostics are suppressed for MCP only, including failed asynchronous key-touch updates: SQL bind values can contain key parts or arguments. Unexpected MCP-context errors instead emit one safe mcp.error record per error: only an allowlisted error name and, when available, PostgreSQL SQLSTATE and safe constraint/table identifiers. Wrapped PostgreSQL causes are inspected only for these fields. No error message, stack, SQL, bind values, arguments or credentials are logged. Short secrets (under eight characters) are not used for substring redaction; ce_live_ and Bearer regex redaction remains active.

Least privilege and tool discovery

Start with a key containing only sites:read for reporting and inspection. Remote tools/list then exposes eight read tools, including categories, consent statistics and the installation check, and hides setup, creation, cookie writes and scanning. Add sites:write only when you need to set up or create sites or add cookies; add sites:scan only for rescans. A wildcard key exposes all twelve tools; a key with no matching scopes exposes none.

A manually supplied disallowed tool name still reaches REST authorization: the tool result has isError: true and the existing forbidden, HTTP 403 message, not a protocol-level "unknown tool" error. Local stdio advertises the complete catalog, with the same REST authorization on every call.

Scope MCP tools
sites:read 8 read tools (including the installation check)
sites:scan +1 rescan tool (9 with sites:read)
sites:write +3 tools: set up site, create site and add cookie (12 with read + scan)
consent:write REST-only, metered consent recording; 0 MCP tools

New dashboard keys default to sites:read only. Scan, write and REST-consent access are opt-in. Write access can create sites (billed per site) and add cookies to live banners. Existing keys and their scopes are not changed.

Never through MCP, regardless of scope: record visitors' consent (REST-only with consent:write), delete sites or cookies, change billing/plans/ subscriptions, manage API keys, or change banner design/publication. Even * does not add these tools. A key containing only consent:write sees no remote MCP tools.

REST keeps its current surface: no REST endpoints are added or removed in v1.2 (the setup and installation-check endpoints below were added later, without changing existing endpoints). Existing POST /api/v1/consent remains metered and requires consent:write. The operational report uses the existing GET /api/v1/sites/:id/compliance route (not /compliance-report).

Set up a site and check the installation

Two workflow tools let an agent install ConsentEase without reading docs: consentease_setup_site → place the returned snippet → consentease_check_installation.

  • consentease_setup_site (POST /api/v1/sites/setup, scope sites:write) takes only domain. It creates the site (banner configuration, default categories, first scan; 201) or returns your existing site for the same normalized domain (200, nothing created, no billing sync), so repeating the call is safe. It returns siteId, publicId, scriptUrl, the exact snippet, scanStatus (scanning, complete, needs_attention or not_started) and plain-language nextSteps. It does not wait for the scan: poll consentease_get_site. An existing, never-scanned site gets one first scan within the 20 scans/day limit. POST /api/v1/sites is unchanged and still returns 409 for a duplicate domain.
  • consentease_check_installation (GET or POST /api/v1/sites/:id/installation-check, scope sites:read) opens the live homepage once in the existing bounded scanner browser (same address validation as scans; private and internal addresses are refused) and returns status (complete, partial when the page loaded but its HTML could not be read, or unreachable with a reason), setupScore (0–100), checks[] (id, passed, detail), openItems[], checkedAt and note. The five checks, 20 points each: snippet in the <head>, snippet above Google Tag Manager / gtag, all seven Consent Mode v2 defaults as the banner sets them, banner script loads (HTTP 200), and no known trackers or cookies before consent. A check that could not be measured is reported as passed: false with a "Not measured" detail, never as passed. The Setup score is a technical check of one first visit, not a legal assessment. Limits: one running check per account, three server-wide, 30 per account per day (UTC; 429 with a hint when exceeded). A check takes about 10–25 seconds.

Neither call is billed (billableUnits stays 0); both are recorded in the non-billable usage audit and in the internal compute-cost measurement.

Copy-paste prompt: Replit, Claude Code and Cursor

Connect the remote server first, with a key that has sites:read and sites:write:

  • Replit Agent: in your workspace's Integrations settings (replit.com/integrations), open the MCP Servers pane and click + Add MCP server. Enter a display name and https://consentease.io/mcp; under Advanced settings, add the custom header X-API-Key with your full key, then click Test & save.
  • Claude Code: use the claude mcp add --transport http … command under Claude.
  • Cursor: use the remote ~/.cursor/mcp.json entry under Cursor.

Then paste this prompt into the agent that works on your website. It contains no site key on purpose: the agent takes the real snippet, with your site's real script key, from the consentease_setup_site response.

Install ConsentEase cookie consent on this website with the ConsentEase MCP tools.

1. Find the public production domain of this website (deployment settings, custom
   domain or configuration). If you are not sure, ask me. Do not guess.
2. Call consentease_setup_site with that domain. Repeating the call is safe: it
   returns the existing site instead of creating a duplicate.
3. Take the "snippet" field from that response and insert it exactly as returned,
   character for character, as the first element inside <head> on every page (the
   root HTML template or layout), above any Google Tag Manager or gtag code. Never
   retype it, shorten it, change its script URL or make up a site key.
4. Remove any older ConsentEase snippet with a different script URL. Do not add
   another cookie banner or another gtag('consent', 'default', ...) call.
5. Tell me when the change is ready to publish. After the site is live, call
   consentease_check_installation with the siteId from step 2, fix every item in
   openItems, and run the check again.
6. Report the Setup score and any remaining open items. Say that this is a
   technical setup check, not a legal assessment.

consentease_get_consent_stats is a read-only wrapper on GET /api/v1/sites/:id/consent-stats?from=2026-09-01&to=2026-09-30&tz=Europe%2FBrussels. It requires sites:read; key scopes and read-only defaults are unchanged. The previous nine tools, dashboard analytics and consent-performance PDF are unchanged. REST consent recording stays REST-only.

  • from and to are required real YYYY-MM-DD dates. Both are inclusive; the range may contain at most 366 calendar days.
  • tz is optional, defaults to Europe/Brussels, and must be a valid IANA zone (numeric offsets are not accepted). Validation errors return 400; no read scope returns 403; missing/foreign sites return the same hidden 404.
  • Counts are drawn from existing recorded analytics events using local midnights and local-day grouping, not from the dashboard's UTC-day rollups. DST days may last 23 or 25 hours. The indexed UTC timestamp is range-filtered with padded bounds and exact local-date membership in one read-only SQL snapshot, also covering zones whose midnight repeats. No raw events or visitor identifiers are fetched.
  • Every successful REST dispatch writes one non-billable site.consent_stats audit with the existing v1 authentication, ownership and rate limits. Remote calls also retain their ordinary MCP attempt audit. Retries do not dedupe reads.

Definitions: impressions = banner_shown, accepts = accept, rejects = reject, customs = preferences_saved, dismissals = banner_dismissed. These four outcome event types are exclusive; closing a banner is a dismissal, not no interaction. noInteraction = max(0, impressions - accepts - rejects - customs - dismissals): a banner impression without one of those outcomes. These are recorded-event counts, not unique people or sessions. Existing missing or duplicate instrumentation is not repaired or deduplicated; outcome rates can therefore exceed 100%, while the residual is clamped at zero.

The response contains:

  • site: {id, domain}, period: {from, to, tz}, generatedAt (UTC).
  • totals: {impressions, accepts, rejects, customs, dismissals, noInteraction}.
  • rates: {acceptRate, rejectRate, customRate, dismissalRate, noInteractionRate}: percentages of impressions, numerically rounded to one decimal; null when impressions are zero. A measured 0% stays numeric zero, not null.
  • daily: only local dates with recorded analytics events, with those same counts/rates. Missing dates are not manufactured as zero days.
  • weekly: ISO week-year (2026-W40), full Monday–Sunday from/to labels and those same counts/rates. Partial weeks include only events inside the requested period; labels do not widen the query.
  • devices and countries: at most 10 groups ordered by impressions descending and label for ties, with impressions and acceptRate. Country labels are upper-case two-letter codes; other/null values become unknown. Devices are desktop/mobile/tablet or unknown; arbitrary stored strings are not echoed.
  • dataCompleteness: {firstEventAt, lastEventAt, daysWithData, daysInPeriod}. First/last are UTC timestamps within the selected range, or null. A day with any analytics event counts as having data, even a non-outcome event like settings click. This is not proof of continuous instrumentation coverage.

An empty period returns zero totals, null rates, empty daily/weekly/breakdown arrays, null first/last dates and daysWithData: 0. Daily/weekly residuals are computed within their own buckets, not summed from previously clamped values. No visitor data, IPs, consent ids, raw events, benchmarks, recommendations, revenue or conversion estimates are included.

Operational status and scan warnings (v1.2)

Site states are stored operational labels: pending = awaiting a completed scan, scanning = scan in progress, compliant = scan completed successfully, attention = scan failed or needs review. Historical rows may have misleading labels; always interpret them with lastScan and the report's warnings. Neither compliant nor an empty warnings array proves GDPR/CCPA/legal compliance.

The compliance report adds warnings: string[], derived only from existing data:

Code Meaning / action
scan_zero_with_inventory A last scan exists and found zero cookies, but auto-detected inventory remains. Possible failed scan; rescan recommended, not a proven failure.
scan_stale lastScan is older than 30 days; rescan recommended.
never_scanned lastScan is null.
banner_not_configured No banner configuration exists; this does not establish whether a banner is installed or published.

scriptsFound remains present but is null (not measured in the stored website snapshot) in all v1/MCP site outputs and the compliance report. The scanner's per-page script counts are not persisted to the website field; its default 0 is not evidence of no scripts.

list_sites accepts optional domain and status filters. Domain uses the exact create-site validator/normalizer (trim, lowercase, remove protocol/www/path). Status must be pending, scanning, compliant or attention; invalid REST filters return 400. Filtering precedes cursor pagination; retain the same filters when supplying nextCursor.

add_cookie is retry-safe within v1: a duplicate trimmed, case-sensitive cookie name on the same site returns 409 conflict, with the existing cookie id in hint, without another row. Concurrent v1 requests are serialized per site. Different names/case or a different site are different cookies. This does not change the dashboard cookie endpoint or scanner inventory behavior.

ClickUp

In the ClickUp browser app:

  1. Open App Center → Custom MCP → Add New.

  2. Choose Just for me / Personal (least privilege), or For all members / Workspace only if everyone should be allowed to use this key's access. Workspace connections require an owner/admin.

  3. Enter these fields:

    Field Value
    Name ConsentEase
    Server URL https://consentease.io/mcp
    Authentication API key
    API key Your full ce_live_… key
    Custom header name X-API-Key
    Custom header value The same full key, without Bearer

    Alternatively, use the custom header Authorization with the complete value Bearer ce_live_…. Do not select OAuth or leave authentication unset.

  4. Connect, inspect AI Tools, and select the tools to add to Brain or a Super Agent. Update the agent's instructions, for example: “Use ConsentEase to list sites and inspect their cookie inventory; do not create or scan sites.”

The configured key, not ClickUp membership, determines ConsentEase account, site ownership and scopes. Start with sites:read. See ClickUp's connection instructions.

Claude

Claude Code supports remote HTTP with explicit headers:

claude mcp add --transport http consentease https://consentease.io/mcp \
  --header "X-API-Key: ${CONSENTEASE_API_KEY}"

For Claude.ai, go to Customize → Connectors → Add custom connector, enter the endpoint, choose No sign-in, and add a required request header: X-API-Key = your complete key, or Authorization = Bearer plus your key. Despite the UI's “No sign-in” label, the server still requires the API key. Request-header authentication is a limited beta: if that section is absent, your organization cannot use this API-key-only remote connector through that UI. Use Claude Code or the existing Claude Desktop stdio configuration instead. See Claude's current request-header documentation.

Cursor

Add a remote entry to your global ~/.cursor/mcp.json, replacing the placeholder privately (do not commit the key):

{
  "mcpServers": {
    "consentease": {
      "url": "https://consentease.io/mcp",
      "headers": {
        "X-API-Key": "ce_live_YOUR_KEY"
      }
    }
  }
}

Enable the server in Cursor's MCP settings and verify that the discovered tools match the key's scopes. The stdio configuration below remains supported.

ChatGPT limitation

ChatGPT's native custom MCP connectors currently offer OAuth, No Authentication and Mixed Authentication, not an API-key/header option. This implementation is deliberately API-key-only: do not select No Authentication and expect it to work, or claim it supplies a direct ChatGPT connector. Supporting that UI requires a separately approved OAuth implementation. See OpenAI's supported authentication modes.

curl and MCP Inspector

Load your key privately into CONSENTEASE_API_KEY on your client machine. After the host release, list the tools:

MCP_URL=https://consentease.io/mcp
curl -i -X POST "$MCP_URL" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json' \
  -H "Authorization: Bearer ${CONSENTEASE_API_KEY}" \
  --data '{"jsonrpc":"2.0","id":1,"method":"tools/list"}'

To inspect the initialization handshake as well:

curl -i -X POST "$MCP_URL" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H "Authorization: Bearer ${CONSENTEASE_API_KEY}" \
  --data '{"jsonrpc":"2.0","id":4,"method":"initialize","params":{"protocolVersion":"2025-03-26","capabilities":{},"clientInfo":{"name":"curl","version":"1"}}}'

Expected: version 1.4.1, without an Mcp-Session-Id.

Equivalent X-API-Key request:

curl -i -X POST "$MCP_URL" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  -H "X-API-Key: ${CONSENTEASE_API_KEY}" \
  --data '{"jsonrpc":"2.0","id":2,"method":"tools/call","params":{"name":"consentease_list_sites","arguments":{}}}'

Check the unauthenticated challenge without sending a key:

curl -i -X POST "$MCP_URL" \
  -H 'Content-Type: application/json' \
  -H 'Accept: application/json, text/event-stream' \
  --data '{"jsonrpc":"2.0","id":3,"method":"tools/list"}'

Expected: HTTP 401, WWW-Authenticate: Bearer …, and no tools. For a development check, set MCP_URL to your preview origin plus /mcp.

Launch Inspector:

npx @modelcontextprotocol/inspector

In its web UI, select Streamable HTTP, enter the endpoint and add the X-API-Key authentication header with your full key. Connect, initialize, then run List Tools and consentease_list_sites. Follow Inspector's secret-storage guidance; never paste a key into a tool argument.

Execution, rate limits and audit

Remote calls run the shared thin client through an in-process Express adapter and the existing /api/v1 router: the same API-key verification, scope checks, ownership-hidden 404, per-key tier limits and REST metering apply. No API key is self-fetched through a public URL, and no caller-supplied Host selects a destination. The pre-auth IP guard is charged once per HTTP request, not again for its internal dispatch.

Each authenticated tools/call attempt also writes a non-billable row to the existing api_usage_events table: action = mcp.remote.<known-tool-name> (or mcp.remote.unknown), status = attempted, its API-key/user IDs, zero billable units, and null website/idempotency fields. This is an attempt audit, not proof of success. It includes scope, ownership, validation and rate-limit failures. It stores no arguments or credentials. REST writes retain their ordinary audit rows too; neither creates visitor-consent billing.

Local stdio configuration

The server is configured entirely through environment variables:

Variable Required Default Description
CONSENTEASE_API_KEY yes — Your ce_live_… API key.
CONSENTEASE_API_URL no https://consentease.io The ConsentEase origin (no /api/v1 suffix). Only set this to target a local/dev server.

By default the server talks to the live ConsentEase production API, so you do not need to set CONSENTEASE_API_URL at all.

Add it to your agent

Replace ce_live_… with your real key in each example.

Cursor

Add to ~/.cursor/mcp.json (global) or .cursor/mcp.json (per-project):

{
  "mcpServers": {
    "consentease": {
      "command": "npx",
      "args": ["-y", "@consentease/mcp-server"],
      "env": {
        "CONSENTEASE_API_KEY": "ce_live_…"
      }
    }
  }
}

Claude Desktop

Add to claude_desktop_config.json (macOS: ~/Library/Application Support/Claude/claude_desktop_config.json, Windows: %APPDATA%\Claude\claude_desktop_config.json):

{
  "mcpServers": {
    "consentease": {
      "command": "npx",
      "args": ["-y", "@consentease/mcp-server"],
      "env": {
        "CONSENTEASE_API_KEY": "ce_live_…"
      }
    }
  }
}

Windsurf

Add to ~/.codeium/windsurf/mcp_config.json:

{
  "mcpServers": {
    "consentease": {
      "command": "npx",
      "args": ["-y", "@consentease/mcp-server"],
      "env": {
        "CONSENTEASE_API_KEY": "ce_live_…"
      }
    }
  }
}

VS Code

Add to .vscode/mcp.json (per-project). VS Code prompts for the key on first run instead of storing it in the file:

{
  "inputs": [
    {
      "type": "promptString",
      "id": "consentease-api-key",
      "description": "ConsentEase API key (ce_live_…)",
      "password": true
    }
  ],
  "servers": {
    "consentease": {
      "command": "npx",
      "args": ["-y", "@consentease/mcp-server"],
      "env": {
        "CONSENTEASE_API_KEY": "${input:consentease-api-key}"
      }
    }
  }
}

Tools

Twelve tools are available. Agents cannot record visitor consent: the REST POST /api/v1/consent endpoint remains available for trusted server-side integrations that record decisions actually given by visitors.

Tool Scope Read-only Notes
consentease_list_sites sites:read ✅ Cursor-paginated.
consentease_get_site sites:read ✅
consentease_setup_site sites:write ❌ Idempotent setup: snippet + next steps.
consentease_create_site sites:write ❌ Provisions banner + categories + scan.
consentease_scan_site sites:scan ❌ 20 scans/day/user, independent of plan.
consentease_get_embed_snippet sites:read ✅ Install snippet for the <head>.
consentease_get_compliance_report sites:read ✅ Operational status — not legal advice.
consentease_get_consent_stats sites:read ✅ Explicit local-calendar range, aggregates only.
consentease_list_cookies sites:read ✅ Cursor-paginated.
consentease_list_categories sites:read ✅ Real IDs and category flags for a site.
consentease_add_cookie sites:write ❌ Call list_categories first.
consentease_check_installation sites:read ✅ Live Setup score (0–100) + open items.

Local development

npm test checks the API client's deadlines, headers and error contract. From the repository root, node --import tsx --test server/api/v1/router.integration.test.ts runs the real v1 API against disposable PostgreSQL, including concurrent consent replays and the MCP stdio smoke test. Build this package first. The test substitutes the scanner and Stripe only; it does not use production credentials or data.

To run against a local ConsentEase dev server instead of production:

From the mcp-server folder of the ConsentEase source:

cd mcp-server
npm install
npm run build
CONSENTEASE_API_KEY=ce_live_… CONSENTEASE_API_URL=http://localhost:5000 npm start

Or with live reload:

CONSENTEASE_API_KEY=ce_live_… CONSENTEASE_API_URL=http://localhost:5000 npm run dev

Notes

  • Billing is per website, with no per-plan website limit. Creating an existing normalized domain for the same owner returns 409 and the existing site id.

  • REST consent responses keep limited: false for compatibility; it is not an upgrade signal.

  • Each API call times out after 30 seconds and sends User-Agent: consentease-mcp-server/1.4.1.

  • All errors follow the API's { error, code, hint } contract and are surfaced as actionable tool errors.

  • Compliance output reflects operational configuration only; it is not legal advice and not a determination of GDPR/CCPA compliance.