MCP PHP SDK

ProtectedResourceMetadataHandler implements RequestHandlerInterface

FinalYes

Serves OAuth 2.0 Protected Resource Metadata (RFC 9728) as a standalone request handler.

This is a plain PSR-15 RequestHandlerInterface — the "controller" that decides what to return, independent of when. It can be used three ways from a single instance:

  • inside the MCP transport, wrapped by ProtectedResourceMetadataMiddleware;
  • as a bare PSR-7 handler in a hand-rolled front controller;
  • as a framework callable controller (Symfony/Laravel), by converting the framework request to PSR-7 and the returned PSR-7 response back — see docs/run/authorization.md.

It performs no path or method matching: routing is the caller's responsibility (the middleware's guard, or the framework router).

Tags
see
https://datatracker.ietf.org/doc/html/rfc9728
author

Volodymyr Panivko sveneld300@gmail.com

Table of Contents

Interfaces

RequestHandlerInterface

Properties

$metadata  : ProtectedResourceMetadata
$responseFactory  : ResponseFactoryInterface
$streamFactory  : StreamFactoryInterface

Methods

__construct()  : mixed
handle()  : ResponseInterface

Properties

Methods

handle()

public handle(ServerRequestInterface $request) : ResponseInterface
Parameters
$request : ServerRequestInterface
Return values
ResponseInterface
On this page

Search results