MCP PHP SDK

ListRootsRequestHandler implements RequestHandlerInterface

Handler for roots/list requests from the server.

since protocol revision 2026-07-28 (SEP-2577), earliest removal 2027-07-28. Pass directories or files through tool arguments, resource URIs or server configuration instead.

The MCP server may ask the client for the list of filesystem roots (its "workspace folders"). This handler wraps a user-provided callback that returns the roots the client wishes to expose.

Tags
author

Johannes Wachter johannes@sulu.io

Table of Contents

Interfaces

RequestHandlerInterface
Interface for handling requests from the server.

Properties

$callback  : RootsCallbackInterface
$logger  : LoggerInterface

Methods

__construct()  : mixed
handle()  : Response<string|int, ListRootsResult>|Error
Handle the request and return a response or error.
supports()  : bool
Check if this handler supports the given request.

Properties

Methods

On this page

Search results