Builds the result of server/discover, the modern-era method a client uses
to learn which protocol versions, capabilities and instructions a server
has, without a handshake.
server/discover is era-exempt: it is served on the modern path even when
the request carries no _meta (see ConduitMcp.Era), because a client may
call it precisely to find out which era the server speaks. It is
authenticated like every other POST.
The result body is:
"supportedVersions"—ConduitMcp.Protocol.supported_versions/0, modern and legacy versions newest first;"capabilities"—ConduitMcp.Capabilities.build/2withera: :modern(list-changed notifications andresources.subscribeare advertised becausesubscriptions/listendelivers them; the tasks extension when it is enabled);"instructions"— seeinstructions/2; omitted when there are none.
ConduitMcp.Protocol.Modern adds resultType, the cache hints and the
serverInfo _meta.
Summary
Functions
The server's instructions, or nil.
The server/discover result body for server_module on conn.
Functions
@spec instructions(module(), Plug.Conn.t() | map()) :: String.t() | nil
The server's instructions, or nil.
The transport's :instructions option (resolved into
conn.private[:instructions]) wins; otherwise the server module's
__instructions__/0, generated by use ConduitMcp.Server, instructions:
and by use ConduitMcp.Endpoint, instructions:. Only a string counts.
Used for both server/discover and the legacy initialize result.
@spec result(module(), Plug.Conn.t() | map()) :: map()
The server/discover result body for server_module on conn.