import type { RequestHandler } from 'express'; import { type GuardOptions } from './index.js'; /** Adapter-level options for the Express guard (transport concerns, not verify). */ export interface ExpressGuardOptions { /** * Trusted external origin (e.g. `https://mcp.example.com`) used to build the * DPoP `htu` the proof must match. REQUIRED when `requireDpop` is set: the * request `Host` header and `req.protocol` are both client-influenced, so * deriving the origin from them lets an attacker holding a captured proof * replay it across deployments by spoofing `Host` to match the proof's real * origin. Set this to your real public origin. */ trustedOrigin?: string; } /** * Express middleware guarding an HTTP MCP endpoint. Fail-closed: a request without * a valid attestation for `opts.audience` gets a JSON-RPC 2.0 error + 401/403/503. * On success, claims are attached at `req.aerAttestation`. * * The JSON-RPC id is echoed ONLY when a body parser has already buffered the body * (`req.body`); the guard never consumes the stream itself, so SSE / streaming * Streamable-HTTP requests are left intact. * * Throws synchronously at setup if `opts.requireDpop` is set without * `adapterOpts.trustedOrigin` pinned - see `ExpressGuardOptions.trustedOrigin`. */ export declare function expressMcpGuard(opts: GuardOptions, adapterOpts?: ExpressGuardOptions): RequestHandler; //# sourceMappingURL=express.d.ts.map