Immutable server configuration shared by direct and transport dispatch.
Summary
Types
@type cache_policy() :: %{ttl_ms: non_neg_integer(), scope: String.t()}
@type t() :: %Snodo.Server.Runtime{ authorization: Snodo.Authorization.config(), capabilities: map(), discovery_cache: cache_policy(), extension_registry: Snodo.Extension.Registry.t(), instructions: String.t() | nil, instrumentation: Snodo.Instrumentation.Config.t() | nil, pagination: Snodo.Pagination.t(), prompts_cache: cache_policy(), protocol_registry: Snodo.Protocol.Registry.t(), resources_cache: cache_policy(), router: Snodo.Router.t(), schema_validator: module(), server_info: map(), subscription_source: Snodo.Subscription.Source.Config.t() | nil, tools_cache: cache_policy() }
Functions
Builds and validates a runtime. It starts no process.
A module that uses Snodo.Server builds its runtime with runtime/1, which
calls this function with the declared options and any overrides.
Required options:
:router- theSnodo.Routerwith the registered components.:protocols- the protocol dialect modules to enable, in preference order, such as[Snodo.Protocol.V2026_07_28].:server_info- a map with string"name"and"version"and, optionally,"title","description","websiteUrl", and"icons".
Other options:
:capabilities- the server capabilities map. Defaults to"tools","prompts", and"resources"for each kind the router has registered, plus"completions"when a registered prompt or resource template supports completion.:extensions-Snodo.Extensionmodules or{module, options}tuples. Defaults to[].:instructions- a string returned inserver/discoverandinitializeresults, ornil(the default).:schema_validator- aSnodo.Schema.Validatormodule. Defaults toSnodo.Schema.Validator.Passthrough.:subscription_source- aSnodo.Subscription.Sourcemodule or{module, options}. Defaults tonil, which leavessubscriptions/listenunavailable.:instrumentation- aSnodo.Instrumentationsink module or{module, options}. Defaults tonil.:authorization- aSnodo.Authorizationpolicy module or{module, options}. Defaults tonil.:discovery_cache,:tools_cache,:prompts_cache,:resources_cache-[ttl_ms: non_neg_integer, scope: "private" | "public"]. Each defaults tottl_ms: 0, scope: "private".:pagination-[page_size: pos_integer]. Defaults to a page size of 100.
A missing required option raises KeyError. An invalid value raises
ArgumentError, including a capability an enabled protocol profile does
not support, "completions" without a completion-capable component, a
listChanged or subscribe setting of true without a
:subscription_source, and an advertised extension that is not installed.
When an initialize-era dialect is enabled, a warning is logged naming any
tool those clients cannot list.