@zapier/zapier-sdk-mcp 0.1.3 → 0.2.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/README.md +30 -22
- package/dist/index.mjs +13 -13
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -122,22 +122,24 @@ pnpm test
|
|
|
122
122
|
- [Usage](#usage)
|
|
123
123
|
- [Available Tools](#available-tools)
|
|
124
124
|
- [Actions](#actions)
|
|
125
|
-
- [`listActions`](#listactions)
|
|
126
125
|
- [`getAction`](#getaction)
|
|
126
|
+
- [`listActions`](#listactions)
|
|
127
127
|
- [`listInputFields`](#listinputfields)
|
|
128
128
|
- [`runAction`](#runaction)
|
|
129
129
|
- [Apps](#apps)
|
|
130
|
-
- [`listApps`](#listapps)
|
|
131
130
|
- [`getApp`](#getapp)
|
|
132
|
-
- [
|
|
133
|
-
|
|
134
|
-
- [`getAuthentication`](#getauthentication)
|
|
131
|
+
- [`listApps`](#listapps)
|
|
132
|
+
- [Authentications](#authentications)
|
|
135
133
|
- [`findFirstAuthentication`](#findfirstauthentication)
|
|
136
134
|
- [`findUniqueAuthentication`](#finduniqueauthentication)
|
|
135
|
+
- [`getAuthentication`](#getauthentication)
|
|
136
|
+
- [`listAuthentications`](#listauthentications)
|
|
137
137
|
- [HTTP Requests](#http-requests)
|
|
138
138
|
- [`request`](#request)
|
|
139
|
-
- [
|
|
139
|
+
- [Users](#users)
|
|
140
140
|
- [`getProfile`](#getprofile)
|
|
141
|
+
- [Utilities](#utilities)
|
|
142
|
+
- [`lockVersion`](#lockversion)
|
|
141
143
|
|
|
142
144
|
## Installation
|
|
143
145
|
|
|
@@ -174,14 +176,14 @@ All SDK functions are automatically exposed as MCP tools using kebab-case naming
|
|
|
174
176
|
|
|
175
177
|
### Actions
|
|
176
178
|
|
|
177
|
-
#### `list-actions`
|
|
178
|
-
|
|
179
|
-
List all actions for a specific app
|
|
180
|
-
|
|
181
179
|
#### `get-action`
|
|
182
180
|
|
|
183
181
|
Get detailed information about a specific action
|
|
184
182
|
|
|
183
|
+
#### `list-actions`
|
|
184
|
+
|
|
185
|
+
List all actions for a specific app
|
|
186
|
+
|
|
185
187
|
#### `list-input-fields`
|
|
186
188
|
|
|
187
189
|
Get the input fields required for a specific action
|
|
@@ -192,23 +194,15 @@ Execute an action with the given inputs
|
|
|
192
194
|
|
|
193
195
|
### Apps
|
|
194
196
|
|
|
195
|
-
#### `list-apps`
|
|
196
|
-
|
|
197
|
-
List all available apps with optional filtering
|
|
198
|
-
|
|
199
197
|
#### `get-app`
|
|
200
198
|
|
|
201
199
|
Get detailed information about a specific app
|
|
202
200
|
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
#### `list-authentications`
|
|
206
|
-
|
|
207
|
-
List available authentications with optional filtering
|
|
201
|
+
#### `list-apps`
|
|
208
202
|
|
|
209
|
-
|
|
203
|
+
List all available apps with optional filtering
|
|
210
204
|
|
|
211
|
-
|
|
205
|
+
### Authentications
|
|
212
206
|
|
|
213
207
|
#### `find-first-authentication`
|
|
214
208
|
|
|
@@ -218,16 +212,30 @@ Find the first authentication matching the criteria
|
|
|
218
212
|
|
|
219
213
|
Find a unique authentication matching the criteria
|
|
220
214
|
|
|
215
|
+
#### `get-authentication`
|
|
216
|
+
|
|
217
|
+
Get a specific authentication by ID
|
|
218
|
+
|
|
219
|
+
#### `list-authentications`
|
|
220
|
+
|
|
221
|
+
List available authentications with optional filtering
|
|
222
|
+
|
|
221
223
|
### HTTP Requests
|
|
222
224
|
|
|
223
225
|
#### `request`
|
|
224
226
|
|
|
225
227
|
Make authenticated HTTP requests through Zapier's Relay service
|
|
226
228
|
|
|
227
|
-
###
|
|
229
|
+
### Users
|
|
228
230
|
|
|
229
231
|
#### `get-profile`
|
|
230
232
|
|
|
231
233
|
Get current user's profile information
|
|
232
234
|
|
|
235
|
+
### Utilities
|
|
236
|
+
|
|
237
|
+
#### `lock-version`
|
|
238
|
+
|
|
239
|
+
Execute lockVersion
|
|
240
|
+
|
|
233
241
|
<!-- End Generated MCP Tools Reference -->
|
package/dist/index.mjs
CHANGED
|
@@ -217,16 +217,14 @@ function createZapierMcpServer({ debug = false } = {}) {
|
|
|
217
217
|
}
|
|
218
218
|
);
|
|
219
219
|
server.setRequestHandler(ListToolsRequestSchema, async () => {
|
|
220
|
-
const tools = zapierSdk.
|
|
221
|
-
(
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
}
|
|
229
|
-
);
|
|
220
|
+
const tools = zapierSdk.getRegistry().functions.map((functionInfo) => {
|
|
221
|
+
const toolName = functionInfo.name.replace(/([A-Z])/g, "-$1").toLowerCase();
|
|
222
|
+
return {
|
|
223
|
+
name: toolName,
|
|
224
|
+
description: functionInfo.inputSchema.description || `Execute ${functionInfo.name}`,
|
|
225
|
+
inputSchema: convertZodToMcpSchema(functionInfo.inputSchema)
|
|
226
|
+
};
|
|
227
|
+
});
|
|
230
228
|
return { tools };
|
|
231
229
|
});
|
|
232
230
|
server.setRequestHandler(CallToolRequestSchema, async (request) => {
|
|
@@ -235,18 +233,20 @@ function createZapierMcpServer({ debug = false } = {}) {
|
|
|
235
233
|
/-([a-z])/g,
|
|
236
234
|
(_, letter) => letter.toUpperCase()
|
|
237
235
|
);
|
|
238
|
-
const functionInfo = zapierSdk.
|
|
236
|
+
const functionInfo = zapierSdk.getRegistry().functions.find(
|
|
239
237
|
(info) => info.name === functionName
|
|
240
238
|
);
|
|
241
239
|
if (!functionInfo) {
|
|
242
|
-
const availableTools = zapierSdk.
|
|
240
|
+
const availableTools = zapierSdk.getRegistry().functions.map(
|
|
241
|
+
(info) => info.name.replace(/([A-Z])/g, "-$1").toLowerCase()
|
|
242
|
+
).join(", ");
|
|
243
243
|
throw new Error(
|
|
244
244
|
`Unknown tool: ${name}. Available tools: ${availableTools}`
|
|
245
245
|
);
|
|
246
246
|
}
|
|
247
247
|
try {
|
|
248
248
|
const validatedArgs = functionInfo.inputSchema.parse(args || {});
|
|
249
|
-
const result = await functionInfo.
|
|
249
|
+
const result = await zapierSdk[functionInfo.name](validatedArgs);
|
|
250
250
|
return {
|
|
251
251
|
content: [
|
|
252
252
|
{
|
package/dist/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts","../src/utils/schema-converter.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport {\n createZapierSdk,\n type ZapierSdk,\n type FunctionRegistryEntry,\n} from \"@zapier/zapier-sdk\";\nimport { convertZodToMcpSchema } from \"./utils/schema-converter.js\";\nimport { spawn } from \"child_process\";\nimport { existsSync } from \"fs\";\nimport { createRequire } from \"module\";\n\ninterface ZapierMcpServerOptions {\n debug?: 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({ debug = false }: ZapierMcpServerOptions = {}) {\n // Create Zapier SDK instance\n const zapierSdk: ZapierSdk = createZapierSdk({ debug });\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 = zapierSdk.__registry.map(\n (functionInfo: FunctionRegistryEntry) => {\n const toolName = functionInfo.name\n .replace(/([A-Z])/g, \"-$1\")\n .toLowerCase();\n\n return {\n name: toolName,\n description:\n functionInfo.inputSchema.description ||\n `Execute ${functionInfo.name}`,\n inputSchema: convertZodToMcpSchema(functionInfo.inputSchema),\n };\n },\n );\n\n return { tools };\n });\n\n // Register call_tool handler - execute SDK functions\n server.setRequestHandler(CallToolRequestSchema, async (request) => {\n const { name, arguments: args } = request.params;\n\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 =\n zapierSdk.__registry.find(\n (info: FunctionRegistryEntry) => info.name === functionName,\n );\n\n if (!functionInfo) {\n const availableTools = zapierSdk.__registry\n .map((info) => info.name.replace(/([A-Z])/g, \"-$1\").toLowerCase())\n .join(\", \");\n throw new Error(\n `Unknown tool: ${name}. Available tools: ${availableTools}`,\n );\n }\n\n try {\n // Validate arguments against schema\n const validatedArgs = functionInfo.inputSchema.parse(args || {});\n\n // Execute the function\n const result = await functionInfo.implementation(validatedArgs);\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 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 return {\n content: [\n {\n type: \"text\",\n text: isValidationError\n ? `${errorMessage}\\n\\nExpected input format:\\n${JSON.stringify(convertZodToMcpSchema(functionInfo.inputSchema), null, 2)}`\n : errorMessage,\n },\n ],\n isError: true,\n };\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(options: ZapierMcpServerOptions = {}) {\n const server = createZapierMcpServer(options);\n const transport = new StdioServerTransport();\n await server.connect(transport);\n}\n\n// Auto-start if this file is run directly\nif (import.meta.url === `file://${process.argv[1]}`) {\n const debug = process.argv.includes(\"--debug\");\n startMcpServer({ debug }).catch((error) => {\n console.error(\"Failed to start MCP server:\", error);\n process.exit(1);\n });\n}\n\n/**\n * Starts the MCP server as a child process with process lifecycle management.\n *\n * This function handles spawning the MCP server as a separate Node.js process,\n * managing its lifecycle, and providing graceful shutdown handling. It's designed\n * to be called from CLI tools that need to start the MCP server.\n *\n * @param options - Configuration options for the MCP server process\n * @param options.debug - Enable debug logging\n * @param options.port - Port to listen on (for future HTTP transport)\n */\nasync function startMcpServerAsProcess(\n options: {\n debug?: boolean;\n port?: string;\n } = {},\n) {\n try {\n // Resolve our own executable path using Node.js module resolution\n const require = createRequire(import.meta.url);\n let mcpServerPath: string;\n\n try {\n // Try to resolve the built executable first\n mcpServerPath = require.resolve(\"@zapier/zapier-sdk-mcp/dist/index.mjs\");\n } catch {\n // Fallback to package main entry\n mcpServerPath = require.resolve(\"@zapier/zapier-sdk-mcp\");\n }\n\n // Validate that the executable exists\n if (!existsSync(mcpServerPath)) {\n console.error(`MCP server executable not found at: ${mcpServerPath}`);\n console.error(\"Please run 'pnpm build' to build the MCP server package.\");\n process.exit(1);\n }\n\n // Prepare arguments\n const args: string[] = [];\n if (options.debug) {\n args.push(\"--debug\");\n }\n if (options.port) {\n args.push(\"--port\", options.port);\n }\n\n // Start the MCP server as a child process\n const mcpProcess = spawn(\"node\", [mcpServerPath, ...args], {\n stdio: \"inherit\",\n cwd: process.cwd(),\n });\n\n // Handle process events\n mcpProcess.on(\"error\", (error) => {\n console.error(\"Failed to start MCP server:\", error.message);\n process.exit(1);\n });\n\n mcpProcess.on(\"exit\", (code, signal) => {\n if (signal) {\n console.log(`MCP server terminated by signal: ${signal}`);\n } else if (code !== 0) {\n console.error(`MCP server exited with code: ${code}`);\n process.exit(code);\n } else {\n console.log(\"MCP server stopped gracefully\");\n }\n });\n\n // Handle graceful shutdown\n const shutdown = (signal: NodeJS.Signals) => {\n console.log(`\\nReceived ${signal}, shutting down MCP server...`);\n mcpProcess.kill(signal);\n };\n\n process.on(\"SIGINT\", () => shutdown(\"SIGINT\"));\n process.on(\"SIGTERM\", () => shutdown(\"SIGTERM\"));\n } catch (error) {\n console.error(\"Error starting MCP server:\", error);\n process.exit(1);\n }\n}\n\nexport { createZapierMcpServer, startMcpServer, startMcpServerAsProcess };\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 { z } from \"zod\";\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// Types for Zod internals to improve type safety\ninterface ZodDef {\n typeName: string;\n description?: string;\n type?: z.ZodSchema;\n innerType?: z.ZodSchema;\n values?: readonly string[];\n options?: z.ZodSchema[];\n left?: z.ZodSchema;\n right?: z.ZodSchema;\n value?: unknown;\n valueType?: z.ZodSchema;\n}\n\ninterface ZodSchemaWithShape extends z.ZodSchema {\n shape?: Record<string, z.ZodSchema>;\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 return convertZodType(\n (zodSchema as unknown as { _def: ZodDef })._def,\n zodSchema,\n );\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 // Handle ZodObject\n if (def.typeName === \"ZodObject\" && 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 const fieldDef = (value as unknown as { _def: ZodDef })._def;\n properties[key] = convertZodType(fieldDef, value);\n\n // Check if field is required (not optional)\n if (\n fieldDef.typeName !== \"ZodOptional\" &&\n fieldDef.typeName !== \"ZodNullable\"\n ) {\n required.push(key);\n }\n }\n }\n\n const result: McpSchema = {\n type: \"object\",\n properties,\n description: def.description,\n };\n\n if (required.length > 0) {\n result.required = required;\n }\n\n return result;\n }\n\n // Handle ZodString\n if (def.typeName === \"ZodString\") {\n const schema: McpSchema = { type: \"string\" };\n if (def.description) schema.description = def.description;\n return schema;\n }\n\n // Handle ZodNumber\n if (def.typeName === \"ZodNumber\") {\n const schema: McpSchema = { type: \"number\" };\n if (def.description) schema.description = def.description;\n return schema;\n }\n\n // Handle ZodBoolean\n if (def.typeName === \"ZodBoolean\") {\n const schema: McpSchema = { type: \"boolean\" };\n if (def.description) schema.description = def.description;\n return schema;\n }\n\n // Handle ZodArray\n if (def.typeName === \"ZodArray\" && def.type) {\n return {\n type: \"array\",\n items: convertZodType(\n (def.type as unknown as { _def: ZodDef })._def,\n def.type,\n ),\n description: def.description,\n };\n }\n\n // Handle ZodOptional\n if (def.typeName === \"ZodOptional\" && def.innerType) {\n return convertZodType(\n (def.innerType as unknown as { _def: ZodDef })._def,\n def.innerType,\n );\n }\n\n // Handle ZodNullable\n if (def.typeName === \"ZodNullable\" && def.innerType) {\n const innerSchema = convertZodType(\n (def.innerType as unknown as { _def: ZodDef })._def,\n def.innerType,\n );\n return {\n ...innerSchema,\n type: Array.isArray(innerSchema.type)\n ? [...innerSchema.type, \"null\"]\n : [innerSchema.type, \"null\"],\n };\n }\n\n // Handle ZodEnum\n if (def.typeName === \"ZodEnum\" && def.values) {\n return {\n type: \"string\",\n enum: Array.from(def.values),\n description: def.description,\n };\n }\n\n // Handle ZodUnion\n if (def.typeName === \"ZodUnion\" && def.options) {\n return {\n oneOf: def.options.map((option) =>\n convertZodType((option as unknown as { _def: ZodDef })._def, option),\n ),\n description: def.description,\n };\n }\n\n // Handle ZodIntersection\n if (def.typeName === \"ZodIntersection\" && def.left && def.right) {\n return {\n allOf: [\n convertZodType(\n (def.left as unknown as { _def: ZodDef })._def,\n def.left,\n ),\n convertZodType(\n (def.right as unknown as { _def: ZodDef })._def,\n def.right,\n ),\n ],\n description: def.description,\n };\n }\n\n // Handle ZodLiteral\n if (def.typeName === \"ZodLiteral\" && def.value !== undefined) {\n const value = def.value;\n return {\n type: typeof value as \"string\" | \"number\" | \"boolean\",\n enum: [value],\n description: def.description,\n };\n }\n\n // Handle ZodRecord (for object with string keys)\n if (def.typeName === \"ZodRecord\") {\n return {\n type: \"object\",\n additionalProperties: def.valueType\n ? convertZodType(\n (def.valueType as unknown as { _def: ZodDef })._def,\n def.valueType,\n )\n : true,\n description: def.description,\n };\n }\n\n // Handle ZodAny\n if (def.typeName === \"ZodAny\") {\n return {\n description: def.description || \"Any value\",\n };\n }\n\n // Handle ZodUnknown\n if (def.typeName === \"ZodUnknown\") {\n return {\n description: def.description || \"Unknown value\",\n };\n }\n\n // Handle ZodDate\n if (def.typeName === \"ZodDate\") {\n return {\n type: \"string\",\n format: \"date-time\",\n description: def.description || \"ISO 8601 date-time string\",\n };\n }\n\n // Handle ZodBigInt\n if (def.typeName === \"ZodBigInt\") {\n return {\n type: \"string\",\n description: def.description || \"BigInt as string\",\n };\n }\n\n // Handle ZodUndefined\n if (def.typeName === \"ZodUndefined\") {\n return {\n type: \"null\",\n description: def.description || \"Undefined value\",\n };\n }\n\n // Handle ZodNull\n if (def.typeName === \"ZodNull\") {\n return {\n type: \"null\",\n description: def.description || \"Null value\",\n };\n }\n\n // Handle ZodVoid\n if (def.typeName === \"ZodVoid\") {\n return {\n type: \"null\",\n description: def.description || \"Void (null) value\",\n };\n }\n\n // Handle ZodNaN\n if (def.typeName === \"ZodNaN\") {\n return {\n type: \"number\",\n description: def.description || \"Not-a-Number value\",\n };\n }\n\n // Handle ZodDefault\n if (def.typeName === \"ZodDefault\" && def.innerType) {\n return convertZodType(\n (def.innerType as unknown as { _def: ZodDef })._def,\n def.innerType,\n );\n }\n\n // Handle ZodCatch (with fallback value)\n if (def.typeName === \"ZodCatch\" && def.innerType) {\n return convertZodType(\n (def.innerType as unknown as { _def: ZodDef })._def,\n def.innerType,\n );\n }\n\n // Fallback for unhandled types\n console.warn(\n `Unhandled Zod type: ${def.typeName}. Please consider adding support for this type.`,\n );\n return {\n type: \"string\",\n description: def.description || `Unsupported type: ${def.typeName}`,\n };\n}\n\nexport { convertZodToMcpSchema };\n"],"mappings":";;;AAEA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,OAGK;;;AC8DP,SAAS,sBAAsB,WAAmC;AAChE,SAAO;AAAA,IACJ,UAA0C;AAAA,IAC3C;AAAA,EACF;AACF;AAaA,SAAS,eAAe,KAAa,QAAiC;AAEpE,MAAI,IAAI,aAAa,eAAe,QAAQ;AAC1C,UAAM,kBAAkB;AACxB,UAAM,aAAwC,CAAC;AAC/C,UAAM,WAAqB,CAAC;AAE5B,QAAI,gBAAgB,OAAO;AACzB,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,gBAAgB,KAAK,GAAG;AAChE,cAAM,WAAY,MAAsC;AACxD,mBAAW,GAAG,IAAI,eAAe,UAAU,KAAK;AAGhD,YACE,SAAS,aAAa,iBACtB,SAAS,aAAa,eACtB;AACA,mBAAS,KAAK,GAAG;AAAA,QACnB;AAAA,MACF;AAAA,IACF;AAEA,UAAM,SAAoB;AAAA,MACxB,MAAM;AAAA,MACN;AAAA,MACA,aAAa,IAAI;AAAA,IACnB;AAEA,QAAI,SAAS,SAAS,GAAG;AACvB,aAAO,WAAW;AAAA,IACpB;AAEA,WAAO;AAAA,EACT;AAGA,MAAI,IAAI,aAAa,aAAa;AAChC,UAAMA,UAAoB,EAAE,MAAM,SAAS;AAC3C,QAAI,IAAI,YAAa,CAAAA,QAAO,cAAc,IAAI;AAC9C,WAAOA;AAAA,EACT;AAGA,MAAI,IAAI,aAAa,aAAa;AAChC,UAAMA,UAAoB,EAAE,MAAM,SAAS;AAC3C,QAAI,IAAI,YAAa,CAAAA,QAAO,cAAc,IAAI;AAC9C,WAAOA;AAAA,EACT;AAGA,MAAI,IAAI,aA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P,KAAK,QAAQ,IAAI;AAAA,IACnB,CAAC;AAGD,eAAW,GAAG,SAAS,CAAC,UAAU;AAChC,cAAQ,MAAM,+BAA+B,MAAM,OAAO;AAC1D,cAAQ,KAAK,CAAC;AAAA,IAChB,CAAC;AAED,eAAW,GAAG,QAAQ,CAAC,MAAM,WAAW;AACtC,UAAI,QAAQ;AACV,gBAAQ,IAAI,oCAAoC,MAAM,EAAE;AAAA,MAC1D,WAAW,SAAS,GAAG;AACrB,gBAAQ,MAAM,gCAAgC,IAAI,EAAE;AACpD,gBAAQ,KAAK,IAAI;AAAA,MACnB,OAAO;AACL,gBAAQ,IAAI,+BAA+B;AAAA,MAC7C;AAAA,IACF,CAAC;AAGD,UAAM,WAAW,CAAC,WAA2B;AAC3C,cAAQ,IAAI;AAAA,WAAc,MAAM,+BAA+B;AAC/D,iBAAW,KAAK,MAAM;AAAA,IACxB;AAEA,YAAQ,GAAG,UAAU,MAAM,SAAS,QAAQ,CAAC;AAC7C,YAAQ,GAAG,WAAW,MAAM,SAAS,SAAS,CAAC;AAAA,EACjD,SAAS,OAAO;AACd,YAAQ,MAAM,8BAA8B,KAAK;AACjD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;","names":["schema","require"]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts","../src/utils/schema-converter.ts"],"sourcesContent":["#!/usr/bin/env node\n\nimport { Server } from \"@modelcontextprotocol/sdk/server/index.js\";\nimport { StdioServerTransport } from \"@modelcontextprotocol/sdk/server/stdio.js\";\nimport {\n CallToolRequestSchema,\n ListToolsRequestSchema,\n} from \"@modelcontextprotocol/sdk/types.js\";\nimport {\n createZapierSdk,\n type ZapierSdk,\n type FunctionRegistryEntry,\n} from \"@zapier/zapier-sdk\";\nimport { convertZodToMcpSchema } from \"./utils/schema-converter.js\";\nimport { spawn } from \"child_process\";\nimport { existsSync } from \"fs\";\nimport { createRequire } from \"module\";\n\ninterface ZapierMcpServerOptions {\n debug?: 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({ debug = false }: ZapierMcpServerOptions = {}) {\n // Create Zapier SDK instance\n const zapierSdk: ZapierSdk = createZapierSdk({ debug });\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 = zapierSdk\n .getRegistry()\n .functions.map((functionInfo: FunctionRegistryEntry) => {\n const toolName = functionInfo.name\n .replace(/([A-Z])/g, \"-$1\")\n .toLowerCase();\n\n return {\n name: toolName,\n description:\n functionInfo.inputSchema.description ||\n `Execute ${functionInfo.name}`,\n inputSchema: convertZodToMcpSchema(functionInfo.inputSchema),\n };\n });\n\n return { tools };\n });\n\n // Register call_tool handler - execute SDK functions\n server.setRequestHandler(CallToolRequestSchema, async (request) => {\n const { name, arguments: args } = request.params;\n\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 = zapierSdk\n .getRegistry()\n .functions.find(\n (info: FunctionRegistryEntry) => info.name === functionName,\n );\n\n if (!functionInfo) {\n const availableTools = zapierSdk\n .getRegistry()\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 // Validate arguments against schema\n const validatedArgs = functionInfo.inputSchema.parse(args || {});\n\n // Execute the function\n const result = await zapierSdk[functionInfo.name](validatedArgs);\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 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 return {\n content: [\n {\n type: \"text\",\n text: isValidationError\n ? `${errorMessage}\\n\\nExpected input format:\\n${JSON.stringify(convertZodToMcpSchema(functionInfo.inputSchema), null, 2)}`\n : errorMessage,\n },\n ],\n isError: true,\n };\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(options: ZapierMcpServerOptions = {}) {\n const server = createZapierMcpServer(options);\n const transport = new StdioServerTransport();\n await server.connect(transport);\n}\n\n// Auto-start if this file is run directly\nif (import.meta.url === `file://${process.argv[1]}`) {\n const debug = process.argv.includes(\"--debug\");\n startMcpServer({ debug }).catch((error) => {\n console.error(\"Failed to start MCP server:\", error);\n process.exit(1);\n });\n}\n\n/**\n * Starts the MCP server as a child process with process lifecycle management.\n *\n * This function handles spawning the MCP server as a separate Node.js process,\n * managing its lifecycle, and providing graceful shutdown handling. It's designed\n * to be called from CLI tools that need to start the MCP server.\n *\n * @param options - Configuration options for the MCP server process\n * @param options.debug - Enable debug logging\n * @param options.port - Port to listen on (for future HTTP transport)\n */\nasync function startMcpServerAsProcess(\n options: {\n debug?: boolean;\n port?: string;\n } = {},\n) {\n try {\n // Resolve our own executable path using Node.js module resolution\n const require = createRequire(import.meta.url);\n let mcpServerPath: string;\n\n try {\n // Try to resolve the built executable first\n mcpServerPath = require.resolve(\"@zapier/zapier-sdk-mcp/dist/index.mjs\");\n } catch {\n // Fallback to package main entry\n mcpServerPath = require.resolve(\"@zapier/zapier-sdk-mcp\");\n }\n\n // Validate that the executable exists\n if (!existsSync(mcpServerPath)) {\n console.error(`MCP server executable not found at: ${mcpServerPath}`);\n console.error(\"Please run 'pnpm build' to build the MCP server package.\");\n process.exit(1);\n }\n\n // Prepare arguments\n const args: string[] = [];\n if (options.debug) {\n args.push(\"--debug\");\n }\n if (options.port) {\n args.push(\"--port\", options.port);\n }\n\n // Start the MCP server as a child process\n const mcpProcess = spawn(\"node\", [mcpServerPath, ...args], {\n stdio: \"inherit\",\n cwd: process.cwd(),\n });\n\n // Handle process events\n mcpProcess.on(\"error\", (error) => {\n console.error(\"Failed to start MCP server:\", error.message);\n process.exit(1);\n });\n\n mcpProcess.on(\"exit\", (code, signal) => {\n if (signal) {\n console.log(`MCP server terminated by signal: ${signal}`);\n } else if (code !== 0) {\n console.error(`MCP server exited with code: ${code}`);\n process.exit(code);\n } else {\n console.log(\"MCP server stopped gracefully\");\n }\n });\n\n // Handle graceful shutdown\n const shutdown = (signal: NodeJS.Signals) => {\n console.log(`\\nReceived ${signal}, shutting down MCP server...`);\n mcpProcess.kill(signal);\n };\n\n process.on(\"SIGINT\", () => shutdown(\"SIGINT\"));\n process.on(\"SIGTERM\", () => shutdown(\"SIGTERM\"));\n } catch (error) {\n console.error(\"Error starting MCP server:\", error);\n process.exit(1);\n }\n}\n\nexport { createZapierMcpServer, startMcpServer, startMcpServerAsProcess };\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 { z } from \"zod\";\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// Types for Zod internals to improve type safety\ninterface ZodDef {\n typeName: string;\n description?: string;\n type?: z.ZodSchema;\n innerType?: z.ZodSchema;\n values?: readonly string[];\n options?: z.ZodSchema[];\n left?: z.ZodSchema;\n right?: z.ZodSchema;\n value?: unknown;\n valueType?: z.ZodSchema;\n}\n\ninterface ZodSchemaWithShape extends z.ZodSchema {\n shape?: Record<string, z.ZodSchema>;\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 return convertZodType(\n (zodSchema as unknown as { _def: ZodDef })._def,\n zodSchema,\n );\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 // Handle ZodObject\n if (def.typeName === \"ZodObject\" && 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 const fieldDef = (value as unknown as { _def: ZodDef })._def;\n properties[key] = convertZodType(fieldDef, value);\n\n // Check if field is required (not optional)\n if (\n fieldDef.typeName !== \"ZodOptional\" &&\n fieldDef.typeName !== \"ZodNullable\"\n ) {\n required.push(key);\n }\n }\n }\n\n const result: McpSchema = {\n type: \"object\",\n properties,\n description: def.description,\n };\n\n if (required.length > 0) {\n result.required = required;\n }\n\n return result;\n }\n\n // Handle ZodString\n if (def.typeName === \"ZodString\") {\n const schema: McpSchema = { type: \"string\" };\n if (def.description) schema.description = def.description;\n return schema;\n }\n\n // Handle ZodNumber\n if (def.typeName === \"ZodNumber\") {\n const schema: McpSchema = { type: \"number\" };\n if (def.description) schema.description = def.description;\n return schema;\n }\n\n // Handle ZodBoolean\n if (def.typeName === \"ZodBoolean\") {\n const schema: McpSchema = { type: \"boolean\" };\n if (def.description) schema.description = def.description;\n return schema;\n }\n\n // Handle ZodArray\n if (def.typeName === \"ZodArray\" && def.type) {\n return {\n type: \"array\",\n items: convertZodType(\n (def.type as unknown as { _def: ZodDef })._def,\n def.type,\n ),\n description: def.description,\n };\n }\n\n // Handle ZodOptional\n if (def.typeName === \"ZodOptional\" && def.innerType) {\n return convertZodType(\n (def.innerType as unknown as { _def: ZodDef })._def,\n def.innerType,\n );\n }\n\n // Handle ZodNullable\n if (def.typeName === \"ZodNullable\" && def.innerType) {\n const innerSchema = convertZodType(\n (def.innerType as unknown as { _def: ZodDef })._def,\n def.innerType,\n );\n return {\n ...innerSchema,\n type: Array.isArray(innerSchema.type)\n ? [...innerSchema.type, \"null\"]\n : [innerSchema.type, \"null\"],\n };\n }\n\n // Handle ZodEnum\n if (def.typeName === \"ZodEnum\" && def.values) {\n return {\n type: \"string\",\n enum: Array.from(def.values),\n description: def.description,\n };\n }\n\n // Handle ZodUnion\n if (def.typeName === \"ZodUnion\" && def.options) {\n return {\n oneOf: def.options.map((option) =>\n convertZodType((option as unknown as { _def: ZodDef })._def, option),\n ),\n description: def.description,\n };\n }\n\n // Handle ZodIntersection\n if (def.typeName === \"ZodIntersection\" && def.left && def.right) {\n return {\n allOf: [\n convertZodType(\n (def.left as unknown as { _def: ZodDef })._def,\n def.left,\n ),\n convertZodType(\n (def.right as unknown as { _def: ZodDef })._def,\n def.right,\n ),\n ],\n description: def.description,\n };\n }\n\n // Handle ZodLiteral\n if (def.typeName === \"ZodLiteral\" && def.value !== undefined) {\n const value = def.value;\n return {\n type: typeof value as \"string\" | \"number\" | \"boolean\",\n enum: [value],\n description: def.description,\n };\n }\n\n // Handle ZodRecord (for object with string keys)\n if (def.typeName === \"ZodRecord\") {\n return {\n type: \"object\",\n additionalProperties: def.valueType\n ? convertZodType(\n (def.valueType as unknown as { _def: ZodDef })._def,\n def.valueType,\n )\n : true,\n description: def.description,\n };\n }\n\n // Handle ZodAny\n if (def.typeName === \"ZodAny\") {\n return {\n description: def.description || \"Any value\",\n };\n }\n\n // Handle ZodUnknown\n if (def.typeName === \"ZodUnknown\") {\n return {\n description: def.description || \"Unknown value\",\n };\n }\n\n // Handle ZodDate\n if (def.typeName === \"ZodDate\") {\n return {\n type: \"string\",\n format: \"date-time\",\n description: def.description || \"ISO 8601 date-time string\",\n };\n }\n\n // Handle ZodBigInt\n if (def.typeName === \"ZodBigInt\") {\n return {\n type: \"string\",\n description: def.description || \"BigInt as string\",\n };\n }\n\n // Handle ZodUndefined\n if (def.typeName === \"ZodUndefined\") {\n return {\n type: \"null\",\n description: def.description || \"Undefined value\",\n };\n }\n\n // Handle ZodNull\n if (def.typeName === \"ZodNull\") {\n return {\n type: \"null\",\n description: def.description || \"Null value\",\n };\n }\n\n // Handle ZodVoid\n if (def.typeName === \"ZodVoid\") {\n return {\n type: \"null\",\n description: def.description || \"Void (null) value\",\n };\n }\n\n // Handle ZodNaN\n if (def.typeName === \"ZodNaN\") {\n return {\n type: \"number\",\n description: def.description || \"Not-a-Number value\",\n };\n }\n\n // Handle ZodDefault\n if (def.typeName === \"ZodDefault\" && def.innerType) {\n return convertZodType(\n (def.innerType as unknown as { _def: ZodDef })._def,\n def.innerType,\n );\n }\n\n // Handle ZodCatch (with fallback value)\n if (def.typeName === \"ZodCatch\" && def.innerType) {\n return convertZodType(\n (def.innerType as unknown as { _def: ZodDef })._def,\n def.innerType,\n );\n }\n\n // Fallback for unhandled types\n console.warn(\n `Unhandled Zod type: ${def.typeName}. Please consider adding support for this type.`,\n );\n return {\n type: \"string\",\n description: def.description || `Unsupported type: ${def.typeName}`,\n };\n}\n\nexport { convertZodToMcpSchema };\n"],"mappings":";;;AAEA,SAAS,cAAc;AACvB,SAAS,4BAA4B;AACrC;AAAA,EACE;AAAA,EACA;AAAA,OACK;AACP;AAAA,EACE;AAAA,OAGK;;;AC8DP,SAAS,sBAAsB,WAAmC;AAChE,SAAO;AAAA,IACJ,UAA0C;AAAA,IAC3C;AAAA,EACF;AACF;AAaA,SAAS,eAAe,KAAa,QAAiC;AAEpE,MAAI,IAAI,aAAa,eAAe,QAAQ;AAC1C,UAAM,kBAAkB;AACxB,UAAM,aAAwC,CAAC;AAC/C,UAAM,WAAqB,CAAC;AAE5B,QAAI,gBAAgB,OAAO;AACzB,iBAAW,CAAC,KAAK,KAAK,KAAK,OAAO,QAAQ,gBAAgB,KAAK,GAAG;AAChE,cAAM,WAAY,MAAsC;AACxD,mBAAW,GAAG,IAAI,eAAe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AQ,CAAC;AAC7C,YAAQ,GAAG,WAAW,MAAM,SAAS,SAAS,CAAC;AAAA,EACjD,SAAS,OAAO;AACd,YAAQ,MAAM,8BAA8B,KAAK;AACjD,YAAQ,KAAK,CAAC;AAAA,EAChB;AACF;","names":["schema","require"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zapier/zapier-sdk-mcp",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "MCP server for Zapier SDK",
|
|
5
5
|
"main": "dist/index.mjs",
|
|
6
6
|
"types": "dist/index.d.mts",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"dependencies": {
|
|
22
22
|
"@modelcontextprotocol/sdk": "^1.17.3",
|
|
23
23
|
"zod": "^3.22.4",
|
|
24
|
-
"@zapier/zapier-sdk": "0.
|
|
24
|
+
"@zapier/zapier-sdk": "0.6.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
27
|
"@types/node": "^20.0.0",
|