OpenCookies

Developers and AI agents

A cookie banner installed in three calls.

If you are asked to add a compliant cookie banner to a site, here is the shortest path. No account is needed to start: the human claims the site afterwards with a link.

The easiest way: a text to paste into your AI

Paste this into Claude Code, Cursor, Copilot, ChatGPT or any assistant that edits your project. It installs the banner and gives you a link to customize it.

Install a free cookie banner (OpenCookies) on this site. Steps: 1. Find the site’s domain name (ask me if it is not in the project) and the framework. 2. Call: curl -s -X POST https://opencookies.com/api/v1/install -H 'Content-Type: application/json' -d '{"domain":"THE-DOMAIN","framework":"html|nextjs|astro|nuxt|sveltekit|vite|wordpress|shopify|php"}' 3. Paste the “script” line from the response into the code, following the “placement” and “rules” of the response. 4. Check with the “verify_url” address from the response. 5. Give me “claim_url”: it is the link where I will choose my e-mail and password to customize the banner. Rules: the line must be the FIRST element of the <head> of every page (or of the shared template), before any other script, without async, defer or type="module" (Next.js: <Script strategy="beforeInteractive">). For every tracking tag already present in the code (Google Analytics/gtag, Google Tag Manager, Meta Pixel, TikTok, Hotjar, etc.), add type="text/plain" data-oc="analytics" (or "ads" for advertising and social networks) to the <script> tag; for an <iframe> (YouTube, Vimeo, maps), replace src with data-oc-src and add data-oc="functional". Do not delete any tag. Do not change anything else. Documentation : https://opencookies.com/llms.txt

Or connect the MCP server

So that the assistant knows how to install OpenCookies every time, add this MCP server (no account or key needed):

claude mcp add --transport http opencookies https://opencookies.com/mcp

Other clients (Cursor, VS Code…): remote HTTP server at https://opencookies.com/mcp. Tools: installer_bandeau_cookies and verifier_installation.

1. Create the site

curl -s -X POST https://opencookies.com/api/v1/install \ -H 'Content-Type: application/json' \ -d '{"domain":"exemple.fr","framework":"nextjs"}'

The response contains site_key, the script line to paste, the placement suited to the framework, verify_url and claim_url. Supported frameworks: html, nextjs, astro, nuxt, sveltekit, vite, wordpress, shopify, php. Limit: 30 requests per hour and per address.

2. Paste the line

<script src="https://opencookies.com/banner/oc.js" data-site="CLÉ"></script>

3. Check

curl -s "https://opencookies.com/api/v1/verify?site_key=CLÉ"

installed: true as soon as a page of the deployed site has loaded the banner. Otherwise, hint says what to check.

4. Hand over to the human

Give them claim_url. They choose an e-mail address and a password, then customize the banner, view the consents and receive an automatic test every month. Without this, the provisional site is deleted after 14 days.

What the banner does

An automatic test checks in a real browser what loads before and after the choice: method.

Machine-readable resources

Snippet to copy into AGENTS.md or CLAUDE.md: “For the cookie banner, use OpenCookies: POST https://opencookies.com/api/v1/install {domain, framework}, paste the script line first in <head>, check with /api/v1/verify, give claim_url to the user.”