McpRequestMeta class

Reverse-DNS _meta key constants and typed accessors for the stateless core. All keys sit under the reserved io.modelcontextprotocol/ prefix.

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited

Static Methods

build({required String protocolVersion, required Map<String, dynamic> clientCapabilities, Map<String, dynamic>? clientInfo, String? logLevel, Map<String, dynamic>? extra}) Map<String, dynamic>
Build a request _meta object carrying the reverse-DNS stateless keys.
buildResult({required Map<String, dynamic> serverInfo, Map<String, dynamic>? extra}) Map<String, dynamic>
Build a result _meta object carrying serverInfo, merging extra first so the reserved key wins. Returns a fresh map.
readClientCapabilities(Object? meta) Map<String, dynamic>?
Read io.modelcontextprotocol/clientCapabilities from a request _meta. Returns null when absent (distinct from an empty object).
readClientInfo(Object? meta) Map<String, dynamic>?
Read io.modelcontextprotocol/clientInfo from a request _meta.
readLogLevel(Object? meta) String?
Read io.modelcontextprotocol/logLevel from a request _meta.
readProtocolVersion(Object? meta) String?
Read io.modelcontextprotocol/protocolVersion from a request _meta.
readServerInfo(Object? meta) Map<String, dynamic>?
Read io.modelcontextprotocol/serverInfo from a result _meta.
readSubscriptionId(Object? meta) Object?
Read io.modelcontextprotocol/subscriptionId from a notification _meta.

Constants

keyClientCapabilities → const String
RequestMetaObject."io.modelcontextprotocol/clientCapabilities" — the client's capabilities FOR THIS REQUEST (REQUIRED on the stateless path). An empty object means no optional capabilities.
keyClientInfo → const String
RequestMetaObject."io.modelcontextprotocol/clientInfo" — self-reported client software identity (name+version). Display/logging only.
keyLogLevel → const String
RequestMetaObject."io.modelcontextprotocol/logLevel" — the per-request desired log level (replaces the logging/setLevel RPC). Optional.
keyProtocolVersion → const String
RequestMetaObject."io.modelcontextprotocol/protocolVersion" — the MCP protocol version for this request (REQUIRED on the stateless path). For HTTP it MUST equal the MCP-Protocol-Version header.
keyServerInfo → const String
ResultMetaObject."io.modelcontextprotocol/serverInfo" — self-reported server software identity carried on a response _meta.
keySubscriptionId → const String
NotificationMetaObject."io.modelcontextprotocol/subscriptionId" — the JSON-RPC id of the subscriptions/listen request whose stream carried this notification (also on SubscriptionsListenResult._meta). Absent on non-subscription notifications.