Volver al blog
Technical

GetCookies MCP: Cookie Consent for AI Assistants

Equipo de GetCookiesDecember 30, 202412 min de lectura
MCPAIClaudeAnthropicAutomation

TLDR: GetCookies MCP server lets AI assistants like Claude manage cookie consent directly. Scan domains, configure widgets, check consent stats, and classify cookies—all through natural language with your AI coding assistant.

Read full summary

A Model Context Protocol (MCP) server that enables AI assistants to interact with GetCookies' consent management platform. AI assistants can list domains, run cookie scans, update widget configurations, retrieve consent analytics, and classify cookies—making privacy compliance part of AI-assisted development workflows.

Summary by Claude AI

"Claude, Scan My Website for Cookies"

Imagine this conversation with your AI coding assistant:

You: "Claude, can you scan my website for cookies and tell me if there are any compliance issues?"

Claude: "I'll scan example.com for you. Starting the scan now..."

[Scan runs]

Claude: "Scan complete. I found 23 cookies on your site. 3 are unclassified—they appear to be from a recent HotJar integration. Would you like me to classify them as analytics cookies and update your consent banner?"

You: "Yes, please."

Claude: "Done. I've classified the HotJar cookies as analytics and they're now included in your consent categories. Your banner will prompt users for analytics consent before these cookies load."

This isn't a future vision. It's what GetCookies MCP enables today.

What is MCP?

Model Context Protocol (MCP) is Anthropic's standard for connecting AI assistants to external tools and services. Instead of just answering questions, AI assistants can take actions—reading files, executing code, and now, managing cookie consent.

GetCookies MCP is a server that implements this protocol, giving AI assistants direct access to consent management capabilities.

Why MCP for Cookie Consent?

Natural Language Operations

Instead of learning CLI commands or API endpoints:

  • "List my domains"
  • "Start a scan on the marketing site"
  • "What's my consent rate this week?"
  • "Update the banner to use dark mode"

Context-Aware Assistance

AI assistants understand your codebase. When you add a new tracking script, the assistant can:

  1. Notice the new integration
  2. Suggest scanning for new cookies
  3. Classify any discoveries
  4. Update the consent configuration

Integrated Workflows

Cookie consent becomes part of your AI-assisted development:

  • Code review includes consent implications
  • Deployment suggestions include compliance checks
  • Debugging considers privacy requirements

Installation

Prerequisites

  • Node.js 18+
  • GetCookies API key or access token
  • Claude Desktop or another MCP-compatible client

Install the Package

npm install -g getcookie-mcp

Configure Claude Desktop

Add to your Claude Desktop configuration (claude_desktop_config.json):

{
  "mcpServers": {
    "getcookie": {
      "command": "getcookie-mcp",
      "env": {
        "GETCOOKIE_API_KEY": "your-api-key-here"
      }
    }
  }
}

Restart Claude Desktop

The GetCookies tools will now be available in Claude.

Available Tools

Domain Management

Tool Description
list_domains List all configured domains
create_domain Add a new domain

Cookie Scanning

Tool Description
initiate_scan Start a cookie scan
get_scan_status Check scan progress
get_scan_cookies Get detected cookies
classify_cookie Update cookie category

Widget Configuration

Tool Description
get_widget_config Get current configuration
update_widget_config Change widget settings
get_widget_snippet Get embed code

Consent Analytics

Tool Description
get_consent_stats Get acceptance rates
get_consent_logs View consent audit trail
get_domain_analytics Get detailed metrics

Example Conversations

Checking Compliance Status

You: "What's the cookie situation on my main website?"

Claude: Let me check your domains and recent scan results.

[Uses list_domains, get_scan_cookies]

Your main domain (example.com) was last scanned 3 days ago. Here's the breakdown:

  • Essential: 4 cookies
  • Analytics: 8 cookies (Google Analytics, Mixpanel)
  • Marketing: 6 cookies (Meta Pixel, Google Ads)
  • Unclassified: 2 cookies

The 2 unclassified cookies are _clarity and _clck from Microsoft Clarity. Would you like me to classify them?

Configuring the Widget

You: "Make the consent banner match our dark theme"

Claude: I'll update your widget configuration to use dark mode.

[Uses update_widget_config]

