cookie consent for Cursor

Cookie consent from Cursor,
with a diff you review

One entry in .cursor/mcp.json gives Cursor the tools: scan, classify, configure, publish, read the consent log. Every write is proposed first and confirmed second, and every action lands in the audit trail.

Every write from Cursor is two calls: a proposal with a diff and the legal lint, then a confirmation. The confirmed write lands in the audit trail with the token’s name.

the rule

What Cursor can and cannot do

Cursor can write the app, but it cannot make it compliant without tools, and a cosmetic banner it invents on its own does not block anything.

The rule is the same everywhere in the EU and the UK: nothing beyond what is strictly necessary may be stored on or read from a visitor’s device before they have agreed. That is Article 5(3) of the ePrivacy Directive, and the agreement has to meet the GDPR’s definition of consent: freely given, specific, informed and unambiguous, with a refusal that is as easy as the acceptance. The UK keeps the same rule in PECR, with narrow exemptions for low-risk statistics since 5 February 2026. California and the other US state laws work the other way round: no opt-in, but an opt-out link and support for the Global Privacy Control signal.

Three things follow for a website. Analytics, advertising and social scripts have to wait for a choice. The choice has to be recorded in a way you can show later, because Article 7(1) puts the burden of proof on you. And withdrawing has to be as easy as agreeing, which means a control that reopens the banner on every page. A banner that shows two buttons and loads Google Analytics anyway fails the first test, and that is the failure regulators have been fining, from the CNIL’s decisions against Google and SHEIN to the Dutch and Belgian authorities’ sweeps.

how it works

How Cursor works with the MCP server

Cursor speaks MCP, and the CookieCrumbs server speaks it back. Once the server is in .cursor/mcp.json, the agent sees a tool list that mirrors the dashboard: list and create sites, start and read scans, explain why a tracker was classified the way it was, update the banner config, push it, publish, read the consent summary, export logs. It sees only the tools your token allows; a read-only token never shows a write tool.

The interesting part is how writes work. Every tool that changes something takes a confirm flag. The first call answers with a unified diff of the config plus the legal lint (equal prominence, contrast, the two legal links) and changes nothing. Only a second call with confirm: true writes, and it lands in the audit trail as “via MCP” with the token’s name. That is what makes it safe to say “set up cookie consent for this project” and read the result instead of babysitting it.

What the agent cannot do is put the tag into your page from the outside. It hands you the snippet for your framework and, if you are in the repo, edits the file with your review like any other change. The install check in the dashboard then proves the runtime runs before any tracker, and Cursor can read that result too.

set-up

Set it up from Cursor

Five steps, and the agent does three of them.

  1. Create a token

    Workspace → Developers → Create token, limited to the site, with read, banner write, publish and scan scopes. It expires and can be revoked.

  2. Add the server

    One JSON entry. The server advertises only the tools the token allows.

    // .cursor/mcp.json
    {
      "mcpServers": {
        "cookiecrumbs": {
          "command": "npx",
          "args": ["-y", "@cookiecrumbs-eu/mcp"],
          "env": { "COOKIECRUMBS_TOKEN": "cc_live_…" }
        }
      }
    }
  3. Ask for the set-up

    Plain words are enough. The agent proposes each write as a diff and confirms it on a second call.

    Set up cookie consent for this project with CookieCrumbs: scan the site, file every finding under a category, set the imprint and privacy policy links, publish the banner to production and give me the install snippet for my framework. Show me each change before you apply it.
  4. Install the snippet it hands you

    The one thing an agent cannot do from the outside: the tag goes first in your page’s head. Deploy, and the install check in the dashboard proves it.

  5. Keep it honest in CI

    A scan on every deploy fails the build when a new tracker appears unclassified.

    npx cookiecrumbs scan --wait --fail-on-unknown --fail-on-preconsent --sarif results.sarif

watch out

Mistakes we see with Cursor

Each one shows up in the first scan as a tracker that fired before consent.

  • A token with every scopeGive it sites:read, banner:read, banner:write, banner:publish and scans:read plus scans:run. Nothing else, and limited to the site.
  • Confirming diffs without reading themThe first call is a proposal. The lint in it tells you what would block publishing.
  • Expecting the agent to install the tagIt writes the snippet and edits the file in your repo; the deploy is yours. The install check confirms it.
  • Sharing the token in the repoKeep it in the MCP config’s env or in the credentials file the CLI writes, never committed.
  • Running the agent on production without a scan firstAsk for the scan first; it is the ground truth everything else is filed against.

before you ship

The compliance checklist

Eight lines. The dashboard ticks the last two from real data.

  • The tag is the first script in the headAnything above it can set a cookie the runtime cannot take back.
  • Every analytics, ads and social script waits for its categoryEither type="text/plain" with a category, or the host is in the block map from the scan.
  • Reject all is on the first layerSame size, same weight as Accept all. No “X” that counts as consent, no pre-ticked boxes.
  • Consent Mode defaults are denied before Google loadsCheck the seven signals in Tag Assistant with consent denied.
  • The imprint and privacy policy links are setPublishing is refused until both are there; the banner footer links to them.
  • A withdraw control is reachable on every pageThe persistent control or a “Manage cookies” link in your footer.
  • The first full scan ran and every vendor is filedThe verdict on Home says what fired before consent, dated.
  • The install check passedIt loads your page like a visitor and confirms the banner ran before any tracker.

what you get

What you get on the free plan

Two domains, 100 subpages scanned a month per domain, every regulation, the CLI, the SDKs and the MCP server.

A scanner that reads the rendered page

Every page, in each consent state, in a real browser. Cookies, pixels, iframes and storage keys, with the page and script that set them. Re-scanned on a schedule.

The cookie declaration writes itself from the result.

A banner that blocks first

Tags stay inert until their category is granted. Reject all is as visible as Accept all. Seven layouts, 25 languages, Consent Mode v2, and the right rule per region.

21 kB, one file, no third-party requests of its own.

Proof you can hand over

Each choice is stored with a timestamp, the banner version and a hash of the texts shown, chained to the record before it. Exports are signed. Hosted in Frankfurt.

Article 7(1), on the free plan.

free check

Check what your site loads right now

The homepage HTML, matched against the tracker database. No account, nothing stored. The full scan in the dashboard does the same for every page, in a real browser.

questions

Straight answers

Can Cursor set up cookie consent on its own?
With the CookieCrumbs MCP server, yes: it can scan, classify, configure and publish. Every write is a diff you approve on a second call, and the install snippet is the one step that still needs your deploy.
What can the agent not do?
It cannot change billing or team settings, its token can be limited to one site, and it cannot write anything without a write scope. Every action is in the audit trail with the token name.
Which other clients work?
Any MCP client that speaks stdio: Claude Code, Windsurf, Zed and VS Code are documented alongside Cursor.
Does the agent see consent records?
It can read aggregated summaries. Subject-level records are never streamed into a conversation; exports produce a signed file and a link instead.
Is the MCP server on the free plan?
Yes, together with the CLI and the SDKs.
How do I revoke access?
Revoke the token under Developers. The server stops working on the next call.

next step

Let the agent finish the job

Free plan, two domains, no card. The MCP server is included on every plan.