MCP server
Connect ChatGPT, Claude or another AI assistant to your CookieBeam account over the Model Context Protocol, by signing in or with an API key, with the tool list, scopes, options and example prompts.
Last updated:
CookieBeam hosts a Model Context Protocol (MCP) server, so an AI assistant that speaks MCP can work with your account directly instead of you copying data into a chat. It can read your banners, scan results and consent analytics, check whether a banner is live, start scans, edit banner drafts and publish them, and create or remove banners. There is nothing to install: the server is hosted. You connect either by signing in from the assistant (ChatGPT, Claude and other clients that support MCP sign-in) or with the same API keys as the rest of the public API.
Endpoint
POST https://cookiebeam.com/api/mcp
The server speaks Streamable HTTP in stateless JSON mode. Every request is self-contained: there are no sessions, so GET (the SSE channel) and DELETE (session teardown) return HTTP 405. Most MCP clients handle this for you; you only need the URL and either a sign-in or a key.
Connect from ChatGPT or Claude
Add CookieBeam as a custom MCP connector in ChatGPT or Claude and point it at https://cookiebeam.com/api/mcp. In Claude Code, run:
claude mcp add --transport http cookiebeam https://cookiebeam.com/api/mcp
The assistant then opens CookieBeam's own sign-in page:
- Sign in as you normally do: email and password, Google, or your company's single sign-on, with two-factor authentication if your account uses it.
- If you belong to more than one team, choose the team to connect. The connection only ever sees that team.
- Choose an access level, check the list of what the assistant will be able to do, and approve.
You return to the assistant, connected. Sign-in works from ChatGPT, Claude and Claude Code, which CookieBeam recognises by their published client documents. Other MCP clients connect with an API key. Sign-in connections work on every plan, Free and Starter included. Plan limits still apply inside the assistant exactly as in the dashboard: scan quotas, the number of banners and plan features. A refusal explains what isn't available.
Access levels
| Access level | What the assistant can do | Scopes |
|---|---|---|
| Read-only | Read banners, install code, installation and compliance checks, scans and the discovery inventory, consent analytics and banner designs | banners:read, banners.design:read, scanner:read, analytics:read |
| Read and change | Everything above, plus start scans, edit banner designs and settings, publish banners, create and delete banners, and publish the cookie policy | the read-only scopes plus banners:write, banners.design:write, banners:admin, scanner:write, banners:publish |
A connection never does more than you can do in the dashboard. It acts as you, and CookieBeam checks your team membership and permissions again on every call: if your role can't publish banners, the connection can't either, and if you lose a permission or leave the team, the next call reflects it. The consent screen shows what you'll actually get before you approve. The server lists only the tools your connection may use. If you approved read-only access and later ask for a change, the tool call is refused with a request to reconnect with read-and-change access.
Consent records and visitor preference data are never shared with an assistant. The consent:* and preferences:* scopes can't be granted through sign-in, and consent analytics come back as totals and rates only, never an individual visitor's data.
Manage and revoke connections
Every connection is listed in the dashboard under Account > Connected apps (/dashboard/settings/connected-apps), with the assistant, the member who approved it, the access level, when it was created and when it was last used. Members see and revoke their own connections. Team owners and admins see and revoke every connection on the team. A revoked connection stops working straight away, and the assistant asks you to sign in again. Resetting or changing your password, or signing out everywhere, also ends all of your connections on every team. Changes made through a connection show in the team's audit log with the member and the connection they came through.
Access tokens are short-lived and the assistant renews them on its own. A connection that goes unused for 30 days needs a fresh sign-in.
Known limits
- Signing up during Connect. If you create a new CookieBeam account with email and password, or verify your email, partway through connecting, you finish on the onboarding screen instead of returning to the assistant. Click Connect in the assistant again once your account is set up. A new account created with Google returns to the consent screen.
- Narrowed banner access. A member whose access is limited to specific banners cannot connect through sign-in: the consent screen has no scopes to offer. A team owner, admin, or a member with full banner access should connect instead.
- No domain changes.
update_banner_settingschanges a banner's name, active state and frameworks. Changing a banner's domain is done in the dashboard. - Production only.
publish_bannerpublishes to production. Publishing to and promoting between other environments is done in the dashboard for now. - Cookie policy only. The assistant can publish the cookie policy. The privacy policy and terms are generated in the dashboard.
Connect with an API key
Point your client at the endpoint and send your API key as a bearer token. In a client that takes JSON configuration, that usually looks like this:
{
"mcpServers": {
"cookiebeam": {
"url": "https://cookiebeam.com/api/mcp",
"headers": {
"Authorization": "Bearer cb_live_your_key_here"
}
}
}
}
Keys are created as described in Authentication, and the same rules apply here: API key access requires a plan that includes the API feature, and the key's scopes decide which tools it can use. Publishable cb_pub_ keys are not accepted. Sign-in connections don't need the API feature.
Test keys work for every read tool and for banner design draft changes, so they are a good way to try the server without touching what visitors see. They cannot delete or duplicate themes, set the default theme, store logo files, start site captures and style matches, start scans, change banner settings, publish, or create and delete banners.
Clients must send Accept: application/json, text/event-stream and Content-Type: application/json on the POST, as the MCP specification requires. A compliant client does this automatically; a hand-rolled request without them receives HTTP 406 or 415.
Account tools
These read your team's data and each requires a scope. They stay listed whatever the scopes: if a key or connection is missing one, the tool returns an MCP tool error naming the scope it needed, rather than failing the whole request, so an assistant can tell you what to fix. A key restricted to specific banners only sees those banners.
| Tool | Title | Scope | Inputs | Returns |
|---|---|---|---|---|
list_banners | List the account banners | banners:read | none | Your banners with id, name, domain, active state and framework flags |
get_banner | Get one banner | banners:read | banner_id | One banner in detail |
get_embed_code | Get the banner embed code | banners:read | banner_id | The install snippet and per-environment script URLs |
list_scans | List recent cookie scans | scanner:read | banner_id (optional), limit (1–50, default 20) | Recent scans, newest first, with status, timing and cookie counts by category |
list_discovery_inventory | List discovered cookies, scripts, and connections | scanner:read | banner_id; optional kind (cookie, script, connection), source (scan, live), category, review_status, limit (1–100), offset (up to 1,000) | Cookies, scripts and connections in one contract, with source, review status, first and last seen, vendor, totals and pagination |
get_scan_results | [Deprecated] Get one scan result summary | scanner:read | scan_id | Deprecated: one scan's legacy summary; migrate to list_discovery_inventory before removal on December 1, 2026. Not listed for sign-in connections |
get_consent_analytics | Get consent analytics for a banner | analytics:read | banner_id, from, to; optional group_by (day, week, month) and includeAutomated (default false) | Total interactions, accept-all / necessary-only / custom rates and per-category opt-in rates for a date range |
Banner tools
These check, scan, change and publish one banner. The server lists only the ones your key's or connection's scopes allow. Every tool except create_banner takes a banner_id, and tools that change or delete something always need one, so an assistant asks which site you mean instead of guessing. Failures come back as an MCP tool error carrying the same { error, code, details, requestId } object as REST. A plan limit is refused with code plan_limit or feature_unavailable and a plain explanation.
| Tool | Title | Scope | Inputs | Returns |
|---|---|---|---|---|
check_banner_installation | Check whether the banner is live | banners:read | banner_id | The domain, publish state (draft, published, pending_changes), active state with the deactivation reason, when the script was last seen on each host, and the install snippet when the banner isn't detected |
get_compliance_setup | Get the banner's compliance setup | banners:read | banner_id | Enabled frameworks (GDPR, CCPA, LGPD), regional rules with their regions and consent modes, the fallback, and the Google Consent Mode and IAB TCF settings |
start_scan | Start a cookie scan | scanner:write | banner_id; optional url (on one of the banner's domains) and idempotency_key | scanId, status: "queued", the expected wait and the team's scan quota |
get_scan_status | Get a scan's status and findings | scanner:read | banner_id, scan_id | Status, start and finish times, counts by category and the number of unreviewed items. Full findings come from list_discovery_inventory |
get_banner_settings | Get the banner settings | banners:read | banner_id | Name, domain, active state, frameworks and an etag |
update_banner_settings | Update the banner settings | banners:write | banner_id, expected_version, body with any of name, isActive, gdprEnabled, ccpaEnabled, lgpdEnabled | The settings and the new etag. The domain can't be changed here |
create_banner | Create a banner for a new site | banners:admin | domain (a public site address, the same rules as creating a banner over REST); optional name and idempotency_key | bannerId, domain, the install snippet and a dashboard link |
delete_banner | Delete a banner | banners:admin | banner_id, confirm_banner_id (must equal banner_id) | { deleted: true, domain } |
preview_publication | Preview publishing the banner | banners:publish | banner_id | Whether the draft differs from the live banner, a summary of the changes, settings the plan leaves out, any compliance mismatch, and the confirmation that publish_banner needs |
publish_banner | Publish the banner to the live site | banners:publish | banner_id, confirmation; optional acknowledge_compliance_mismatch | versionId, publishedAt and roughly how many minutes until visitors see it |
get_policy_status | Get the cookie policy status | banners:read | banner_id | Whether a cookie policy is published, with which options and at which URL, plus the cookie policy and privacy policy links the banner shows visitors |
publish_cookie_policy | Publish the cookie policy | banners:publish | banner_id; body with any of length, jurisdiction, controllerName, privacyEmail. Fields left out keep their published values; controllerName and privacyEmail are required only when no cookie policy is published yet | published: true, the policy URL, the settings now published, and warnings to pass on (for example unreviewed cookies or a missing privacy policy link). The policy is published even when there are warnings |
Publishing design changes to a live banner is two steps: preview_publication shows what will change, and publish_banner only accepts the confirmation from a preview of the current draft, so a stale or repeated publish is refused and nothing goes live twice. create_banner publishes its first version directly, and publish_cookie_policy goes live in one call. delete_banner removes the banner from the site and can't be undone from the assistant, which is why it asks for the banner id twice. start_scan refuses a second scan while one is already running for the banner, and start_scan and create_banner return the first result when retried with the same idempotency_key. create_banner does that for the same site within 24 hours even without a key. It never changes your subscription: a site that would go beyond the domains your account includes is refused with plan_limit and nothing is created, so you add it from the dashboard instead.
Creating and deleting banners, and turning a banner on or off, change what runs in production, so they are refused to a key whose environment allow-list leaves production out. create_banner is also refused to a key restricted to specific banners.
Tool safety labels
Every tool, in full and compact mode, has a human-readable title and explicit readOnlyHint, destructiveHint, idempotentHint and openWorldHint annotations. Assistants use them to decide when to ask you before running a tool. publish_banner, delete_banner, update_banner_settings and publish_cookie_policy are marked destructive because they change or remove what visitors see, start_scan is marked open-world because it visits your site, and publish_banner, publish_cookie_policy, create_banner and delete_banner are marked open-world because they change what anyone on the internet sees.
Classification tools
These four analyse data you supply and touch no account data, so they need a valid key or connection but no particular scope:
| Tool | Title | Inputs | Returns |
|---|---|---|---|
classify_cookie | Classify a cookie | name, optional domain | A cookie's category and vendor from its name |
classify_script | Classify a script | url, optional domain | A script URL's category and vendor |
classify_connection | Classify an outbound connection | destination (domain or URL), optional request_type, site_domain and initiator_url | An outbound connection's category |
get_compliance_status | Assess an observed compliance inventory | scripts, cookies and connections lists, optional site_domain | An assessment of the inventory you pass in |
get_compliance_status judges only the inventory you give it and performs no network requests. A full CookieBeam scan remains the authoritative audit of a site.
Banner design tools
Every banner design operation is also an MCP tool, with the same scopes, checks, rate limits and audit trail as the REST endpoint. The server lists only the tools your key's or connection's scopes allow. Tool names are listed on the banner design page, for example list_themes, get_design_layout, update_design_layout, upload_logo and match_website.
Tool inputs map to the REST request:
| Input | REST equivalent |
|---|---|
banner_id | {bannerId} in the path |
path and query parameters, in snake_case (for example theme_id, proposal_id) | the same parameters |
body | the JSON request body |
expected_version | If-Match. Required on versioned writes: the etag from the last read, or "*" to overwrite |
idempotency_key | Idempotency-Key |
A successful call returns { data, etag, warnings }. A failed call is an MCP tool error whose text is the same { error, code, details, requestId } object REST returns.
Two URL options change which banner design and banner tools are listed:
?areas=designlists only the tools of those areas (comma-separated). An area is the first part of an operation id, such asdesignindesign.layout.get;list_areasin compact mode shows them all.?mode=compactreplaces the per-operation tools with three generic ones:list_areas(the operations your key can call, with their parameters and body schemas),read_areaandwrite_area(run one operation by its id, such asdesign.layout.get). Use it when your client handles long tool lists badly.
{
"mcpServers": {
"cookiebeam": {
"url": "https://cookiebeam.com/api/mcp?mode=compact",
"headers": { "Authorization": "Bearer cb_live_your_key_here" }
}
}
}
Example prompts
- "List my CookieBeam banners and tell me which ones are inactive."
- "For the banner on example.com, show the scripts in the discovery inventory that are still unreviewed."
- "Compare the accept-all rate of my main banner for September and October, grouped by week."
- "What category is the cookie
_hjSessionUser_123?" - "Show the layout of the default theme of my main banner, then change the banner to a bottom bar."
- "Capture example.com, match the banner to the site, and save the proposal you think fits best as a new theme."
- "Is my banner on example.com live?"
- "Which privacy laws is my banner for example.com set up for?"
- "Scan example.com for cookies, then tell me what it found."
- "Make my banner dark, move it to the bottom, and publish it once I've seen the changes."
- "Set up CookieBeam for my new site shop.example.com and give me the install code."
Design changes stay drafts until the banner is published, either in the dashboard or with preview_publication and publish_banner after you confirm.
Limits and errors
API keys are authenticated and rate limited exactly as elsewhere in the public API; see Errors and limits. A missing or invalid key or token returns HTTP 401 before any tool runs, and rate-limit headers are returned on authenticated responses. One HTTP request counts once against the limit.
Every 401 carries a WWW-Authenticate: Bearer challenge whose resource_metadata points to /.well-known/oauth-protected-resource/api/mcp. MCP clients use it to find the sign-in server, and an expired or revoked token gets error="invalid_token" so the assistant can ask you to sign in again. Sign-in connections are rate limited per connection, not per network address, so other people using the same assistant never use up your limit. Their tokens work only on /api/mcp, not on the REST API.
- A request body may be at most 4 MiB (HTTP 413
payload_too_large). - A JSON-RPC batch may hold at most 4 messages (HTTP 413
batch_too_large).
Failures inside a tool (a missing scope, an unknown banner id, a stale expected_version, a plan limit) come back as MCP tool errors rather than HTTP errors, which is what lets an assistant report the problem and carry on rather than dropping the connection.