import type { IncomingMessage, ServerResponse } from "node:http"; import type { McpServer } from "@modelcontextprotocol/sdk/server/mcp.js"; import { type KnownTargetOptions } from "../../contracts/index.js"; import { McpBindingRegistry } from "../binding-registry.js"; import type { McpBindingContext } from "../binding-registry.js"; import type { ToolBrokerApi } from "./broker-api.js"; export declare const GROUPX_MCP_BINDING_HEADER: "X-GroupX-Binding"; export interface GroupXMcpHttpHandler { /** * The SDK server/transport pair is recreated per HTTP request. Binding is * therefore explicit on every request and MCP session IDs are not used. */ readonly mode: "stateless-per-request"; readonly activeRequestCount: number; handle(request: IncomingMessage, response: ServerResponse, parsedBody?: unknown): Promise; close(): Promise; } export interface CreateGroupXMcpHttpHandlerOptions extends KnownTargetOptions { readonly broker?: ToolBrokerApi; readonly bindings: McpBindingRegistry; readonly createServer?: (input: { binding: McpBindingContext; knownTargets?: KnownTargetOptions["knownTargets"]; }) => McpServer; } /** * Creates the loopback HTTP MCP product handler. * * `X-GroupX-Binding` is a normal per-session provenance handle. Missing, * unknown and closed handles are protocol mismatches (HTTP 400), not * authentication failures, and this layer never returns 401/403 or evaluates * CLI permissions. */ export declare function createGroupXMcpHttpHandler(options: CreateGroupXMcpHttpHandlerOptions): GroupXMcpHttpHandler; //# sourceMappingURL=http.d.ts.map