@cookiemunch/mcp

中文文档
0.18.0发布于 2026/11/05MITTypeScriptESM + CJS构建来源已验证近 30 天下载 3345

Model Context Protocol server for the Cookie Munch Developer API

原始使用文档
文档目录5 节
  1. How it authenticates
  2. Tools
  3. Client configuration
  4. Claude Desktop / Claude Code
  5. Programmatic use

@cookiemunch/mcp

A Model Context Protocol server that exposes the Cookie Munch Developer API (the /v1 surface) as MCP tools, built on top of @cookiemunch/sdk. Point an MCP client (Claude Desktop, Claude Code, …) at it and an assistant can manage sites, read consent analytics, and drive privacy operations on your behalf.

How it authenticates

The server reads an API key from the environment and derives your organization from it server-side — you never pass an orgId.

Env varRequiredDefault
COOKIEMUNCH_API_KEYyes—
COOKIEMUNCH_BASE_URLnohttps://api.cookiemunch.net

Generate a key from the dashboard (it looks like fck_…).

Tools

ToolDescription
whoamiIdentity tied to the API key (orgId, plan, key prefix).
list_sitesList all sites (cbids) in your org.
create_siteCreate a site (cbid auto-generated if omitted).
get_site_configGet a site's banner/consent config.
update_site_configUpsert (merge) a site's config.
get_consent_statsAggregated per-day consent statistics.
get_consent_logRecent anonymised consent records.
list_dsarList Data Subject Access Requests.
create_dsarOpen a new DSAR.
advance_dsarMove a DSAR to a new status.
list_vendorsVendors with computed risk scores.
list_ropaRecords of Processing Activities.
get_rights_page, update_rights_page, patch_rights_page, preview_rights_pageRead, replace, change or dry-run the hosted rights page draft. Pass baseUpdatedAt so a newer save is a conflict, not overwritten.
publish_rights_page, get_published_rights_page, list_rights_page_versions, rollback_rights_pagePublish (live at once), read the live page and its history, roll back. A rollback replaces the draft; pass baseUpdatedAt to both.
list_rights_page_domains, add_rights_page_domain, verify_rights_page_domain, remove_rights_page_domainServe the rights page on your own hostname.
create_rights_linkA signed, single-use rights-page link for a signed-in person.
get_mail_provider, set_mail_provider, test_mail_provider, remove_mail_providerYour own email provider for rights-request mail.

The full list, with every argument, is on cookiemunch.net/docs/mcp-tools.

Client configuration

Claude Desktop / Claude Code

Add to your MCP servers config (claude_desktop_config.json, or via claude mcp add):

{
  "mcpServers": {
    "cookiemunch": {
      "command": "npx",
      "args": ["-y", "@cookiemunch/mcp"],
      "env": {
        "COOKIEMUNCH_API_KEY": "fck_your_key_here"
      }
    }
  }
}

Or, from a local checkout after pnpm --filter @cookiemunch/mcp build:

{
  "mcpServers": {
    "cookiemunch": {
      "command": "node",
      "args": ["/absolute/path/to/packages/mcp/dist/bin.js"],
      "env": {
        "COOKIEMUNCH_API_KEY": "fck_your_key_here"
      }
    }
  }
}

Programmatic use

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());

版本与发布记录

@cookiemunch/mcp 共发布 24 个版本,首次发布于 2026/10/15;过去 12 个月发布了 24 个版本。最新版本附带 npm provenance 构建来源证明,可追溯到公开的 CI 构建记录。

版本发布日期距今
0.18.0latest2026/11/056 天前
0.17.02026/11/046 天前
0.16.02026/11/047 天前
0.15.02026/11/047 天前
0.14.02026/11/038 天前
0.13.12026/11/038 天前

关于 @cookiemunch/mcp 的常见问题

@cookiemunch/mcp 是什么?

Model Context Protocol server for the Cookie Munch Developer API

如何安装 @cookiemunch/mcp?

在项目目录运行 npm install @cookiemunch/mcp,或使用 pnpm add / yarn add / bun add。它还提供命令行工具 cookiemunch-mcp,可以用 npx cookiemunch-mcp 直接运行。

@cookiemunch/mcp 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@cookiemunch/mcp 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@cookiemunch/mcp 可以商用吗?

@cookiemunch/mcp 使用 MIT 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。以上为概括,不构成法律意见,请以许可原文为准。

@cookiemunch/mcp 的下载量有多少?

根据 npm 官方下载统计,@cookiemunch/mcp 在 2026/10/11 – 2026/11/09 这 30 天内被下载 3,345 次,日均约 112 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@cookiemunch/mcp 还在维护吗?

最新版本 0.18.0 发布于 2026/11/05(6 天前);至今共发布 24 个版本,其中过去 12 个月发布了 24 个;首次发布于 2026/10/15。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。