import { type InvokeHook } from "./tool/invoker.js"; /** * Configuration for creating an OAPI Invoker MCP server programmatically. * All fields are optional — unset fields fall back to the corresponding * environment variables (SPEC_PATH, SPEC_URL, SPEC_EXTENSION_PATH, etc.). */ export interface OapiInvokerConfig { /** Path to the OpenAPI spec file. Takes priority over SPEC_PATH env var. */ specPath?: string; /** URL of the OpenAPI spec. Takes priority over SPEC_URL env var. */ specUrl?: string; /** Path to the OpenAPI extension/patch file. Takes priority over SPEC_EXTENSION_PATH env var. */ extensionPath?: string; /** URL of the OpenAPI extension/patch. Takes priority over SPEC_EXTENSION_URL env var. */ extensionUrl?: string; /** * Extra environment variables used for `{VAR_NAME}` template replacement at * invoke time (e.g. credentials). These take priority over process.env. */ env?: Record; /** * When `true`, registers `outputSchema` for tools so MCP clients validate * `structuredContent` against the response schema. Most real-world OpenAPI * specs are not fully accurate (e.g. nullable fields omitted), so this is * `false` by default to avoid `-32602` validation errors. */ strictOutputSchema?: boolean; /** * Lifecycle hooks for customizing invoke behavior. */ hooks?: { /** * Called after user inputParams are processed but before sensitive params * are resolved. Use this to dynamically set credentials based on the * user's input (e.g. look up a masterkey by appid). * * Mutating `ctx.sensitiveParams` or `ctx.env` in this hook affects the * outgoing request. * * @example * ```ts * hooks: { * beforeInvoke: (ctx) => { * const keys = JSON.parse(process.env.MASTERKEYS || '{}'); * ctx.sensitiveParams.masterkey = keys[ctx.inputParams.appid] || ''; * }, * } * ``` */ beforeInvoke?: InvokeHook; }; } //# sourceMappingURL=set-up-mcp.d.ts.map