@cookiemunch/mcp 0.4.1 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/dist/bin.cjs +65 -1
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.js +1 -1
- package/dist/{chunk-WGUF6SJH.js → chunk-IQLCPEWI.js} +66 -2
- package/dist/chunk-IQLCPEWI.js.map +1 -0
- package/dist/index.cjs +65 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-WGUF6SJH.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1535,6 +1535,21 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1535
1535
|
{ subjectId: import_zod5.z.string() },
|
|
1536
1536
|
(a) => client.preferences.get(a.subjectId)
|
|
1537
1537
|
);
|
|
1538
|
+
tool(
|
|
1539
|
+
"mint_preference_center_token",
|
|
1540
|
+
"Mint a hosted preference-centre token for one visitor (POST /v1/preference-center/tokens), for a page to pass to CookieMunch.setSubjectToken. Give exactly one of email (resolved as the emailed preference link resolves it; an unknown address is subject_not_found) or subjectId. The token is a credential that opens that person\u2019s subscriptions and profile until expiresAt: never paste it into a shared URL, a ticket or a log, and keep ttlSeconds short (default 3600, max 86400). Needs subscriptions:write and profile:write, plus identity:read by email.",
|
|
1541
|
+
{
|
|
1542
|
+
cbid: import_zod5.z.string().describe("A site of your organisation."),
|
|
1543
|
+
email: import_zod5.z.string().optional().describe("The visitor\u2019s address. Give this or subjectId, not both."),
|
|
1544
|
+
subjectId: import_zod5.z.string().optional().describe("The subject id. Give this or email, not both."),
|
|
1545
|
+
ttlSeconds: import_zod5.z.number().int().min(1).max(86400).optional()
|
|
1546
|
+
},
|
|
1547
|
+
(a) => client.preferenceCenter.mintToken({
|
|
1548
|
+
cbid: a.cbid,
|
|
1549
|
+
...a.email !== void 0 ? { email: a.email } : { subjectId: a.subjectId },
|
|
1550
|
+
...a.ttlSeconds !== void 0 ? { ttlSeconds: a.ttlSeconds } : {}
|
|
1551
|
+
})
|
|
1552
|
+
);
|
|
1538
1553
|
tool(
|
|
1539
1554
|
"issue_api_key",
|
|
1540
1555
|
"Issue a new API key. The secret is returned once and never again. Prefer the least privilege the job needs: `scopes` limits what it can do, `cbids` locks it to specific sites (it then cannot reach anything org-wide), `expiresInDays` retires it. Omitting all three mints a full-access, org-wide, non-expiring key.",
|
|
@@ -1764,6 +1779,37 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1764
1779
|
return { removed: true };
|
|
1765
1780
|
}
|
|
1766
1781
|
);
|
|
1782
|
+
tool(
|
|
1783
|
+
"get_org_controller",
|
|
1784
|
+
"The organisation\u2019s own data-controller identity: who every rights notice names, before any site config controller block. `set: false` when there is none. Read-only.",
|
|
1785
|
+
{},
|
|
1786
|
+
() => client.org.controller.get()
|
|
1787
|
+
);
|
|
1788
|
+
tool(
|
|
1789
|
+
"set_org_controller",
|
|
1790
|
+
"Set the organisation\u2019s data-controller identity. Replaces it: a field left out is removed. Needed for a notice on a rights request filed without a cbid when the organisation has several sites. Needs an unscoped key or rights:write. Audited.",
|
|
1791
|
+
{
|
|
1792
|
+
legalName: import_zod5.z.string().describe("Required: the legal name of the data controller."),
|
|
1793
|
+
contactEmail: import_zod5.z.string().optional().describe("Where people reach the controller about their data."),
|
|
1794
|
+
address: import_zod5.z.string().optional(),
|
|
1795
|
+
dpoContact: import_zod5.z.string().optional().describe("The Data Protection Officer: a name, an email address, or both.")
|
|
1796
|
+
},
|
|
1797
|
+
(a) => client.org.controller.set({
|
|
1798
|
+
legalName: a.legalName,
|
|
1799
|
+
...a.contactEmail !== void 0 ? { contactEmail: a.contactEmail } : {},
|
|
1800
|
+
...a.address !== void 0 ? { address: a.address } : {},
|
|
1801
|
+
...a.dpoContact !== void 0 ? { dpoContact: a.dpoContact } : {}
|
|
1802
|
+
})
|
|
1803
|
+
);
|
|
1804
|
+
tool(
|
|
1805
|
+
"remove_org_controller",
|
|
1806
|
+
"Remove the organisation\u2019s data-controller identity. Notices then name the request\u2019s site config controller block; a request without a cbid in an organisation with several sites gets no notice.",
|
|
1807
|
+
{},
|
|
1808
|
+
async () => {
|
|
1809
|
+
await client.org.controller.remove();
|
|
1810
|
+
return { removed: true };
|
|
1811
|
+
}
|
|
1812
|
+
);
|
|
1767
1813
|
const CAPTCHA_OFF = "Off removes spam protection beyond the hidden spam-trap field, the rate limits and the email code: expect more spam requests. Own keys are recommended.";
|
|
1768
1814
|
const captchaInput = {
|
|
1769
1815
|
mode: import_zod5.z.enum(["own", "off"]).describe(`own: your own captcha provider keys (recommended). off: no captcha. ${CAPTCHA_OFF}`),
|
|
@@ -1779,6 +1825,24 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
1779
1825
|
...a.secret !== void 0 ? { secret: a.secret } : {},
|
|
1780
1826
|
...a.minScore !== void 0 ? { minScore: a.minScore } : {}
|
|
1781
1827
|
});
|
|
1828
|
+
tool(
|
|
1829
|
+
"get_consent_sync_secret",
|
|
1830
|
+
"Whether hosted consent sync is set up for a site: `configured`, `secretLast4`, `createdAt`. Never returns the secret. Read-only.",
|
|
1831
|
+
{ cbid: import_zod5.z.string() },
|
|
1832
|
+
(a) => client.consentSyncSecret.get(a.cbid)
|
|
1833
|
+
);
|
|
1834
|
+
tool(
|
|
1835
|
+
"rotate_consent_sync_secret",
|
|
1836
|
+
"Mint a site\u2019s consent-sync signing secret, or rotate it. The answer carries `secret` this once; the site owner\u2019s server signs consent-sync tokens with it (mintConsentSyncToken in @cookiemunch/sdk). Rotating stops the old secret at once, so every page holding a token signed with it stops syncing until it gets a new token. Never put the secret in a page. Needs sites:write and consent:write.",
|
|
1837
|
+
{ cbid: import_zod5.z.string() },
|
|
1838
|
+
(a) => client.consentSyncSecret.rotate(a.cbid)
|
|
1839
|
+
);
|
|
1840
|
+
tool(
|
|
1841
|
+
"remove_consent_sync_secret",
|
|
1842
|
+
"Remove a site\u2019s consent-sync secret: hosted consent sync stops until a new one is minted. Needs sites:write and consent:write.",
|
|
1843
|
+
{ cbid: import_zod5.z.string() },
|
|
1844
|
+
(a) => client.consentSyncSecret.remove(a.cbid)
|
|
1845
|
+
);
|
|
1782
1846
|
tool(
|
|
1783
1847
|
"get_rights_captcha",
|
|
1784
1848
|
"The captcha on a site\u2019s hosted rights page: its own setting, else the organisation default, else off (`source` says which). Never returns the secret. Read-only.",
|
|
@@ -2020,7 +2084,7 @@ ${JSON.stringify(r, null, 2)}` : r;
|
|
|
2020
2084
|
}
|
|
2021
2085
|
|
|
2022
2086
|
// src/index.ts
|
|
2023
|
-
var MCP_VERSION = "0.
|
|
2087
|
+
var MCP_VERSION = "0.5.0";
|
|
2024
2088
|
function createCookieMunchMcp(opts) {
|
|
2025
2089
|
const client = opts.client ?? (0, import_sdk.createCookieMunch)({ apiKey: opts.apiKey, baseUrl: opts.baseUrl, userAgent: opts.userAgent ?? `cookiemunch-mcp/${MCP_VERSION}` });
|
|
2026
2090
|
const server = new import_mcp.McpServer({ name: "cookiemunch", version: "1.0.0" });
|