/** * Streamable HTTP transport for the Misar.Blog MCP server. * * Builds the SAME server as the stdio binary — see `buildServer` — so the * hosted endpoint and the npm package can never drift apart. Auth is injected * by the host, because it depends on the MisarBlog database. * * Every request runs inside `runWithContext`, which is what makes one shared * tool implementation safe in a multi-tenant process: the credential lives in * AsyncLocalStorage for the duration of the call rather than in module state. */ export interface BlogCaller { userId: string; /** The raw API key to forward to the REST API on this caller's behalf. */ apiKey: string; } export interface BlogHttpOptions { /** Resolve an Authorization header to a caller, or null when invalid. */ authenticate: (authHeader: string | null) => Promise; /** * Optional per-caller rate limit, applied after authentication so the budget * is keyed to the API key rather than a shared client IP. Return false to * reject with 429. */ rateLimit?: (caller: BlogCaller) => Promise; /** API base the tools call, e.g. `https://www.misar.blog/api/v1`. */ baseUrl: string; onError?: (error: unknown) => void; } export declare function createBlogHttpHandler(options: BlogHttpOptions): (request: Request) => Promise; export declare function corsPreflight(): Response; //# sourceMappingURL=http.d.ts.map