Namespace Nexus\Mcp\Server\Transport\Http\Middleware

Classes
BearerAuthenticationMiddleware

Makes the MCP endpoint an OAuth 2.1 resource server, handing what it validated to handlers on ServerContext::$receiveContext->authInfo.

CorsMiddleware

Grants browser clients cross-origin access to the MCP endpoint additively, leaving rejection to the DNS-rebinding gate.

DnsRebindingProtectionMiddleware

Guards the MCP endpoint against DNS rebinding by rejecting an unlisted Origin with an id-less JSON-RPC error on HTTP 403.

ParameterHeaderValidationMiddleware

Rejects a tools/call whose Mcp-Param-{Name} headers disagree with the arguments in its body.

RequestBodySizeLimitMiddleware

Rejects a request whose body exceeds a configured byte cap with an id-less JSON-RPC error on HTTP 413, reading a body of indeterminate size only up to one byte past the cap.