import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { createMcpHandler as baseCreateMcpHandler } from "mcp-handler"; type InnerServerOptions = NonNullable[1]>; type Config = NonNullable[2]>; /** A plugin takes a server and returns an augmented server type. */ export type ServerPlugin = (server: S) => R; /** Apply a tuple of plugins to a server type (left-to-right) for typing. */ export type ApplyPlugins = W extends readonly [] ? S : W extends readonly [infer F, ...infer R] ? F extends ServerPlugin ? ApplyPlugins> : S : S; /** Preserve tuple info so TS can infer exact augmented type. */ export declare function makePlugins(...plugins: W): W; /** Compose to a single plugin (right-to-left) if you like function style. */ export declare function composePlugins(...plugins: W): (server: S) => ApplyPlugins; export type ServerOptions = InnerServerOptions & { /** Dynamically augment the McpServer instance with your plugins. */ plugins?: W; }; /** * createMcpHandlerWithPlugins * Wraps your existing handler to: * - apply plugins at runtime (mutating/augmenting the same server instance) * - thread plugin types to the `initializeServer` callback (no casts needed) */ export default function createMcpHandler(initializeServer: ((server: ApplyPlugins) => Promise) | ((server: ApplyPlugins) => void), serverOptions?: ServerOptions, config?: Config): (request: Request) => Promise; export {}; //# sourceMappingURL=index.d.ts.map