MCP PHP SDK

ClientRegistrarInterface

Interface for OAuth 2.0 Dynamic Client Registration (RFC 7591).

Implementations are responsible for persisting client credentials and returning a registration response as defined in RFC 7591 Section 3.2.

Tags
see
https://datatracker.ietf.org/doc/html/rfc7591

Table of Contents

Methods

register()  : array<string, mixed>
Registers a new OAuth 2.0 client.

Methods

register()

Registers a new OAuth 2.0 client.

public register(array<string, mixed> $registrationRequest) : array<string, mixed>

The registration request contains metadata fields as defined in RFC 7591 Section 2 (e.g. redirect_uris, client_name, token_endpoint_auth_method).

The returned array MUST include at least "client_id" and should include "client_secret" when the token endpoint auth method requires one.

Parameters
$registrationRequest : array<string, mixed>

Client metadata from the registration request body

Tags
throws
ClientRegistrationException

If registration fails (e.g. invalid metadata, storage error). The exception message is returned to the client as error_description — do not include internal details (database errors, stack traces, etc.).

Return values
array<string, mixed>

Registration response including client_id and optional client_secret


        
On this page

Search results