@cookiemunch/mcp 0.7.1 → 0.8.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 +5 -0
- package/dist/bin.cjs +28 -10
- package/dist/bin.cjs.map +1 -1
- package/dist/bin.d.ts +8 -0
- package/dist/bin.js +1 -1
- package/dist/{chunk-3C3J6N2L.js → chunk-E2YZUVQY.js} +29 -11
- package/dist/chunk-E2YZUVQY.js.map +1 -0
- package/dist/design-warnings.d.ts +18 -0
- package/dist/index.cjs +28 -10
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +6 -37
- package/dist/index.js +1 -1
- package/dist/tools-config.d.ts +12 -0
- package/dist/tools-integrations.d.ts +7 -0
- package/dist/tools-keys-tags.d.ts +8 -0
- package/dist/tools-platform.d.ts +13 -0
- package/dist/tools-rights-page.d.ts +6 -0
- package/dist/tools.d.ts +33 -0
- package/package.json +3 -3
- package/dist/chunk-3C3J6N2L.js.map +0 -1
- package/dist/index.d.cts +0 -52
package/dist/index.d.ts
CHANGED
|
@@ -1,44 +1,15 @@
|
|
|
1
|
-
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
2
|
-
import { CookieMunchClient } from '@cookiemunch/sdk';
|
|
3
|
-
import { ZodRawShape } from 'zod';
|
|
4
|
-
|
|
5
|
-
/**
|
|
6
|
-
* Tool registration for the Cookie Munch MCP server. registerTools wires the
|
|
7
|
-
* @cookiemunch/sdk client onto an MCP server's registerTool API. It depends only
|
|
8
|
-
* on a minimal ToolServer shape (structurally satisfied by McpServer), so the
|
|
9
|
-
* registration logic is unit-testable against a fake server + mocked SDK client
|
|
10
|
-
* without standing up a stdio transport.
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
|
-
interface ToolResult {
|
|
14
|
-
content: Array<{
|
|
15
|
-
type: 'text';
|
|
16
|
-
text: string;
|
|
17
|
-
}>;
|
|
18
|
-
isError?: boolean;
|
|
19
|
-
/** MCP's CallToolResult carries an open index signature; included for structural compatibility. */
|
|
20
|
-
[key: string]: unknown;
|
|
21
|
-
}
|
|
22
|
-
/** The slice of McpServer.registerTool we depend on (structurally compatible). */
|
|
23
|
-
interface ToolServer {
|
|
24
|
-
registerTool(name: string, config: {
|
|
25
|
-
title?: string;
|
|
26
|
-
description: string;
|
|
27
|
-
inputSchema?: ZodRawShape;
|
|
28
|
-
}, handler: (args: Record<string, unknown>) => Promise<ToolResult>): unknown;
|
|
29
|
-
}
|
|
30
|
-
declare function registerTools(server: ToolServer, client: CookieMunchClient): void;
|
|
31
|
-
|
|
32
1
|
/**
|
|
33
2
|
* @cookiemunch/mcp — a Model Context Protocol server exposing the Cookie Munch
|
|
34
3
|
* Developer API as MCP tools, built on @cookiemunch/sdk. The library entry exports
|
|
35
4
|
* the tool registration (registerTools) and a server factory (createCookieMunchMcp);
|
|
36
5
|
* the stdio bootstrap lives in bin.ts.
|
|
37
6
|
*/
|
|
38
|
-
|
|
7
|
+
import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';
|
|
8
|
+
import { type CookieMunchClient } from '@cookiemunch/sdk';
|
|
9
|
+
export { registerTools, type ToolServer, type ToolResult } from './tools.js';
|
|
39
10
|
/** This package's version, sent in the default User-Agent (a test pins it to package.json). */
|
|
40
|
-
declare const MCP_VERSION = "0.
|
|
41
|
-
interface CookieMunchMcpOptions {
|
|
11
|
+
export declare const MCP_VERSION = "0.8.0";
|
|
12
|
+
export interface CookieMunchMcpOptions {
|
|
42
13
|
apiKey: string;
|
|
43
14
|
baseUrl: string;
|
|
44
15
|
/** The `User-Agent` sent to the API. Default `cookiemunch-mcp/<version>`. */
|
|
@@ -47,6 +18,4 @@ interface CookieMunchMcpOptions {
|
|
|
47
18
|
client?: CookieMunchClient;
|
|
48
19
|
}
|
|
49
20
|
/** Build an McpServer with all Cookie Munch tools registered. Connect a transport to run it. */
|
|
50
|
-
declare function createCookieMunchMcp(opts: CookieMunchMcpOptions): McpServer;
|
|
51
|
-
|
|
52
|
-
export { type CookieMunchMcpOptions, MCP_VERSION, type ToolResult, type ToolServer, createCookieMunchMcp, registerTools };
|
|
21
|
+
export declare function createCookieMunchMcp(opts: CookieMunchMcpOptions): McpServer;
|
package/dist/index.js
CHANGED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Structured, validated config tools for non-flow config domains (Task 3), plus
|
|
3
|
+
* the install-snippet tool. Extracted from tools.ts as a cohesive group. Each tool
|
|
4
|
+
* fetches the current SiteConfig, patches only its own domain, and PUTs it back.
|
|
5
|
+
*
|
|
6
|
+
* registerConfigTools is handed the same `tool` registrar that registerTools uses,
|
|
7
|
+
* so registration order is preserved when it is called at the right point in the
|
|
8
|
+
* sequence.
|
|
9
|
+
*/
|
|
10
|
+
import type { CookieMunchClient } from '@cookiemunch/sdk';
|
|
11
|
+
import type { ToolRegistrar } from './tools.js';
|
|
12
|
+
export declare function registerConfigTools(tool: ToolRegistrar, client: CookieMunchClient): void;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tools for a site's identity and its integrations as a whole: rename/move a site, the
|
|
3
|
+
* integration-health report, one-call provisioning, and partner trust links.
|
|
4
|
+
*/
|
|
5
|
+
import type { CookieMunchClient } from '@cookiemunch/sdk';
|
|
6
|
+
import type { ToolRegistrar } from './tools.js';
|
|
7
|
+
export declare function registerIntegrationTools(tool: ToolRegistrar, client: CookieMunchClient): void;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tools for the key model and resource tags (CMU-D09, S02, X29, X31, X34, X35): the calling key itself,
|
|
3
|
+
* vended short-lived keys, leak revocation, the standard key listing, tags on resources, suite-standard
|
|
4
|
+
* partner links, and the env of a provisioned product.
|
|
5
|
+
*/
|
|
6
|
+
import type { CookieMunchClient } from '@cookiemunch/sdk';
|
|
7
|
+
import type { ToolRegistrar } from './tools.js';
|
|
8
|
+
export declare function registerKeyAndTagTools(tool: ToolRegistrar, client: CookieMunchClient): void;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* MCP tools for the platform surfaces beyond the CMP: identity resolution, the Permission
|
|
3
|
+
* Vault, profiles, subscriptions, assessments, data discovery, DSR fulfillment and AI
|
|
4
|
+
* governance.
|
|
5
|
+
*
|
|
6
|
+
* Registered through the same ToolRegistrar as the core tools, so error wrapping and ordering
|
|
7
|
+
* stay consistent. Descriptions spell out the CONSEQUENCE of each call (what it mutates, what
|
|
8
|
+
* it gates) — an agent picking a tool from a one-line summary needs to know that `link` merges
|
|
9
|
+
* two people permanently and that `activate` is consent-gated.
|
|
10
|
+
*/
|
|
11
|
+
import type { CookieMunchClient } from '@cookiemunch/sdk';
|
|
12
|
+
import type { ToolRegistrar } from './tools.js';
|
|
13
|
+
export declare function registerPlatformTools(tool: ToolRegistrar, client: CookieMunchClient): void;
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
import type { CookieMunchClient } from '@cookiemunch/sdk';
|
|
2
|
+
import type { ToolRegistrar } from './tools.js';
|
|
3
|
+
/** The hosted rights page as a document. */
|
|
4
|
+
export declare function registerRightsTools(tool: ToolRegistrar, client: CookieMunchClient): void;
|
|
5
|
+
/** Custom hostnames for a site's hosted rights page. */
|
|
6
|
+
export declare function registerRightsPageTools(tool: ToolRegistrar, client: CookieMunchClient): void;
|
package/dist/tools.d.ts
ADDED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Tool registration for the Cookie Munch MCP server. registerTools wires the
|
|
3
|
+
* @cookiemunch/sdk client onto an MCP server's registerTool API. It depends only
|
|
4
|
+
* on a minimal ToolServer shape (structurally satisfied by McpServer), so the
|
|
5
|
+
* registration logic is unit-testable against a fake server + mocked SDK client
|
|
6
|
+
* without standing up a stdio transport.
|
|
7
|
+
*/
|
|
8
|
+
import { type ZodRawShape } from 'zod';
|
|
9
|
+
import type { CookieMunchClient } from '@cookiemunch/sdk';
|
|
10
|
+
export interface ToolResult {
|
|
11
|
+
content: Array<{
|
|
12
|
+
type: 'text';
|
|
13
|
+
text: string;
|
|
14
|
+
}>;
|
|
15
|
+
isError?: boolean;
|
|
16
|
+
/** MCP's CallToolResult carries an open index signature; included for structural compatibility. */
|
|
17
|
+
[key: string]: unknown;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The `tool` registrar shape: registers one tool whose handler wraps SDK errors
|
|
21
|
+
* into an isError result. Passed to sibling modules (e.g. tools-config.ts) so they
|
|
22
|
+
* register into the same set while preserving order.
|
|
23
|
+
*/
|
|
24
|
+
export type ToolRegistrar = (name: string, description: string, inputSchema: ZodRawShape, run: (args: Record<string, unknown>) => Promise<unknown>) => void;
|
|
25
|
+
/** The slice of McpServer.registerTool we depend on (structurally compatible). */
|
|
26
|
+
export interface ToolServer {
|
|
27
|
+
registerTool(name: string, config: {
|
|
28
|
+
title?: string;
|
|
29
|
+
description: string;
|
|
30
|
+
inputSchema?: ZodRawShape;
|
|
31
|
+
}, handler: (args: Record<string, unknown>) => Promise<ToolResult>): unknown;
|
|
32
|
+
}
|
|
33
|
+
export declare function registerTools(server: ToolServer, client: CookieMunchClient): void;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cookiemunch/mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.0",
|
|
4
4
|
"description": "Model Context Protocol server for the Cookie Munch Developer API",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -30,11 +30,11 @@
|
|
|
30
30
|
"access": "public"
|
|
31
31
|
},
|
|
32
32
|
"scripts": {
|
|
33
|
-
"build": "tsup",
|
|
33
|
+
"build": "tsup && tsc -p tsconfig.json --emitDeclarationOnly --declaration",
|
|
34
34
|
"test": "vitest run"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@cookiemunch/sdk": "^0.
|
|
37
|
+
"@cookiemunch/sdk": "^0.8.0",
|
|
38
38
|
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
39
39
|
"zod": "^3.25.0"
|
|
40
40
|
},
|