import { Server } from '@modelcontextprotocol/sdk/server/index.js'; import { Plugin, PluginProvides } from '@zapier/zapier-sdk'; interface ZapierMcpServerOptions { debug?: boolean; /** * Forwarded to the underlying SDK so a CLI invocation like * `zapier-sdk --max-concurrent-requests 50 mcp` actually constrains * the MCP server's tool calls. Undefined falls through to the SDK's * own resolution chain (option > env var > default). */ maxConcurrentRequests?: number; /** * Extra plugins to layer onto the SDK before exposing it as MCP tools. * Used by the CLI's `mcp` command to forward extensions discovered via * the `ZAPIER_SDK_EXTENSIONS` env var. Standalone callers can omit this; * the server then uses a vanilla public SDK. Each is forwarded to * `addPlugin`, which accepts a legacy function plugin or a new-model plugin * descriptor (`{ pluginType }`). */ extensions?: (Plugin | { readonly pluginType: string; })[]; /** * Build the server against `@zapier/zapier-sdk/experimental` instead of * the stable surface, so experimental plugins appear as MCP tools. * Mirrors the CLI's `--experimental` opt-in: a default invocation only * ever sees stable plugins. */ experimental?: boolean; } /** * Creates an MCP server that exposes Zapier SDK functions as MCP tools. * * The server automatically discovers all available SDK functions and converts * their Zod schemas to MCP-compatible JSON schemas. It handles tool execution * by validating inputs and calling the appropriate SDK functions. * * @param options - Configuration options for the MCP server * @param options.debug - Enable debug logging for detailed error information * @returns An MCP server instance configured to expose Zapier SDK tools * * @example * ```typescript * const server = createZapierMcpServer({ debug: true }); * const transport = new StdioServerTransport(); * await server.connect(transport); * ``` */ declare function createZapierMcpServer({ debug, maxConcurrentRequests, extensions, experimental, }?: ZapierMcpServerOptions): Server<{ method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; progressToken?: string | number; }; }; }, { method: string; params?: { [x: string]: unknown; _meta?: { [x: string]: unknown; }; }; }, { [x: string]: unknown; _meta?: { [x: string]: unknown; }; }>; /** * Starts an MCP server with stdio transport for CLI usage. * * This is the main entry point when running the MCP server from the command line. * It creates the server and connects it using stdio transport for communication * with MCP clients like Claude Code. * * @param options - Configuration options for the MCP server * @param options.debug - Enable debug logging for detailed error information * * @example * ```typescript * // Start server with debug logging * await startMcpServer({ debug: true }); * ``` */ declare function startMcpServer(options?: ZapierMcpServerOptions): Promise; export { createZapierMcpServer, startMcpServer };