Docs

Setup

AdminUpdated Sep 15, 2026

Setup

@cookiemunch/mcp is a Model Context Protocol server that exposes the Cookie Munch Developer API as tools an AI agent (Claude Desktop, Claude Code, or any other MCP client) can call directly — list sites, read consent stats, edit a banner flow, open a DSAR, and more, all from a chat session. It's built on @cookiemunch/sdk, so every tool maps to a documented /v1 route.

It talks stdio (the transport MCP clients use to spawn local servers), not HTTP — the client process launches it as a child process and speaks MCP over its stdin/stdout.

Get an API key

You need an API key first — see authentication for how to issue one, or call POST /v1/keys / client.keys.issue().

Run it

npx -y @cookiemunch/mcp

npx resolves the package's single published binary (cookiemunch-mcp, at packages/mcp/src/bin.ts) automatically. Two environment variables control it:

Variable

Required

Default

Description

COOKIEMUNCH_API_KEY

yes

Your fck_… API key. The process exits immediately with an error if unset.

COOKIEMUNCH_BASE_URL

no

http://localhost:8787

Your Cookie Munch server origin (the /v1 prefix is appended automatically, same as the SDK). Set this to your real API origin, e.g. https://api.cookiemunch.net.

COOKIEMUNCH_API_KEY=fck_9e8d7c6b5a4f3e2d1c0b \
COOKIEMUNCH_BASE_URL=https://api.cookiemunch.net \
npx -y @cookiemunch/mcp

Configure an MCP client

Claude Desktop / Claude Code

Add an entry to your MCP client's config (claude_desktop_config.json, or .mcp.json for Claude Code):

{
  "mcpServers": {
    "cookiemunch": {
      "command": "npx",
      "args": ["-y", "@cookiemunch/mcp"],
      "env": {
        "COOKIEMUNCH_API_KEY": "fck_9e8d7c6b5a4f3e2d1c0b",
        "COOKIEMUNCH_BASE_URL": "https://api.cookiemunch.net"
      }
    }
  }
}

Restart the client, then ask it something like "list my Cookie Munch sites" or "open a GDPR access DSAR for jane@example.com" — it will call the matching tool automatically.

Any other MCP client

Any client that supports stdio MCP servers works the same way: point it at npx -y @cookiemunch/mcp (or a local cookiemunch-mcp binary if you installed the package globally/locally) with the two environment variables set.

npm install -g @cookiemunch/mcp
cookiemunch-mcp

Programmatic use

You can also build and connect the server yourself — for example to inject a pre-built SDK client (tests, custom auth) instead of API-key/base-URL:

import { createCookieMunchMcp } from '@cookiemunch/mcp';
import { StdioServerTransport } from '@modelcontextprotocol/sdk/server/stdio.js';

const server = createCookieMunchMcp({ apiKey: process.env.COOKIEMUNCH_API_KEY!, baseUrl: 'https://api.cookiemunch.net' });
await server.connect(new StdioServerTransport());

Note: the MCP server has exactly the same authority as the API key you give it — every write it can perform (editing a site's config, inviting a member, issuing a new key) is scoped by that key's org and, if the key is scoped, by its scope list. Give an agent a scoped key limited to what it actually needs to do, not an unscoped admin key, especially in an autonomous workflow.

Next steps

Was this page helpful?
Setup