@zapier/zapier-sdk-mcp 0.27.7 → 0.27.9

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 CHANGED
@@ -1,5 +1,20 @@
1
1
  # @zapier/zapier-sdk-mcp
2
2
 
3
+ ## 0.27.9
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies [db3e28a]
8
+ - @zapier/zapier-sdk@0.116.0
9
+
10
+ ## 0.27.8
11
+
12
+ ### Patch Changes
13
+
14
+ - 5bb041a: _This release contains no user-facing changes._
15
+ - Updated dependencies [5bb041a]
16
+ - @zapier/zapier-sdk@0.115.2
17
+
3
18
  ## 0.27.7
4
19
 
5
20
  ### Patch Changes
package/dist/index.mjs CHANGED
@@ -9,7 +9,6 @@ import {
9
9
  addPlugin,
10
10
  applyStabilityLabel,
11
11
  createSdk,
12
- getAgent,
13
12
  SDK_OPTIONS_ID,
14
13
  CORE_OPTIONS_ID,
15
14
  zapierCoreOptions,
@@ -22,14 +21,10 @@ import {
22
21
  formatExtensionPluginFailure
23
22
  } from "@zapier/zapier-sdk";
24
23
  import { zapierBetaSdkPlugin } from "@zapier/zapier-sdk/beta";
25
- import {
26
- INTERNAL_CREATE_WORKFLOW_FIELDS,
27
- zapierExperimentalSdkPlugin
28
- } from "@zapier/zapier-sdk/experimental";
29
- import { z } from "zod";
24
+ import { zapierExperimentalSdkPlugin } from "@zapier/zapier-sdk/experimental";
30
25
 
31
26
  // src/utils/schema-converter.ts
32
- import { descriptionFor } from "@zapier/zapier-sdk";
27
+ import { descriptionFor, isInternalField } from "@zapier/zapier-sdk";
33
28
  function getZodDef(schema) {
34
29
  const schemaAny = schema;
35
30
  return schemaAny._zod?.def;
@@ -74,7 +69,7 @@ function convertZodType(def, schema) {
74
69
  const required = [];
75
70
  if (schemaWithShape.shape) {
76
71
  for (const [key, value] of Object.entries(schemaWithShape.shape)) {
77
- if (isDeprecatedSchema(value)) continue;
72
+ if (isDeprecatedSchema(value) || isInternalField(value)) continue;
78
73
  const fieldDef = getZodDef(value);
79
74
  if (fieldDef) {
80
75
  properties[key] = convertZodType(fieldDef, value);
@@ -275,7 +270,7 @@ function convertZodType(def, schema) {
275
270
  // package.json
276
271
  var package_default = {
277
272
  name: "@zapier/zapier-sdk-mcp",
278
- version: "0.27.7",
273
+ version: "0.27.9",
279
274
  description: "MCP server for Zapier SDK",
280
275
  main: "dist/index.mjs",
281
276
  types: "dist/index.d.mts",
@@ -334,31 +329,6 @@ var package_default = {
334
329
  };
335
330
 
336
331
  // src/index.ts
337
- var workflowCreationOverride = {
338
- hiddenSdkArgs: INTERNAL_CREATE_WORKFLOW_FIELDS,
339
- transformArgs: (args) => ({
340
- ...args,
341
- creationHarness: getAgent(),
342
- creationAccessMethod: "sdk_mcp"
343
- })
344
- };
345
- var MCP_TOOL_OVERRIDES = {
346
- createWorkflow: workflowCreationOverride,
347
- importWorkflow: workflowCreationOverride
348
- };
349
- function getMcpInputSchema(functionInfo) {
350
- const inputSchema = functionInfo.inputSchema;
351
- const override = MCP_TOOL_OVERRIDES[functionInfo.name];
352
- if (!inputSchema || !override) return inputSchema;
353
- const shape = inputSchema.shape;
354
- if (!shape) return inputSchema;
355
- const hiddenSdkArgs = new Set(override.hiddenSdkArgs);
356
- return z.object(
357
- Object.fromEntries(
358
- Object.entries(shape).filter(([name]) => !hiddenSdkArgs.has(name))
359
- )
360
- ).describe(inputSchema.description ?? `Execute ${functionInfo.name}`);
361
- }
362
332
  function createZapierMcpServer({
363
333
  debug = false,
364
334
  maxConcurrentRequests,
@@ -427,7 +397,7 @@ function createZapierMcpServer({
427
397
  const tools = getRegistry(zapierSdk, "mcp").functions.map(
428
398
  (functionInfo) => {
429
399
  const toolName = functionInfo.name.replace(/([A-Z])/g, "-$1").toLowerCase();
430
- const inputSchema = getMcpInputSchema(functionInfo);
400
+ const inputSchema = functionInfo.inputSchema;
431
401
  const baseDescription = functionInfo.description || inputSchema?.description || `Execute ${functionInfo.name}`;
432
402
  const description = applyStabilityLabel({
433
403
  description: baseDescription,
@@ -466,12 +436,13 @@ function createZapierMcpServer({
466
436
  try {
467
437
  let result;
468
438
  if (functionInfo.inputSchema) {
469
- const inputSchema = getMcpInputSchema(functionInfo);
470
- const validatedArgs = inputSchema.parse(args || {});
471
- const override = MCP_TOOL_OVERRIDES[functionInfo.name];
472
- const sdkArgs = override ? override.transformArgs(validatedArgs) : validatedArgs;
439
+ const validatedArgs = functionInfo.inputSchema.parse(
440
+ args || {}
441
+ );
473
442
  const sdkFn = zapierSdk[functionInfo.name];
474
- result = functionInfo.positional?.length ? await sdkFn(...functionInfo.positional.map((name2) => sdkArgs[name2])) : await sdkFn(sdkArgs);
443
+ result = functionInfo.positional?.length ? await sdkFn(
444
+ ...functionInfo.positional.map((name2) => validatedArgs[name2])
445
+ ) : await sdkFn(validatedArgs);
475
446
  } else {
476
447
  const sdkFn = zapierSdk[functionInfo.name];
477
448
  result = await sdkFn();
@@ -533,8 +504,7 @@ ${error.message}`
533
504
  } else {
534
505
  errorMessage = `Unexpected error in ${functionInfo.name}: ${String(error)}`;
535
506
  }
536
- const mcpInputSchema = getMcpInputSchema(functionInfo);
537
- const errorSchema = mcpInputSchema ? convertZodToMcpSchema(mcpInputSchema) : {};
507
+ const errorSchema = functionInfo.inputSchema ? convertZodToMcpSchema(functionInfo.inputSchema) : {};
538
508
  return {
539
509
  content: [
540
510
  {
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/index.ts","../src/utils/schema-converter.ts","../package.json"],"sourcesContent":["import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n type CallToolRequest,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport {\n addPlugin,\n applyStabilityLabel,\n createSdk,\n getAgent,\n SDK_OPTIONS_ID,\n CORE_OPTIONS_ID,\n zapierCoreOptions,\n DEPRECATION_NOTICE_EVENT,\n zapierSdkPlugin,\n runWithCallerContext,\n isZapierApprovalError,\n type ZapierSdkOptions,\n type ZapierSdk,\n type FunctionRegistryEntry,\n // The free reader, not `zapierSdk.getRegistry()`: the accessor is a\n // re-exportable built-in, so an SDK is free not to surface it.\n getRegistry,\n logDeprecation,\n formatExtensionPluginFailure,\n type Plugin,\n type StabilityLevel,\n} from \"@zapier/zapier-sdk\";\nimport { zapierBetaSdkPlugin } from \"@zapier/zapier-sdk/beta\";\nimport {\n INTERNAL_CREATE_WORKFLOW_FIELDS,\n zapierExperimentalSdkPlugin,\n type CreateWorkflowOptions,\n} from \"@zapier/zapier-sdk/experimental\";\nimport { z } from \"zod\";\nimport { convertZodToMcpSchema } from \"./utils/schema-converter.js\";\nimport packageJson from \"../package.json\" with { type: \"json\" };\n\ntype CreationAccessMethod = NonNullable<\n CreateWorkflowOptions[\"creationAccessMethod\"]\n>;\n\ninterface McpToolOverride {\n hiddenSdkArgs: readonly string[];\n transformArgs: (args: Record<string, unknown>) => Record<string, unknown>;\n}\n\nconst workflowCreationOverride: McpToolOverride = {\n hiddenSdkArgs: INTERNAL_CREATE_WORKFLOW_FIELDS,\n transformArgs: (args) => ({\n ...args,\n creationHarness: getAgent(),\n creationAccessMethod: \"sdk_mcp\" satisfies CreationAccessMethod,\n }),\n};\n\nconst MCP_TOOL_OVERRIDES: Record<string, McpToolOverride> = {\n createWorkflow: workflowCreationOverride,\n importWorkflow: workflowCreationOverride,\n};\n\nfunction getMcpInputSchema(\n functionInfo: FunctionRegistryEntry,\n): z.ZodSchema | undefined {\n const inputSchema = functionInfo.inputSchema;\n const override = MCP_TOOL_OVERRIDES[functionInfo.name];\n if (!inputSchema || !override) return inputSchema;\n\n const shape = (inputSchema as { shape?: Record<string, z.ZodType> }).shape;\n if (!shape) return inputSchema;\n\n const hiddenSdkArgs = new Set(override.hiddenSdkArgs);\n return z\n .object(\n Object.fromEntries(\n Object.entries(shape).filter(([name]) => !hiddenSdkArgs.has(name)),\n ),\n )\n .describe(inputSchema.description ?? `Execute ${functionInfo.name}`);\n}\n\ninterface ZapierMcpServerOptions {\n debug?: boolean;\n /**\n * Forwarded to the underlying SDK so a CLI invocation like\n * `zapier-sdk --max-concurrent-requests 50 mcp` actually constrains\n * the MCP server's tool calls. Undefined falls through to the SDK's\n * own resolution chain (option > env var > default).\n */\n maxConcurrentRequests?: number;\n /**\n * Extra plugins to layer onto the SDK before exposing it as MCP tools.\n * Used by the CLI's `mcp` command to forward extensions discovered via\n * the `ZAPIER_SDK_EXTENSIONS` env var. Standalone callers can omit this;\n * the server then uses a vanilla public SDK. Each is forwarded to\n * `addPlugin`, so each must be a descriptor from a `define*` factory.\n */\n extensions?: readonly Plugin[];\n /**\n * Which stability tier of the SDK to build the server against:\n * `\"beta\"` uses `@zapier/zapier-sdk/beta`, `\"experimental\"` uses\n * `@zapier/zapier-sdk/experimental`, so that tier's plugins appear as\n * MCP tools. Mirrors the CLI's `--stability <level>` opt-in: a default\n * invocation only ever sees stable plugins.\n */\n stability?: StabilityLevel;\n /**\n * @deprecated Use `stability: \"experimental\"` instead. `true` selects\n * the experimental tier when `stability` is not set.\n */\n experimental?: boolean;\n}\n\n/**\n * Creates an MCP server that exposes Zapier SDK functions as MCP tools.\n *\n * The server automatically discovers all available SDK functions and converts\n * their Zod schemas to MCP-compatible JSON schemas. It handles tool execution\n * by validating inputs and calling the appropriate SDK functions.\n *\n * @param options - Configuration options for the MCP server\n * @param options.debug - Enable debug logging for detailed error information\n * @returns An MCP server instance configured to expose Zapier SDK tools\n *\n * @example\n * ```typescript\n * const server = createZapierMcpServer({ debug: true });\n * const transport = new StdioServerTransport();\n * await server.connect(transport);\n * ```\n */\nfunction createZapierMcpServer({\n debug = false,\n maxConcurrentRequests,\n extensions = [],\n stability,\n experimental = false,\n}: ZapierMcpServerOptions = {}) {\n // Pick the SDK root by opt-in: each tier's aggregate is a strict superset\n // of the one below it (beta re-exports zapierSdkPlugin plus the beta\n // plugins; experimental re-exports beta), so the registry path used below\n // works the same regardless of root. The deprecated `experimental`\n // boolean only applies when no level is declared.\n let level: StabilityLevel = \"stable\";\n if (stability) {\n level = stability;\n } else if (experimental) {\n // Warn as it resolves, so a host still passing the released boolean\n // learns the replacement. Stderr, which is where the SDK's own notices\n // go and is not part of the stdio protocol stream.\n logDeprecation(\n 'The `experimental` option is deprecated. Use `stability: \"experimental\"` instead.',\n );\n level = \"experimental\";\n }\n const sdkRootPlugin = {\n stable: zapierSdkPlugin,\n beta: zapierBetaSdkPlugin,\n experimental: zapierExperimentalSdkPlugin,\n }[level];\n\n // Active SDK deprecation notices, keyed by notice id. The SDK's own\n // console.warn goes to stderr, which agents never see over stdio — so the\n // server attaches each active notice to every tool result, instructing the\n // agent to relay it to the user. No per-call dedupe: an agent that ignores\n // the block once still surfaces it on a later call. Keying by id keeps a\n // single result from repeating the same notice.\n const activeDeprecationNotices = new Map<string, string>();\n\n const deprecationNoticeContent = () =>\n Array.from(activeDeprecationNotices.values(), (message) => ({\n type: \"text\" as const,\n text: `⚠️ Zapier SDK deprecation notice: ${message} You **must** relay this warning to the user — this will break soon.`,\n }));\n\n const stackOptions: ZapierSdkOptions = {\n debug,\n maxConcurrentRequests,\n eventEmission: { callContext: \"mcp\" },\n callerPackage: { name: packageJson.name, version: packageJson.version },\n approvalMode: \"throw\",\n onEvent: (event) => {\n if (event.type !== DEPRECATION_NOTICE_EVENT) return;\n const { id, message } = event.payload ?? {};\n if (typeof id === \"string\" && typeof message === \"string\") {\n activeDeprecationNotices.set(id, message);\n }\n },\n };\n const zapierSdk: ZapierSdk = createSdk(sdkRootPlugin, {\n configuration: {\n [SDK_OPTIONS_ID]: stackOptions,\n [CORE_OPTIONS_ID]: zapierCoreOptions,\n },\n }) as unknown as ZapierSdk;\n\n // Layer extension plugins on top of the vanilla SDK so their methods show\n // up in `getRegistry({ package: \"mcp\" })` alongside the public surface.\n // Same robustness contract as the CLI: a broken extension warns and\n // skips rather than killing the MCP server. `addPlugin` is atomic\n // (validate-then-apply), so a failed extension leaves the sdk in its\n // prior consistent state.\n for (const ext of extensions) {\n try {\n addPlugin(zapierSdk, ext);\n } catch (err) {\n console.warn(formatExtensionPluginFailure(err));\n }\n }\n\n // Create MCP server\n const server = new Server(\n {\n name: \"zapier-sdk\",\n version: \"1.0.0\",\n },\n {\n capabilities: {\n tools: {},\n },\n },\n );\n\n // Register list_tools handler - dynamically list all SDK functions as tools\n server.setRequestHandler(ListToolsRequestSchema, async () => {\n const tools = getRegistry(zapierSdk, \"mcp\").functions.map(\n (functionInfo: FunctionRegistryEntry) => {\n const toolName = functionInfo.name\n .replace(/([A-Z])/g, \"-$1\")\n .toLowerCase();\n\n const inputSchema = getMcpInputSchema(functionInfo);\n const baseDescription =\n functionInfo.description ||\n inputSchema?.description ||\n `Execute ${functionInfo.name}`;\n // Label non-stable tools where an LLM listing them reads first —\n // the front of the description — so it can tell which tier's\n // contract a beta / experimental tool carries. The label follows the\n // plugin's declared level, not the tier the server was built with.\n const description = applyStabilityLabel({\n description: baseDescription,\n stability: functionInfo.stability,\n placement: \"prefix\",\n });\n\n return {\n name: toolName,\n description,\n inputSchema: inputSchema\n ? convertZodToMcpSchema(inputSchema)\n : { type: \"object\", properties: {} },\n };\n },\n );\n\n return { tools };\n });\n\n // Execute SDK functions as tool calls. Kept separate from the registered\n // handler so every return path — success, approval, and error results —\n // flows through the deprecation-notice attachment below.\n const handleToolCall = async (request: CallToolRequest) => {\n const { name, arguments: args } = request.params;\n // Convert kebab-case tool name back to camelCase function name\n const functionName = name.replace(/-([a-z])/g, (_, letter) =>\n letter.toUpperCase(),\n );\n\n // Find the function info\n const functionInfo: FunctionRegistryEntry | undefined = getRegistry(\n zapierSdk,\n \"mcp\",\n ).functions.find(\n (info: FunctionRegistryEntry) => info.name === functionName,\n );\n\n if (!functionInfo) {\n const availableTools = getRegistry(zapierSdk, \"mcp\")\n .functions.map((info) =>\n info.name.replace(/([A-Z])/g, \"-$1\").toLowerCase(),\n )\n .join(\", \");\n throw new Error(\n `Unknown tool: ${name}. Available tools: ${availableTools}`,\n );\n }\n\n try {\n let result: unknown;\n\n if (functionInfo.inputSchema) {\n const inputSchema = getMcpInputSchema(functionInfo);\n const validatedArgs = inputSchema!.parse(args || {}) as Record<\n string,\n unknown\n >;\n const override = MCP_TOOL_OVERRIDES[functionInfo.name];\n const sdkArgs = override\n ? override.transformArgs(validatedArgs)\n : validatedArgs;\n const sdkFn = (\n zapierSdk as unknown as Record<\n string,\n (...args: unknown[]) => Promise<unknown>\n >\n )[functionInfo.name];\n // A method with a `positional` projection (fetch's `(url, init)`) takes\n // ordered args, not the single bag; spread the validated object by its\n // positional keys. Everything else is single-object.\n result = functionInfo.positional?.length\n ? await sdkFn(...functionInfo.positional.map((name) => sdkArgs[name]))\n : await sdkFn(sdkArgs);\n } else {\n const sdkFn = (\n zapierSdk as unknown as Record<\n string,\n (...args: unknown[]) => Promise<unknown>\n >\n )[functionInfo.name];\n result = await sdkFn();\n }\n\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(result, null, 2),\n },\n ],\n };\n } catch (error) {\n if (debug) {\n console.error(\n `Error executing function '${functionInfo.name}' (tool: ${name}):`,\n error,\n );\n }\n\n if (isZapierApprovalError(error)) {\n switch (error.approvalStatus) {\n // Pending approval: return the URL so the LLM can instruct the user\n case \"pending\":\n return {\n content: [\n {\n type: \"text\",\n text: `This action requires approval. The end user must open this link in their browser to approve this action, then retry this tool call:\\n\\n${error.approvalUrl}`,\n },\n ],\n isError: false,\n };\n // Policy denied: hard deny, cannot be approved\n case \"policy_denied\":\n return {\n content: [\n {\n type: \"text\",\n text: `This action was denied by policy and cannot be approved:\\n\\n${error.message}`,\n },\n ],\n isError: true,\n };\n }\n }\n\n let errorMessage: string;\n let isValidationError = false;\n\n if (error instanceof Error) {\n // Check if it's a Zod validation error\n if (error.name === \"ZodError\") {\n isValidationError = true;\n errorMessage = `Validation error for ${functionInfo.name}: ${error.message}`;\n } else {\n errorMessage = `Error in ${functionInfo.name}: ${error.message}`;\n }\n } else {\n errorMessage = `Unexpected error in ${functionInfo.name}: ${String(error)}`;\n }\n\n const mcpInputSchema = getMcpInputSchema(functionInfo);\n const errorSchema = mcpInputSchema\n ? convertZodToMcpSchema(mcpInputSchema)\n : {};\n\n return {\n content: [\n {\n type: \"text\",\n text: isValidationError\n ? `${errorMessage}\\n\\nExpected input format:\\n${JSON.stringify(errorSchema, null, 2)}`\n : errorMessage,\n },\n ],\n isError: true,\n };\n }\n };\n\n server.setRequestHandler(CallToolRequestSchema, async (request) => {\n const { name } = request.params;\n // Use the external wire name (e.g. \"run-action\"), not the camelCase SDK method.\n return runWithCallerContext({ packageOperation: name }, async () => {\n const result = await handleToolCall(request);\n const notices = deprecationNoticeContent();\n if (notices.length === 0) return result;\n return { ...result, content: [...result.content, ...notices] };\n });\n });\n\n return server;\n}\n\n/**\n * Starts an MCP server with stdio transport for CLI usage.\n *\n * This is the main entry point when running the MCP server from the command line.\n * It creates the server and connects it using stdio transport for communication\n * with MCP clients like Claude Code.\n *\n * @param options - Configuration options for the MCP server\n * @param options.debug - Enable debug logging for detailed error information\n *\n * @example\n * ```typescript\n * // Start server with debug logging\n * await startMcpServer({ debug: true });\n * ```\n */\nasync function startMcpServer(\n options: ZapierMcpServerOptions = {},\n): Promise<void> {\n const server = createZapierMcpServer(options);\n const transport = new StdioServerTransport();\n\n return new Promise<void>((resolve) => {\n let isShuttingDown = false;\n\n const cleanup = async () => {\n if (isShuttingDown) return;\n isShuttingDown = true;\n\n try {\n await server.close();\n } finally {\n resolve();\n }\n };\n\n // Handle clean shutdown when client closes connection\n server.onclose = () => {\n cleanup();\n };\n\n // Handle termination signals (Ctrl+C, kill, etc.)\n // Using process.once() to prevent handler accumulation\n process.once(\"SIGINT\", cleanup);\n process.once(\"SIGTERM\", cleanup);\n\n server.connect(transport).catch((error) => {\n console.error(\"Failed to start MCP server:\", error);\n process.exit(1);\n });\n });\n}\n\nexport { createZapierMcpServer, startMcpServer };\n// Exported so the cross-surface description conformance test can read what\n// `tools/list` would advertise without standing up a server over stdio.\nexport { convertZodToMcpSchema } from \"./utils/schema-converter.js\";\n","/**\n * A robust schema converter that handles conversion from Zod schemas to JSON Schema format:\n *\n * **Core Types:**\n * - ✅ Objects, arrays, strings, numbers, booleans\n * - ✅ Enums, unions, intersections, literals\n * - ✅ Optional and nullable fields\n * - ✅ Records and dates\n * - ✅ Nested schemas and complex types\n *\n * **Additional Types:**\n * - ✅ Any, unknown, bigint, null, undefined, void, NaN\n * - ✅ Default values and catch handlers (unwrapped to inner type)\n * - ✅ Graceful fallback for unsupported types\n */\n\nimport type { z } from \"zod\";\nimport { descriptionFor } from \"@zapier/zapier-sdk\";\n\ninterface McpSchema {\n type?: string | string[];\n properties?: Record<string, McpSchema>;\n required?: string[];\n description?: string;\n items?: McpSchema;\n enum?: unknown[];\n anyOf?: McpSchema[];\n oneOf?: McpSchema[];\n allOf?: McpSchema[];\n additionalProperties?: McpSchema | boolean;\n format?: string;\n}\n\n// Zod internal definition structure\ninterface ZodDef {\n type: string; // e.g., \"string\", \"number\", \"object\", \"optional\", etc.\n element?: z.ZodSchema; // For arrays\n innerType?: z.ZodSchema; // For optional, nullable, default, catch\n entries?: Record<string, string>; // For enums\n values?: unknown[]; // For literals\n options?: z.ZodSchema[]; // For unions\n left?: z.ZodSchema; // For intersections\n right?: z.ZodSchema; // For intersections\n keyType?: z.ZodSchema; // For records (key type)\n valueType?: z.ZodSchema; // For records (value type)\n shape?: Record<string, z.ZodSchema>; // For objects (function in some cases)\n}\n\n// Zod schema with description (description is on the schema, not the def)\ninterface ZodSchemaWithDescription extends z.ZodSchema {\n description?: string;\n}\n\ninterface ZodSchemaWithShape extends z.ZodSchema {\n shape?: Record<string, z.ZodSchema>;\n}\n\n/**\n * Gets the Zod def from a schema, with fallback for edge cases\n */\nfunction getZodDef(schema: z.ZodSchema): ZodDef | undefined {\n const schemaAny = schema as unknown as { _zod?: { def?: ZodDef } };\n return schemaAny._zod?.def;\n}\n\n/**\n * Whether a parameter is marked deprecated and should not be advertised.\n *\n * The CLI hides these from `--help` and the docs generator drops them, but the\n * MCP converter emitted every key in the shape — so `tools/list` advertised\n * deprecated parameters alongside their replacements. On `run-action` that was\n * worse than cosmetic: the sentence stating when a connection is required was\n * attached to the deprecated `connectionId`, so MCP callers were shown the rule\n * on the parameter they should not use and CLI callers were shown it nowhere.\n *\n * Checked at every wrapper level because `.meta()` does not propagate through\n * `.optional()` / `.nullable()` / `.default()`, which is how the CLI reads it too.\n */\nfunction isDeprecatedSchema(schema: z.ZodSchema): boolean {\n let current: z.ZodSchema | undefined = schema;\n while (current) {\n const meta = (\n current as unknown as {\n meta?: () => { deprecated?: boolean } | undefined;\n }\n ).meta?.();\n if (meta?.deprecated) return true;\n current = getZodDef(current)?.innerType;\n }\n return false;\n}\n\n/**\n * Gets the description from a Zod schema (description is on the schema object, not the def)\n */\nfunction getDescription(schema?: z.ZodSchema): string | undefined {\n if (!schema) return undefined;\n return descriptionFor(schema as ZodSchemaWithDescription);\n}\n\n/**\n * Put the resolved description where clients read it: the property level.\n *\n * Wrapper branches return the inner conversion, which drops the text declared\n * on the wrapper; and for a nullable union the inner conversion is nested\n * under `anyOf`, leaving its description a level below where any client looks.\n * Both are repaired by writing the resolved text onto the result and clearing\n * the copy the nesting stranded.\n */\nfunction withDescription(\n result: McpSchema,\n description: string | undefined,\n): McpSchema {\n if (!description) return result;\n const anyOf = result.anyOf?.map((branch) => {\n if (branch.description !== description) return branch;\n const { description: _stranded, ...rest } = branch;\n return rest;\n });\n return { ...result, ...(anyOf ? { anyOf } : {}), description };\n}\n\n/**\n * Converts a Zod schema to MCP-compatible JSON Schema format.\n *\n * This function handles the conversion of Zod validation schemas (used internally\n * by the Zapier SDK) to JSON Schema format required by the MCP protocol. It supports\n * most common Zod types including objects, arrays, primitives, enums, unions, and more.\n *\n * @param zodSchema - The Zod schema to convert\n * @returns An MCP-compatible JSON Schema object\n *\n * @example\n * ```typescript\n * import { z } from \"zod\";\n *\n * const userSchema = z.object({\n * name: z.string(),\n * age: z.number().optional(),\n * email: z.string().email()\n * });\n *\n * const mcpSchema = convertZodToMcpSchema(userSchema);\n * // Result: { type: \"object\", properties: { ... }, required: [\"name\", \"email\"] }\n * ```\n */\nfunction convertZodToMcpSchema(zodSchema: z.ZodSchema): McpSchema {\n const def = getZodDef(zodSchema);\n if (!def) {\n // Fallback for schemas without _zod.def (e.g., custom or invalid schemas)\n return {\n type: \"string\",\n description: \"Unsupported schema type\",\n };\n }\n return convertZodType(def, zodSchema);\n}\n\n/**\n * Internal function that recursively converts Zod type definitions to MCP schema format.\n *\n * This function handles the actual conversion logic for different Zod types by examining\n * the internal type definition and converting it to the appropriate JSON Schema structure.\n *\n * @param def - The Zod internal definition object\n * @param schema - The original Zod schema (used for accessing shape in objects)\n * @returns An MCP-compatible JSON Schema object\n * @internal\n */\nfunction convertZodType(def: ZodDef, schema?: z.ZodSchema): McpSchema {\n const description = getDescription(schema);\n\n // Handle object\n if (def.type === \"object\" && schema) {\n const schemaWithShape = schema as ZodSchemaWithShape;\n const properties: Record<string, McpSchema> = {};\n const required: string[] = [];\n\n if (schemaWithShape.shape) {\n for (const [key, value] of Object.entries(schemaWithShape.shape)) {\n if (isDeprecatedSchema(value)) continue;\n const fieldDef = getZodDef(value);\n if (fieldDef) {\n properties[key] = convertZodType(fieldDef, value);\n\n // Check if field is required (not optional or nullable)\n if (fieldDef.type !== \"optional\" && fieldDef.type !== \"nullable\") {\n required.push(key);\n }\n }\n }\n }\n\n const result: McpSchema = {\n type: \"object\",\n properties,\n };\n\n if (description) result.description = description;\n if (required.length > 0) result.required = required;\n\n return result;\n }\n\n // Handle string\n if (def.type === \"string\") {\n const result: McpSchema = { type: \"string\" };\n if (description) result.description = description;\n return result;\n }\n\n // Handle number\n if (def.type === \"number\") {\n const result: McpSchema = { type: \"number\" };\n if (description) result.description = description;\n return result;\n }\n\n // Handle boolean\n if (def.type === \"boolean\") {\n const result: McpSchema = { type: \"boolean\" };\n if (description) result.description = description;\n return result;\n }\n\n // Handle array\n if (def.type === \"array\" && def.element) {\n const elementDef = getZodDef(def.element);\n const result: McpSchema = {\n type: \"array\",\n items: elementDef\n ? convertZodType(elementDef, def.element)\n : { type: \"string\" },\n };\n if (description) result.description = description;\n return result;\n }\n\n // Handle optional\n if (def.type === \"optional\" && def.innerType) {\n const innerDef = getZodDef(def.innerType);\n if (innerDef) {\n return withDescription(\n convertZodType(innerDef, def.innerType),\n description,\n );\n }\n }\n\n // Handle nullable\n if (def.type === \"nullable\" && def.innerType) {\n const innerDef = getZodDef(def.innerType);\n if (innerDef) {\n const innerSchema = convertZodType(innerDef, def.innerType);\n if (innerSchema.type !== undefined) {\n return withDescription(\n {\n ...innerSchema,\n type: Array.isArray(innerSchema.type)\n ? [...innerSchema.type, \"null\"]\n : [innerSchema.type, \"null\"],\n },\n description ?? innerSchema.description,\n );\n }\n return withDescription(\n { anyOf: [innerSchema, { type: \"null\" }] },\n description ?? innerSchema.description,\n );\n }\n }\n\n // Handle enum\n if (def.type === \"enum\" && def.entries) {\n const result: McpSchema = {\n type: \"string\",\n enum: Object.keys(def.entries),\n };\n if (description) result.description = description;\n return result;\n }\n\n // Handle union\n if (def.type === \"union\" && def.options) {\n const result: McpSchema = {\n oneOf: def.options\n .map((option) => {\n const optionDef = getZodDef(option);\n return optionDef ? convertZodType(optionDef, option) : null;\n })\n .filter((s): s is McpSchema => s !== null),\n };\n if (description) result.description = description;\n return result;\n }\n\n // Handle intersection\n if (def.type === \"intersection\" && def.left && def.right) {\n const leftDef = getZodDef(def.left);\n const rightDef = getZodDef(def.right);\n const result: McpSchema = {\n allOf: [\n leftDef ? convertZodType(leftDef, def.left) : { type: \"string\" },\n rightDef ? convertZodType(rightDef, def.right) : { type: \"string\" },\n ],\n };\n if (description) result.description = description;\n return result;\n }\n\n // Handle literal\n if (def.type === \"literal\" && def.values && def.values.length > 0) {\n const value = def.values[0];\n const result: McpSchema = {\n type: typeof value as \"string\" | \"number\" | \"boolean\",\n enum: [value],\n };\n if (description) result.description = description;\n return result;\n }\n\n // Handle record\n if (def.type === \"record\") {\n let additionalProperties: McpSchema | boolean = true;\n if (def.valueType) {\n const valueDef = getZodDef(def.valueType);\n if (valueDef) {\n additionalProperties = convertZodType(valueDef, def.valueType);\n }\n }\n const result: McpSchema = {\n type: \"object\",\n additionalProperties,\n };\n if (description) result.description = description;\n return result;\n }\n\n // Handle any\n if (def.type === \"any\") {\n const result: McpSchema = {};\n if (description) result.description = description;\n return result;\n }\n\n // Handle unknown\n if (def.type === \"unknown\") {\n const result: McpSchema = {};\n if (description) result.description = description;\n return result;\n }\n\n // Handle date\n if (def.type === \"date\") {\n return {\n type: \"string\",\n format: \"date-time\",\n description: description || \"ISO 8601 date-time string\",\n };\n }\n\n // Handle bigint\n if (def.type === \"bigint\") {\n return {\n type: \"string\",\n description: description || \"BigInt as string\",\n };\n }\n\n // Handle undefined\n if (def.type === \"undefined\") {\n return {\n type: \"null\",\n description: description || \"Undefined value\",\n };\n }\n\n // Handle null\n if (def.type === \"null\") {\n return {\n type: \"null\",\n description: description || \"Null value\",\n };\n }\n\n // Handle void\n if (def.type === \"void\") {\n return {\n type: \"null\",\n description: description || \"Void (null) value\",\n };\n }\n\n // Handle nan\n if (def.type === \"nan\") {\n return {\n type: \"number\",\n description: description || \"Not-a-Number value\",\n };\n }\n\n // Handle default\n if (def.type === \"default\" && def.innerType) {\n const innerDef = getZodDef(def.innerType);\n if (innerDef) {\n return withDescription(\n convertZodType(innerDef, def.innerType),\n description,\n );\n }\n }\n\n // Handle catch (with fallback value)\n if (def.type === \"catch\" && def.innerType) {\n const innerDef = getZodDef(def.innerType);\n if (innerDef) {\n return withDescription(\n convertZodType(innerDef, def.innerType),\n description,\n );\n }\n }\n\n // Fallback for unhandled types\n console.warn(\n `Unhandled Zod type: ${def.type}. Please consider adding support for this type.`,\n );\n return {\n type: \"string\",\n description: description || `Unsupported type: ${def.type}`,\n };\n}\n\nexport { convertZodToMcpSchema };\n","{\n \"name\": \"@zapier/zapier-sdk-mcp\",\n \"version\": \"0.27.7\",\n \"description\": \"MCP server for Zapier SDK\",\n \"main\": \"dist/index.mjs\",\n \"types\": \"dist/index.d.mts\",\n \"exports\": {\n \".\": {\n \"source\": \"./src/index.ts\",\n \"import\": {\n \"types\": \"./dist/index.d.mts\",\n \"default\": \"./dist/index.mjs\"\n },\n \"default\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"build\": \"tsup\",\n \"clean\": \"rm -rf dist\",\n \"rebuild\": \"pnpm clean && pnpm build\",\n \"dev\": \"tsup --watch\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest\",\n \"test:run\": \"vitest run\",\n \"prepublishOnly\": \"node ../../scripts/check-version.js\"\n },\n \"keywords\": [\n \"zapier\",\n \"sdk\",\n \"mcp\",\n \"model-context-protocol\"\n ],\n \"author\": \"\",\n \"license\": \"SEE LICENSE IN LICENSE\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://gitlab.com/zapier/zapier-sdk/zapier-sdk.git\",\n \"directory\": \"packages/zapier-sdk-mcp\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"dependencies\": {\n \"@modelcontextprotocol/sdk\": \"^1.17.3\",\n \"@zapier/zapier-sdk\": \"workspace:*\",\n \"zod\": \"4.3.6\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^20.0.0\",\n \"tsup\": \"^8.0.0\",\n \"typescript\": \"^5.0.0\",\n \"vitest\": \"^4.1.4\"\n },\n \"files\": [\n \"dist\",\n \"README.md\",\n \"CHANGELOG.md\"\n ]\n}\n"],"mappings":";AAAA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAMA;AAAA,EACA;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MAAM;AACrB,cAAQ;AAAA,IACV;AAIA,YAAQ,KAAK,UAAU,OAAO;AAC9B,YAAQ,KAAK,WAAW,OAAO;AAE/B,WAAO,QAAQ,SAAS,EAAE,MAAM,CAAC,UAAU;AACzC,cAAQ,MAAM,+BAA+B,KAAK;AAClD,cAAQ,KAAK,CAAC;AAAA,IAChB,CAAC;AAAA,EACH,CAAC;AACH;","names":["name"]}
1
+ {"version":3,"sources":["../src/index.ts","../src/utils/schema-converter.ts","../package.json"],"sourcesContent":["import { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n type CallToolRequest,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport {\n addPlugin,\n applyStabilityLabel,\n createSdk,\n SDK_OPTIONS_ID,\n CORE_OPTIONS_ID,\n zapierCoreOptions,\n DEPRECATION_NOTICE_EVENT,\n zapierSdkPlugin,\n runWithCallerContext,\n isZapierApprovalError,\n type ZapierSdkOptions,\n type ZapierSdk,\n type FunctionRegistryEntry,\n // The free reader, not `zapierSdk.getRegistry()`: the accessor is a\n // re-exportable built-in, so an SDK is free not to surface it.\n getRegistry,\n logDeprecation,\n formatExtensionPluginFailure,\n type Plugin,\n type StabilityLevel,\n} from \"@zapier/zapier-sdk\";\nimport { zapierBetaSdkPlugin } from \"@zapier/zapier-sdk/beta\";\nimport { zapierExperimentalSdkPlugin } from \"@zapier/zapier-sdk/experimental\";\nimport { convertZodToMcpSchema } from \"./utils/schema-converter.js\";\nimport packageJson from \"../package.json\" with { type: \"json\" };\n\ninterface ZapierMcpServerOptions {\n debug?: boolean;\n /**\n * Forwarded to the underlying SDK so a CLI invocation like\n * `zapier-sdk --max-concurrent-requests 50 mcp` actually constrains\n * the MCP server's tool calls. Undefined falls through to the SDK's\n * own resolution chain (option > env var > default).\n */\n maxConcurrentRequests?: number;\n /**\n * Extra plugins to layer onto the SDK before exposing it as MCP tools.\n * Used by the CLI's `mcp` command to forward extensions discovered via\n * the `ZAPIER_SDK_EXTENSIONS` env var. Standalone callers can omit this;\n * the server then uses a vanilla public SDK. Each is forwarded to\n * `addPlugin`, so each must be a descriptor from a `define*` factory.\n */\n extensions?: readonly Plugin[];\n /**\n * Which stability tier of the SDK to build the server against:\n * `\"beta\"` uses `@zapier/zapier-sdk/beta`, `\"experimental\"` uses\n * `@zapier/zapier-sdk/experimental`, so that tier's plugins appear as\n * MCP tools. Mirrors the CLI's `--stability <level>` opt-in: a default\n * invocation only ever sees stable plugins.\n */\n stability?: StabilityLevel;\n /**\n * @deprecated Use `stability: \"experimental\"` instead. `true` selects\n * the experimental tier when `stability` is not set.\n */\n experimental?: boolean;\n}\n\n/**\n * Creates an MCP server that exposes Zapier SDK functions as MCP tools.\n *\n * The server automatically discovers all available SDK functions and converts\n * their Zod schemas to MCP-compatible JSON schemas. It handles tool execution\n * by validating inputs and calling the appropriate SDK functions.\n *\n * @param options - Configuration options for the MCP server\n * @param options.debug - Enable debug logging for detailed error information\n * @returns An MCP server instance configured to expose Zapier SDK tools\n *\n * @example\n * ```typescript\n * const server = createZapierMcpServer({ debug: true });\n * const transport = new StdioServerTransport();\n * await server.connect(transport);\n * ```\n */\nfunction createZapierMcpServer({\n debug = false,\n maxConcurrentRequests,\n extensions = [],\n stability,\n experimental = false,\n}: ZapierMcpServerOptions = {}) {\n // Pick the SDK root by opt-in: each tier's aggregate is a strict superset\n // of the one below it (beta re-exports zapierSdkPlugin plus the beta\n // plugins; experimental re-exports beta), so the registry path used below\n // works the same regardless of root. The deprecated `experimental`\n // boolean only applies when no level is declared.\n let level: StabilityLevel = \"stable\";\n if (stability) {\n level = stability;\n } else if (experimental) {\n // Warn as it resolves, so a host still passing the released boolean\n // learns the replacement. Stderr, which is where the SDK's own notices\n // go and is not part of the stdio protocol stream.\n logDeprecation(\n 'The `experimental` option is deprecated. Use `stability: \"experimental\"` instead.',\n );\n level = \"experimental\";\n }\n const sdkRootPlugin = {\n stable: zapierSdkPlugin,\n beta: zapierBetaSdkPlugin,\n experimental: zapierExperimentalSdkPlugin,\n }[level];\n\n // Active SDK deprecation notices, keyed by notice id. The SDK's own\n // console.warn goes to stderr, which agents never see over stdio — so the\n // server attaches each active notice to every tool result, instructing the\n // agent to relay it to the user. No per-call dedupe: an agent that ignores\n // the block once still surfaces it on a later call. Keying by id keeps a\n // single result from repeating the same notice.\n const activeDeprecationNotices = new Map<string, string>();\n\n const deprecationNoticeContent = () =>\n Array.from(activeDeprecationNotices.values(), (message) => ({\n type: \"text\" as const,\n text: `⚠️ Zapier SDK deprecation notice: ${message} You **must** relay this warning to the user — this will break soon.`,\n }));\n\n const stackOptions: ZapierSdkOptions = {\n debug,\n maxConcurrentRequests,\n eventEmission: { callContext: \"mcp\" },\n callerPackage: { name: packageJson.name, version: packageJson.version },\n approvalMode: \"throw\",\n onEvent: (event) => {\n if (event.type !== DEPRECATION_NOTICE_EVENT) return;\n const { id, message } = event.payload ?? {};\n if (typeof id === \"string\" && typeof message === \"string\") {\n activeDeprecationNotices.set(id, message);\n }\n },\n };\n const zapierSdk: ZapierSdk = createSdk(sdkRootPlugin, {\n configuration: {\n [SDK_OPTIONS_ID]: stackOptions,\n [CORE_OPTIONS_ID]: zapierCoreOptions,\n },\n }) as unknown as ZapierSdk;\n\n // Layer extension plugins on top of the vanilla SDK so their methods show\n // up in `getRegistry({ package: \"mcp\" })` alongside the public surface.\n // Same robustness contract as the CLI: a broken extension warns and\n // skips rather than killing the MCP server. `addPlugin` is atomic\n // (validate-then-apply), so a failed extension leaves the sdk in its\n // prior consistent state.\n for (const ext of extensions) {\n try {\n addPlugin(zapierSdk, ext);\n } catch (err) {\n console.warn(formatExtensionPluginFailure(err));\n }\n }\n\n // Create MCP server\n const server = new Server(\n {\n name: \"zapier-sdk\",\n version: \"1.0.0\",\n },\n {\n capabilities: {\n tools: {},\n },\n },\n );\n\n // Register list_tools handler - dynamically list all SDK functions as tools\n server.setRequestHandler(ListToolsRequestSchema, async () => {\n const tools = getRegistry(zapierSdk, \"mcp\").functions.map(\n (functionInfo: FunctionRegistryEntry) => {\n const toolName = functionInfo.name\n .replace(/([A-Z])/g, \"-$1\")\n .toLowerCase();\n\n const inputSchema = functionInfo.inputSchema;\n const baseDescription =\n functionInfo.description ||\n inputSchema?.description ||\n `Execute ${functionInfo.name}`;\n // Label non-stable tools where an LLM listing them reads first —\n // the front of the description — so it can tell which tier's\n // contract a beta / experimental tool carries. The label follows the\n // plugin's declared level, not the tier the server was built with.\n const description = applyStabilityLabel({\n description: baseDescription,\n stability: functionInfo.stability,\n placement: \"prefix\",\n });\n\n return {\n name: toolName,\n description,\n inputSchema: inputSchema\n ? convertZodToMcpSchema(inputSchema)\n : { type: \"object\", properties: {} },\n };\n },\n );\n\n return { tools };\n });\n\n // Execute SDK functions as tool calls. Kept separate from the registered\n // handler so every return path — success, approval, and error results —\n // flows through the deprecation-notice attachment below.\n const handleToolCall = async (request: CallToolRequest) => {\n const { name, arguments: args } = request.params;\n // Convert kebab-case tool name back to camelCase function name\n const functionName = name.replace(/-([a-z])/g, (_, letter) =>\n letter.toUpperCase(),\n );\n\n // Find the function info\n const functionInfo: FunctionRegistryEntry | undefined = getRegistry(\n zapierSdk,\n \"mcp\",\n ).functions.find(\n (info: FunctionRegistryEntry) => info.name === functionName,\n );\n\n if (!functionInfo) {\n const availableTools = getRegistry(zapierSdk, \"mcp\")\n .functions.map((info) =>\n info.name.replace(/([A-Z])/g, \"-$1\").toLowerCase(),\n )\n .join(\", \");\n throw new Error(\n `Unknown tool: ${name}. Available tools: ${availableTools}`,\n );\n }\n\n try {\n let result: unknown;\n\n if (functionInfo.inputSchema) {\n const validatedArgs = functionInfo.inputSchema.parse(\n args || {},\n ) as Record<string, unknown>;\n const sdkFn = (\n zapierSdk as unknown as Record<\n string,\n (...args: unknown[]) => Promise<unknown>\n >\n )[functionInfo.name];\n // A method with a `positional` projection (fetch's `(url, init)`) takes\n // ordered args, not the single bag; spread the validated object by its\n // positional keys. Everything else is single-object.\n result = functionInfo.positional?.length\n ? await sdkFn(\n ...functionInfo.positional.map((name) => validatedArgs[name]),\n )\n : await sdkFn(validatedArgs);\n } else {\n const sdkFn = (\n zapierSdk as unknown as Record<\n string,\n (...args: unknown[]) => Promise<unknown>\n >\n )[functionInfo.name];\n result = await sdkFn();\n }\n\n return {\n content: [\n {\n type: \"text\",\n text: JSON.stringify(result, null, 2),\n },\n ],\n };\n } catch (error) {\n if (debug) {\n console.error(\n `Error executing function '${functionInfo.name}' (tool: ${name}):`,\n error,\n );\n }\n\n if (isZapierApprovalError(error)) {\n switch (error.approvalStatus) {\n // Pending approval: return the URL so the LLM can instruct the user\n case \"pending\":\n return {\n content: [\n {\n type: \"text\",\n text: `This action requires approval. The end user must open this link in their browser to approve this action, then retry this tool call:\\n\\n${error.approvalUrl}`,\n },\n ],\n isError: false,\n };\n // Policy denied: hard deny, cannot be approved\n case \"policy_denied\":\n return {\n content: [\n {\n type: \"text\",\n text: `This action was denied by policy and cannot be approved:\\n\\n${error.message}`,\n },\n ],\n isError: true,\n };\n }\n }\n\n let errorMessage: string;\n let isValidationError = false;\n\n if (error instanceof Error) {\n // Check if it's a Zod validation error\n if (error.name === \"ZodError\") {\n isValidationError = true;\n errorMessage = `Validation error for ${functionInfo.name}: ${error.message}`;\n } else {\n errorMessage = `Error in ${functionInfo.name}: ${error.message}`;\n }\n } else {\n errorMessage = `Unexpected error in ${functionInfo.name}: ${String(error)}`;\n }\n\n const errorSchema = functionInfo.inputSchema\n ? convertZodToMcpSchema(functionInfo.inputSchema)\n : {};\n\n return {\n content: [\n {\n type: \"text\",\n text: isValidationError\n ? `${errorMessage}\\n\\nExpected input format:\\n${JSON.stringify(errorSchema, null, 2)}`\n : errorMessage,\n },\n ],\n isError: true,\n };\n }\n };\n\n server.setRequestHandler(CallToolRequestSchema, async (request) => {\n const { name } = request.params;\n // Use the external wire name (e.g. \"run-action\"), not the camelCase SDK method.\n return runWithCallerContext({ packageOperation: name }, async () => {\n const result = await handleToolCall(request);\n const notices = deprecationNoticeContent();\n if (notices.length === 0) return result;\n return { ...result, content: [...result.content, ...notices] };\n });\n });\n\n return server;\n}\n\n/**\n * Starts an MCP server with stdio transport for CLI usage.\n *\n * This is the main entry point when running the MCP server from the command line.\n * It creates the server and connects it using stdio transport for communication\n * with MCP clients like Claude Code.\n *\n * @param options - Configuration options for the MCP server\n * @param options.debug - Enable debug logging for detailed error information\n *\n * @example\n * ```typescript\n * // Start server with debug logging\n * await startMcpServer({ debug: true });\n * ```\n */\nasync function startMcpServer(\n options: ZapierMcpServerOptions = {},\n): Promise<void> {\n const server = createZapierMcpServer(options);\n const transport = new StdioServerTransport();\n\n return new Promise<void>((resolve) => {\n let isShuttingDown = false;\n\n const cleanup = async () => {\n if (isShuttingDown) return;\n isShuttingDown = true;\n\n try {\n await server.close();\n } finally {\n resolve();\n }\n };\n\n // Handle clean shutdown when client closes connection\n server.onclose = () => {\n cleanup();\n };\n\n // Handle termination signals (Ctrl+C, kill, etc.)\n // Using process.once() to prevent handler accumulation\n process.once(\"SIGINT\", cleanup);\n process.once(\"SIGTERM\", cleanup);\n\n server.connect(transport).catch((error) => {\n console.error(\"Failed to start MCP server:\", error);\n process.exit(1);\n });\n });\n}\n\nexport { createZapierMcpServer, startMcpServer };\n// Exported so the cross-surface description conformance test can read what\n// `tools/list` would advertise without standing up a server over stdio.\nexport { convertZodToMcpSchema } from \"./utils/schema-converter.js\";\n","/**\n * A robust schema converter that handles conversion from Zod schemas to JSON Schema format:\n *\n * **Core Types:**\n * - ✅ Objects, arrays, strings, numbers, booleans\n * - ✅ Enums, unions, intersections, literals\n * - ✅ Optional and nullable fields\n * - ✅ Records and dates\n * - ✅ Nested schemas and complex types\n *\n * **Additional Types:**\n * - ✅ Any, unknown, bigint, null, undefined, void, NaN\n * - ✅ Default values and catch handlers (unwrapped to inner type)\n * - ✅ Graceful fallback for unsupported types\n */\n\nimport type { z } from \"zod\";\nimport { descriptionFor, isInternalField } from \"@zapier/zapier-sdk\";\n\ninterface McpSchema {\n type?: string | string[];\n properties?: Record<string, McpSchema>;\n required?: string[];\n description?: string;\n items?: McpSchema;\n enum?: unknown[];\n anyOf?: McpSchema[];\n oneOf?: McpSchema[];\n allOf?: McpSchema[];\n additionalProperties?: McpSchema | boolean;\n format?: string;\n}\n\n// Zod internal definition structure\ninterface ZodDef {\n type: string; // e.g., \"string\", \"number\", \"object\", \"optional\", etc.\n element?: z.ZodSchema; // For arrays\n innerType?: z.ZodSchema; // For optional, nullable, default, catch\n entries?: Record<string, string>; // For enums\n values?: unknown[]; // For literals\n options?: z.ZodSchema[]; // For unions\n left?: z.ZodSchema; // For intersections\n right?: z.ZodSchema; // For intersections\n keyType?: z.ZodSchema; // For records (key type)\n valueType?: z.ZodSchema; // For records (value type)\n shape?: Record<string, z.ZodSchema>; // For objects (function in some cases)\n}\n\n// Zod schema with description (description is on the schema, not the def)\ninterface ZodSchemaWithDescription extends z.ZodSchema {\n description?: string;\n}\n\ninterface ZodSchemaWithShape extends z.ZodSchema {\n shape?: Record<string, z.ZodSchema>;\n}\n\n/**\n * Gets the Zod def from a schema, with fallback for edge cases\n */\nfunction getZodDef(schema: z.ZodSchema): ZodDef | undefined {\n const schemaAny = schema as unknown as { _zod?: { def?: ZodDef } };\n return schemaAny._zod?.def;\n}\n\n/**\n * Whether a parameter is marked deprecated and should not be advertised.\n *\n * The CLI hides these from `--help` and the docs generator drops them, but the\n * MCP converter emitted every key in the shape — so `tools/list` advertised\n * deprecated parameters alongside their replacements. On `run-action` that was\n * worse than cosmetic: the sentence stating when a connection is required was\n * attached to the deprecated `connectionId`, so MCP callers were shown the rule\n * on the parameter they should not use and CLI callers were shown it nowhere.\n *\n * Checked at every wrapper level because `.meta()` does not propagate through\n * `.optional()` / `.nullable()` / `.default()`, which is how the CLI reads it too.\n */\nfunction isDeprecatedSchema(schema: z.ZodSchema): boolean {\n let current: z.ZodSchema | undefined = schema;\n while (current) {\n const meta = (\n current as unknown as {\n meta?: () => { deprecated?: boolean } | undefined;\n }\n ).meta?.();\n if (meta?.deprecated) return true;\n current = getZodDef(current)?.innerType;\n }\n return false;\n}\n\n/**\n * Gets the description from a Zod schema (description is on the schema object, not the def)\n */\nfunction getDescription(schema?: z.ZodSchema): string | undefined {\n if (!schema) return undefined;\n return descriptionFor(schema as ZodSchemaWithDescription);\n}\n\n/**\n * Put the resolved description where clients read it: the property level.\n *\n * Wrapper branches return the inner conversion, which drops the text declared\n * on the wrapper; and for a nullable union the inner conversion is nested\n * under `anyOf`, leaving its description a level below where any client looks.\n * Both are repaired by writing the resolved text onto the result and clearing\n * the copy the nesting stranded.\n */\nfunction withDescription(\n result: McpSchema,\n description: string | undefined,\n): McpSchema {\n if (!description) return result;\n const anyOf = result.anyOf?.map((branch) => {\n if (branch.description !== description) return branch;\n const { description: _stranded, ...rest } = branch;\n return rest;\n });\n return { ...result, ...(anyOf ? { anyOf } : {}), description };\n}\n\n/**\n * Converts a Zod schema to MCP-compatible JSON Schema format.\n *\n * This function handles the conversion of Zod validation schemas (used internally\n * by the Zapier SDK) to JSON Schema format required by the MCP protocol. It supports\n * most common Zod types including objects, arrays, primitives, enums, unions, and more.\n *\n * @param zodSchema - The Zod schema to convert\n * @returns An MCP-compatible JSON Schema object\n *\n * @example\n * ```typescript\n * import { z } from \"zod\";\n *\n * const userSchema = z.object({\n * name: z.string(),\n * age: z.number().optional(),\n * email: z.string().email()\n * });\n *\n * const mcpSchema = convertZodToMcpSchema(userSchema);\n * // Result: { type: \"object\", properties: { ... }, required: [\"name\", \"email\"] }\n * ```\n */\nfunction convertZodToMcpSchema(zodSchema: z.ZodSchema): McpSchema {\n const def = getZodDef(zodSchema);\n if (!def) {\n // Fallback for schemas without _zod.def (e.g., custom or invalid schemas)\n return {\n type: \"string\",\n description: \"Unsupported schema type\",\n };\n }\n return convertZodType(def, zodSchema);\n}\n\n/**\n * Internal function that recursively converts Zod type definitions to MCP schema format.\n *\n * This function handles the actual conversion logic for different Zod types by examining\n * the internal type definition and converting it to the appropriate JSON Schema structure.\n *\n * @param def - The Zod internal definition object\n * @param schema - The original Zod schema (used for accessing shape in objects)\n * @returns An MCP-compatible JSON Schema object\n * @internal\n */\nfunction convertZodType(def: ZodDef, schema?: z.ZodSchema): McpSchema {\n const description = getDescription(schema);\n\n // Handle object\n if (def.type === \"object\" && schema) {\n const schemaWithShape = schema as ZodSchemaWithShape;\n const properties: Record<string, McpSchema> = {};\n const required: string[] = [];\n\n if (schemaWithShape.shape) {\n for (const [key, value] of Object.entries(schemaWithShape.shape)) {\n // Deprecated and internal fields are left out of what the model sees\n // but stay in the schema calls are parsed with, so they're still\n // accepted when passed.\n if (isDeprecatedSchema(value) || isInternalField(value)) continue;\n const fieldDef = getZodDef(value);\n if (fieldDef) {\n properties[key] = convertZodType(fieldDef, value);\n\n // Check if field is required (not optional or nullable)\n if (fieldDef.type !== \"optional\" && fieldDef.type !== \"nullable\") {\n required.push(key);\n }\n }\n }\n }\n\n const result: McpSchema = {\n type: \"object\",\n properties,\n };\n\n if (description) result.description = description;\n if (required.length > 0) result.required = required;\n\n return result;\n }\n\n // Handle string\n if (def.type === \"string\") {\n const result: McpSchema = { type: \"string\" };\n if (description) result.description = description;\n return result;\n }\n\n // Handle number\n if (def.type === \"number\") {\n const result: McpSchema = { type: \"number\" };\n if (description) result.description = description;\n return result;\n }\n\n // Handle boolean\n if (def.type === \"boolean\") {\n const result: McpSchema = { type: \"boolean\" };\n if (description) result.description = description;\n return result;\n }\n\n // Handle array\n if (def.type === \"array\" && def.element) {\n const elementDef = getZodDef(def.element);\n const result: McpSchema = {\n type: \"array\",\n items: elementDef\n ? convertZodType(elementDef, def.element)\n : { type: \"string\" },\n };\n if (description) result.description = description;\n return result;\n }\n\n // Handle optional\n if (def.type === \"optional\" && def.innerType) {\n const innerDef = getZodDef(def.innerType);\n if (innerDef) {\n return withDescription(\n convertZodType(innerDef, def.innerType),\n description,\n );\n }\n }\n\n // Handle nullable\n if (def.type === \"nullable\" && def.innerType) {\n const innerDef = getZodDef(def.innerType);\n if (innerDef) {\n const innerSchema = convertZodType(innerDef, def.innerType);\n if (innerSchema.type !== undefined) {\n return withDescription(\n {\n ...innerSchema,\n type: Array.isArray(innerSchema.type)\n ? [...innerSchema.type, \"null\"]\n : [innerSchema.type, \"null\"],\n },\n description ?? innerSchema.description,\n );\n }\n return withDescription(\n { anyOf: [innerSchema, { type: \"null\" }] },\n description ?? innerSchema.description,\n );\n }\n }\n\n // Handle enum\n if (def.type === \"enum\" && def.entries) {\n const result: McpSchema = {\n type: \"string\",\n enum: Object.keys(def.entries),\n };\n if (description) result.description = description;\n return result;\n }\n\n // Handle union\n if (def.type === \"union\" && def.options) {\n const result: McpSchema = {\n oneOf: def.options\n .map((option) => {\n const optionDef = getZodDef(option);\n return optionDef ? convertZodType(optionDef, option) : null;\n })\n .filter((s): s is McpSchema => s !== null),\n };\n if (description) result.description = description;\n return result;\n }\n\n // Handle intersection\n if (def.type === \"intersection\" && def.left && def.right) {\n const leftDef = getZodDef(def.left);\n const rightDef = getZodDef(def.right);\n const result: McpSchema = {\n allOf: [\n leftDef ? convertZodType(leftDef, def.left) : { type: \"string\" },\n rightDef ? convertZodType(rightDef, def.right) : { type: \"string\" },\n ],\n };\n if (description) result.description = description;\n return result;\n }\n\n // Handle literal\n if (def.type === \"literal\" && def.values && def.values.length > 0) {\n const value = def.values[0];\n const result: McpSchema = {\n type: typeof value as \"string\" | \"number\" | \"boolean\",\n enum: [value],\n };\n if (description) result.description = description;\n return result;\n }\n\n // Handle record\n if (def.type === \"record\") {\n let additionalProperties: McpSchema | boolean = true;\n if (def.valueType) {\n const valueDef = getZodDef(def.valueType);\n if (valueDef) {\n additionalProperties = convertZodType(valueDef, def.valueType);\n }\n }\n const result: McpSchema = {\n type: \"object\",\n additionalProperties,\n };\n if (description) result.description = description;\n return result;\n }\n\n // Handle any\n if (def.type === \"any\") {\n const result: McpSchema = {};\n if (description) result.description = description;\n return result;\n }\n\n // Handle unknown\n if (def.type === \"unknown\") {\n const result: McpSchema = {};\n if (description) result.description = description;\n return result;\n }\n\n // Handle date\n if (def.type === \"date\") {\n return {\n type: \"string\",\n format: \"date-time\",\n description: description || \"ISO 8601 date-time string\",\n };\n }\n\n // Handle bigint\n if (def.type === \"bigint\") {\n return {\n type: \"string\",\n description: description || \"BigInt as string\",\n };\n }\n\n // Handle undefined\n if (def.type === \"undefined\") {\n return {\n type: \"null\",\n description: description || \"Undefined value\",\n };\n }\n\n // Handle null\n if (def.type === \"null\") {\n return {\n type: \"null\",\n description: description || \"Null value\",\n };\n }\n\n // Handle void\n if (def.type === \"void\") {\n return {\n type: \"null\",\n description: description || \"Void (null) value\",\n };\n }\n\n // Handle nan\n if (def.type === \"nan\") {\n return {\n type: \"number\",\n description: description || \"Not-a-Number value\",\n };\n }\n\n // Handle default\n if (def.type === \"default\" && def.innerType) {\n const innerDef = getZodDef(def.innerType);\n if (innerDef) {\n return withDescription(\n convertZodType(innerDef, def.innerType),\n description,\n );\n }\n }\n\n // Handle catch (with fallback value)\n if (def.type === \"catch\" && def.innerType) {\n const innerDef = getZodDef(def.innerType);\n if (innerDef) {\n return withDescription(\n convertZodType(innerDef, def.innerType),\n description,\n );\n }\n }\n\n // Fallback for unhandled types\n console.warn(\n `Unhandled Zod type: ${def.type}. Please consider adding support for this type.`,\n );\n return {\n type: \"string\",\n description: description || `Unsupported type: ${def.type}`,\n };\n}\n\nexport { convertZodToMcpSchema };\n","{\n \"name\": \"@zapier/zapier-sdk-mcp\",\n \"version\": \"0.27.9\",\n \"description\": \"MCP server for Zapier SDK\",\n \"main\": \"dist/index.mjs\",\n \"types\": \"dist/index.d.mts\",\n \"exports\": {\n \".\": {\n \"source\": \"./src/index.ts\",\n \"import\": {\n \"types\": \"./dist/index.d.mts\",\n \"default\": \"./dist/index.mjs\"\n },\n \"default\": \"./dist/index.mjs\"\n }\n },\n \"scripts\": {\n \"build\": \"tsup\",\n \"clean\": \"rm -rf dist\",\n \"rebuild\": \"pnpm clean && pnpm build\",\n \"dev\": \"tsup --watch\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest\",\n \"test:run\": \"vitest run\",\n \"prepublishOnly\": \"node ../../scripts/check-version.js\"\n },\n \"keywords\": [\n \"zapier\",\n \"sdk\",\n \"mcp\",\n \"model-context-protocol\"\n ],\n \"author\": \"\",\n \"license\": \"SEE LICENSE IN LICENSE\",\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"https://gitlab.com/zapier/zapier-sdk/zapier-sdk.git\",\n \"directory\": \"packages/zapier-sdk-mcp\"\n },\n \"publishConfig\": {\n \"access\": \"public\"\n },\n \"dependencies\": {\n \"@modelcontextprotocol/sdk\": \"^1.17.3\",\n \"@zapier/zapier-sdk\": \"workspace:*\",\n \"zod\": \"4.3.6\"\n },\n \"devDependencies\": {\n \"@types/node\": \"^20.0.0\",\n \"tsup\": \"^8.0.0\",\n \"typescript\": \"^5.0.0\",\n \"vitest\": \"^4.1.4\"\n },\n \"files\": [\n \"dist\",\n \"README.md\",\n \"CHANGELOG.md\"\n ]\n}\n"],"mappings":";AAAA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OAEK;AACP;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EAMA;AAAA,EACA;AAAA,EACA;AAAA,OAGK;AACP,SAAS,2BAA2B;AACpC,SAAS,mCAAmC;;;ACb5C,SAAS,gBAAgB,uBAAuB;AA2ChD,SAAS,UAAU,QAAyC;AAC1D,QAAM,YAAY;AAClB,SAAO,UAAU,MAAM;AACzB;AAeA,SAAS,mBAAmB,QAA8B;AACxD,MAAI,UAAmC;AACvC,SAAO,SAAS;AACd,UAAM,OACJ,QAGA,OAAO;AACT,QAAI,MAAM,WAAY,QAAO;AAC7B,cAAU,UAAU,OAAO,GAAG;AAAA,EA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AAiB;AAEjB,UAAI;AACF,cAAM,OAAO,MAAM;AAAA,MACrB,UAAE;AACA,gBAAQ;AAAA,MACV;AAAA,IACF;AAGA,WAAO,UAAU,MAAM;AACrB,cAAQ;AAAA,IACV;AAIA,YAAQ,KAAK,UAAU,OAAO;AAC9B,YAAQ,KAAK,WAAW,OAAO;AAE/B,WAAO,QAAQ,SAAS,EAAE,MAAM,CAAC,UAAU;AACzC,cAAQ,MAAM,+BAA+B,KAAK;AAClD,cAAQ,KAAK,CAAC;AAAA,IAChB,CAAC;AAAA,EACH,CAAC;AACH;","names":["name"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zapier/zapier-sdk-mcp",
3
- "version": "0.27.7",
3
+ "version": "0.27.9",
4
4
  "description": "MCP server for Zapier SDK",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.mts",
@@ -33,7 +33,7 @@
33
33
  "dependencies": {
34
34
  "@modelcontextprotocol/sdk": "^1.17.3",
35
35
  "zod": "4.3.6",
36
- "@zapier/zapier-sdk": "0.115.1"
36
+ "@zapier/zapier-sdk": "0.116.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^20.0.0",