pub struct StatelessRequestMeta {
pub progress_token: Option<ProgressToken>,
pub protocol_version: Option<String>,
pub client_info: Option<Implementation>,
pub client_capabilities: Option<ClientCapabilities>,
pub log_level: Option<LogLevel>,
}Expand description
Per-request metadata carried in JSON-RPC _meta per SEP-2575.
In the 2026-07-28 protocol every request is self-contained – there is no
initialize handshake and no session. The fields previously negotiated at
init time (protocol version, client identity, client capabilities) ride on
each request via the _meta object. The MCP-defined keys are reverse-DNS
namespaced under io.modelcontextprotocol/.
Wire shape (per the FINAL spec):
"_meta": {
"progressToken": "...",
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientInfo": { "name": "...", "version": "..." },
"io.modelcontextprotocol/clientCapabilities": { ... },
"io.modelcontextprotocol/logLevel": "info"
}protocolVersion and clientCapabilities are REQUIRED per the spec.
clientInfo is a SHOULD – clients are expected to send it on every
request unless specifically configured not to, but a server MUST NOT
reject a request for lacking it. All three are typed as Option<_> here
so deserialization stays tolerant of partial/transitional clients;
server-side validation should reject requests that lack the two required
fields.
Fields§
§progress_token: Option<ProgressToken>Progress token for receiving progress notifications.
protocol_version: Option<String>The MCP protocol version this request targets.
For HTTP this MUST match the MCP-Protocol-Version header. On stdio
and custom JSON-RPC bindings, this field independently selects the
request lifecycle. Spec key:
io.modelcontextprotocol/protocolVersion.
client_info: Option<Implementation>Identifies the client software making this request. Clients SHOULD include this on every request unless specifically configured not to (SEP-2575, final – earlier SEP-2575 drafts had this as REQUIRED; the upstream schema demoted it before finalization). Self-reported and unverified: servers SHOULD NOT use it for behavior or security decisions, only display/logging/debugging.
client_capabilities: Option<ClientCapabilities>Capabilities the client advertises for this specific request. REQUIRED per SEP-2575.
log_level: Option<LogLevel>Optional per-request log-level override.
Implementations§
Source§impl StatelessRequestMeta
impl StatelessRequestMeta
Sourcepub fn from_params(params: &Value) -> Option<Self>
pub fn from_params(params: &Value) -> Option<Self>
Extract stateless request metadata from JSON-RPC request params.
The metadata is expected in the _meta field of the params object.
Sourcepub fn has_client_capabilities(&self) -> bool
pub fn has_client_capabilities(&self) -> bool
Check if this request includes client capabilities.
Sourcepub fn has_client_info(&self) -> bool
pub fn has_client_info(&self) -> bool
Check if this request includes client identity.
Trait Implementations§
Source§impl Clone for StatelessRequestMeta
impl Clone for StatelessRequestMeta
Source§fn clone(&self) -> StatelessRequestMeta
fn clone(&self) -> StatelessRequestMeta
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more