Done! I've updated your consent banner to:

  • Theme: dark
  • Background: #1a1a1a
  • Text: #ffffff
  • Buttons: Your primary color (#0066cc)

The changes are live. Would you like me to show you the embed snippet to verify it's installed correctly?

Running a Compliance Scan

You: "We just deployed a new marketing page with some third-party widgets. Can you check if there are any new cookies?"

Claude: I'll run a fresh scan on your domain.

[Uses initiate_scan, waits, uses get_scan_cookies]

Scan complete! I found 4 new cookies compared to your last scan:

Cookie Source Category
_tt_enable_cookie TikTok Unclassified
_ttp TikTok Unclassified
hubspotutk HubSpot Unclassified
__hssc HubSpot Unclassified

Looks like TikTok Pixel and HubSpot tracking were added. Should I classify these as marketing cookies?

Debugging Consent Issues

You: "Users are complaining the cookie banner keeps reappearing. What's wrong?"

Claude: Let me check your widget configuration and consent logs.

[Uses get_widget_config, get_consent_logs]

I found the issue. Your widget is configured with consent_duration: 0, which means consent expires immediately. Recent logs show the same users consenting multiple times.

Should I update this to the standard 365-day retention?

Development Workflow Integration

With Cursor/Claude Code

When reviewing code that adds tracking:

Claude: I notice you're adding Segment analytics. After deployment, I can scan for new cookies and ensure they're properly classified in your consent banner. Would you like me to do that automatically after this PR merges?

During Code Review

Claude: This PR adds a Facebook Pixel. Current consent banner has 6 marketing cookies. I recommend:

  1. Running a post-deploy scan
  2. Verifying the pixel is blocked before consent
  3. Checking Consent Mode signals are sent

Want me to create a task to verify these after deployment?

Deployment Verification

You: "Just deployed v2.3. Run a compliance check."

Claude: Running compliance scan...

[Uses initiate_scan, get_scan_cookies, get_consent_stats]

Deployment verified:

  • Cookie count: 24 (unchanged from pre-deploy)
  • No new unclassified cookies
  • Consent rate: 72.4% (consistent with last week)
  • Google Consent Mode: ✓ Active

All clear! No compliance issues detected.

Environment Variables

Variable Description
GETCOOKIE_API_KEY API key for authentication
GETCOOKIE_ACCESS_TOKEN Alternative: access token
GETCOOKIE_API_URL API URL (default: production)

Security Considerations

API Key Management

  • Store API keys in secure environment variables
  • Use scoped API keys with minimal required permissions
  • Rotate keys periodically

Tool Permissions

The MCP server only performs actions you explicitly request. Claude will:

  • Ask before making changes
  • Confirm destructive operations
  • Report all actions taken

Audit Trail

All operations are logged in GetCookie's audit trail, showing:

  • What action was taken
  • When it occurred
  • The authentication used

Troubleshooting

"MCP server not found"

  1. Verify getcookie-mcp is installed globally
  2. Check the path in Claude Desktop config
  3. Restart Claude Desktop

"Authentication failed"

  1. Verify API key is correct
  2. Check key hasn't expired
  3. Ensure key has required scopes

"Tool not available"

  1. Verify MCP server is running
  2. Check Claude Desktop logs
  3. Restart the MCP server

Getting Started

  1. Install: npm install -g getcookie-mcp
  2. Get API key from GetCookies dashboard
  3. Configure Claude Desktop
  4. Restart Claude Desktop
  5. Ask Claude to list your domains

Cookie consent management through conversation. Welcome to the future of compliance.

Preguntas frecuentes

What is MCP?
Model Context Protocol (MCP) is Anthropic's standard for connecting AI assistants to external tools. GetCookies MCP lets AI assistants manage consent directly.
What can AI assistants do with GetCookies MCP?
AI assistants can list domains, run cookie scans, update widget configuration, retrieve consent analytics, and classify cookies—all through natural language commands.
How do I install GetCookies MCP?
Install via npm (npm install -g getcookie-mcp), configure your Claude Desktop with your API key, and restart. GetCookies tools are then available in Claude conversations.
G

Equipo de GetCookies

Escrito y mantenido por el equipo de GetCookies en Getia AS, en Oslo (Noruega). Este artículo es información general sobre el consentimiento de cookies, no asesoramiento jurídico.

Escanea tu propio sitio gratis

El plan gratuito muestra el banner en un sitio con tres escaneos de cookies al mes. Sin tarjeta, sin llamadas comerciales.