Skip to main content

Module registration

Module registration 

Source
Expand description

Choosing a client registration mechanism and carrying it out.

MCP changed its mind about this twice. 2025-03-26 and 2025-06-18 name RFC 7591 and nothing else; 2025-11-25 adds Client ID Metadata Documents as recommended without deprecating RFC 7591; 2026-07-28 deprecates RFC 7591 “in favor of” documents while keeping it for servers that implement nothing else. Which of those a client must do is a pure function of the negotiated revision, and it lives in ClientRegistration. This module is what acts on it.

§Why planning is separate from doing

plan_registration decides, and returns a value saying what it decided and why. acquire_client then does it. The split is not ceremony: a client that has to make this choice at the moment it is holding an HTTP response has no way to log what it chose or to refuse before it opens a socket. Concretely, 2026-07-28 §8 makes application_type a MUST for dynamic registration, and a client that discovers that after the POST has already registered a client the server will not honour.

§What is not trusted

Two things arrive from outside and neither is checked here, because both are checks that belong with the thing that fetched it. A registration response is the authorization server telling the client what it called it; the adapter turns that into a RegisteredClient and refuses a client_id that is a metadata document URL when dynamic registration was used. A metadata document is the client publishing its own identity at a URL; the adapter verifies the document’s client_id is the URL it was served from, because a document that claims to be some other client’s is a forgery and nothing downstream can detect it.

What this module does guarantee is that neither result is ever issued by the wrong issuer, because RegisteredClient carries its issuer and acquire_client builds every one it returns itself.

Structs§

Available
What this deployment can actually reach.
ClientIdentity
What this client is willing to identify itself with.
ClientMetadata
The metadata a client presents to register.

Enums§

ClientMetadataError
A ClientMetadata field name is one this crate models.
RegistrarError
Why a registration request did not produce a client.
RegistrationError
Why a client could not be registered.
RegistrationPlan
What plan_registration decided.

Traits§

DynamicRegistrar
Registers a client dynamically through RFC 7591 §3.1.
MetadataDocumentLoader
Fetches the Client ID Metadata Document a client published.

Functions§

acquire_client
Plan a registration and carry it out.
plan_registration
Decide how to register, without doing it.