MCP PHP SDK

AbstractExtension implements ExtensionInterface

AbstractYes

Base for an extension that only announces a capability and adds no RPC methods of its own — the common case. Implementers only need {@see ExtensionInterface::getId()} and {@see ExtensionInterface::getCapabilities()}.

Tags
author

Christopher Hertel mail@christopher-hertel.de

Table of Contents

Interfaces

ExtensionInterface
An MCP protocol extension advertised during capability negotiation.

Methods

getMessages()  : array<int, Request>|Notification>>
Every message class this extension defines.
getRequestHandlers()  : iterable<string|int, RequestHandlerInterface<string|int, ResultInterface>>
The handlers serving those methods.

Methods

getMessages()

Every message class this extension defines.

public getMessages() : array<int, Request>|Notification>>

These are registered with the MessageFactory, without which an extension's method cannot be decoded off the wire at all, and their method names are what let a server distinguish an extension it does not serve from a method that does not exist. An extension with no methods of its own returns an empty array.

Return values
array<int, Request>|Notification>>
On this page

Search results