UNPKG

histoire

Version:

A fast story book powered by Vite

23 lines • 1.26 kB
import type { McpServerFactory } from '@modelcontextprotocol/server'; import type { IncomingMessage, ServerResponse } from 'node:http'; import type { McpHttpPolicy } from './http-guards.js'; import type { DevMcpOptions } from './http-options.js'; /** Creates a guarded mounted handler usable on dev or production Node listeners. */ export declare function createMcpHttpHandler(factory: McpServerFactory, policy: McpHttpPolicy, observeExchange?: (work: () => Promise<void>) => Promise<void>): { /** Rejects before protocol parsing; SDK owns every JSON-RPC method and revision. */ handle(request: IncomingMessage, response: ServerResponse): Promise<void>; /** Stops admission immediately and closes active modern protocol exchanges once. */ close(): Promise<void>; }; /** Opens one owned loopback listener; only the implicit default port can fall back. */ export declare function startDevMcpHttp(options: DevMcpOptions & { factory: McpServerFactory; principal: string; token?: string; observeExchange?: (work: () => Promise<void>) => Promise<void>; }): Promise<{ server: import("http").Server<typeof IncomingMessage, typeof ServerResponse>; url: string; close: () => Promise<void>; }>; //# sourceMappingURL=http.d.ts.map