import type { Request as ExpressRequest } from "express";
import type { z } from "zod";
export interface SmitheryUrlOptions {
apiKey?: string;
profile?: string;
config?: object;
}
/**
* Creates a URL to connect to the Smithery MCP server.
* @param baseUrl The base URL of the Smithery server
* @param options Optional configuration object
* @returns A URL object with properly encoded parameters. Example: https://server.smithery.ai/{namespace}/mcp?config=BASE64_ENCODED_CONFIG&api_key=API_KEY
*/
export declare function createSmitheryUrl(baseUrl: string, options?: SmitheryUrlOptions): URL;
/**
* Parses the config from an express request by checking the query parameter "config".
* @param req The express request
* @returns The config
*/
export declare function parseExpressRequestConfig(req: ExpressRequest): Record<string, unknown>;
/**
* Parses and validates config from an Express request with optional Zod schema validation
* Supports both base64-encoded config and dot-notation config parameters
* @param req The express request
* @param schema Optional Zod schema for validation
* @returns Result with either parsed data or error response
*/
export declare function parseAndValidateConfig<T = Record<string, unknown>>(req: ExpressRequest, schema?: z.ZodSchema<T>): import("okay-error").Err<{
title: string;
status: number;
detail: string;
instance: string;
}> | import("okay-error").Err<{
readonly title: "Invalid configuration parameters";
readonly status: 422;
readonly detail: "One or more config parameters are invalid.";
readonly instance: string;
readonly configSchema: import("zod-to-json-schema").JsonSchema7Type & {
$schema?: string | undefined;
definitions?: {
[key: string]: import("zod-to-json-schema").JsonSchema7Type;
} | undefined;
};
readonly errors: {
param: string;
pointer: string;
reason: string;
received: unknown;
}[];
}> | import("okay-error").Ok<T>;