feat!: align metadata models with draft schema (#993)

This commit is contained in:
Dale Seo 2026-07-15 08:58:46 -04:00 • committed by GitHub
commit 839922d8fd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 2539 additions and 1059 deletions

View file

@ -125,7 +125,7 @@ async fn test_elicitation_result_serialization() {
assert_eq!(deserialized.meta, None);
// Test protocol-level metadata round-trips as _meta.
let meta_result = ElicitResult::new(ElicitationAction::Accept).with_meta(Meta(object!({
let meta_result = ElicitResult::new(ElicitationAction::Accept).with_meta(MetaObject(object!({
"traceId": "elicitation-123"
})));
@ -139,7 +139,7 @@ async fn test_elicitation_result_serialization() {
let deserialized: ElicitResult = serde_json::from_value(expected).unwrap();
assert_eq!(
deserialized.meta,
Some(Meta(object!({ "traceId": "elicitation-123" })))
Some(MetaObject(object!({ "traceId": "elicitation-123" })))
);
}

View file

@ -1,12 +1,12 @@
use rmcp::model::{ContentBlock, EmbeddedResource, Meta, ResourceContents};
use rmcp::model::{ContentBlock, EmbeddedResource, MetaObject, ResourceContents};
use serde_json::json;
#[test]
fn serialize_embedded_text_resource_with_meta() {
let mut resource_content_meta = Meta::new();
let mut resource_content_meta = MetaObject::new();
resource_content_meta.insert("inner".to_string(), json!(2));
let mut resource_meta = Meta::new();
let mut resource_meta = MetaObject::new();
resource_meta.insert("top".to_string(), json!(1));
let content = ContentBlock::Resource(
@ -90,10 +90,10 @@ fn deserialize_embedded_text_resource_with_meta() {
#[test]
fn serialize_embedded_blob_resource_with_meta() {
let mut resource_content_meta = Meta::new();
let mut resource_content_meta = MetaObject::new();
resource_content_meta.insert("blob_inner".to_string(), json!(true));
let mut resource_meta = Meta::new();
let mut resource_meta = MetaObject::new();
resource_meta.insert("blob_top".to_string(), json!("t"));
let content = ContentBlock::Resource(

View file

@ -61,6 +61,60 @@ mod tests {
);
}
/// The three metadata definitions must expose the MCP 2026-07-28 draft
/// vocabulary: `MetaObject` is an open map, `RequestMetaObject` reserves
/// `progressToken` plus the SEP-2575 keys, and `NotificationMetaObject`
/// reserves `io.modelcontextprotocol/subscriptionId`. The keys the draft
/// marks as required stay optional because rmcp generates one schema
/// shared by every supported protocol version; draft-strict validation is
/// a runtime concern (`RequestMetaObject::missing_required_keys`).
#[test]
fn test_metadata_definitions_match_draft_schema() {
let settings = SchemaSettings::draft07();
let schema = settings
.into_generator()
.into_root_schema_for::<ClientJsonRpcMessage>();
let schema = serde_json::to_value(&schema).expect("Failed to serialize schema");
let definitions = &schema["definitions"];
assert_eq!(
definitions["MetaObject"],
serde_json::json!({
"description": "See [specification/draft/basic/index#general-fields] for notes on _meta usage.",
"type": "object",
"additionalProperties": true,
})
);
assert_eq!(
definitions["RequestMetaObject"],
serde_json::json!({
"description": "Metadata reserved by MCP on requests. Extension keys are also allowed.",
"type": "object",
"properties": {
"progressToken": { "$ref": "#/definitions/ProgressToken" },
"io.modelcontextprotocol/protocolVersion": { "type": "string" },
"io.modelcontextprotocol/clientInfo": { "$ref": "#/definitions/Implementation" },
"io.modelcontextprotocol/clientCapabilities": { "$ref": "#/definitions/ClientCapabilities" },
"io.modelcontextprotocol/logLevel": { "$ref": "#/definitions/LoggingLevel" },
},
"additionalProperties": true,
})
);
assert_eq!(
definitions["NotificationMetaObject"],
serde_json::json!({
"description": "Metadata reserved by MCP on notifications. Extension keys are also allowed.",
"type": "object",
"properties": {
"io.modelcontextprotocol/subscriptionId": { "$ref": "#/definitions/NumberOrString" },
},
"additionalProperties": true,
})
);
}
#[test]
fn test_server_json_rpc_message_schema() {
let settings = SchemaSettings::draft07();

View file

@ -86,11 +86,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -128,11 +131,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"arguments": {
"description": "Arguments to pass to the tool (must match the tool's input schema)",
@ -187,11 +193,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"taskId": {
"type": "string"
@ -210,11 +219,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"reason": {
"type": [
@ -334,11 +346,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"argument": {
"$ref": "#/definitions/ArgumentInfo"
@ -474,11 +489,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"content": {
"description": "The actual content of the message (text, image, audio, tool use, or tool result)",
@ -550,11 +568,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this result.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"action": {
"description": "The user's decision on how to handle the elicitation request",
@ -638,11 +659,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -727,11 +751,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"arguments": {
"type": [
@ -773,11 +800,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"taskId": {
"type": "string"
@ -797,11 +827,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"taskId": {
"type": "string"
@ -873,11 +906,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -952,11 +988,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"capabilities": {
"description": "The capabilities this client supports (sampling, roots, etc.)",
@ -1169,11 +1208,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"roots": {
"type": "array",
@ -1212,6 +1254,11 @@
"emergency"
]
},
"MetaObject": {
"description": "See [specification/draft/basic/index#general-fields] for notes on _meta usage.",
"type": "object",
"additionalProperties": true
},
"Notification": {
"type": "object",
"properties": {
@ -1257,6 +1304,16 @@
"params"
]
},
"NotificationMetaObject": {
"description": "Metadata reserved by MCP on notifications. Extension keys are also allowed.",
"type": "object",
"properties": {
"io.modelcontextprotocol/subscriptionId": {
"$ref": "#/definitions/NumberOrString"
}
},
"additionalProperties": true
},
"NotificationNoParam": {
"type": "object",
"properties": {
@ -1294,11 +1351,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"cursor": {
"type": [
@ -1322,11 +1382,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"message": {
"description": "An optional message describing the current progress.",
@ -1397,11 +1460,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"inputResponses": {
"description": "Client responses to server-initiated input requests from a previous\n[`InputRequiredResult`].",
@ -1641,6 +1707,28 @@
"params"
]
},
"RequestMetaObject": {
"description": "Metadata reserved by MCP on requests. Extension keys are also allowed.",
"type": "object",
"properties": {
"io.modelcontextprotocol/clientCapabilities": {
"$ref": "#/definitions/ClientCapabilities"
},
"io.modelcontextprotocol/clientInfo": {
"$ref": "#/definitions/Implementation"
},
"io.modelcontextprotocol/logLevel": {
"$ref": "#/definitions/LoggingLevel"
},
"io.modelcontextprotocol/protocolVersion": {
"type": "string"
},
"progressToken": {
"$ref": "#/definitions/ProgressToken"
}
},
"additionalProperties": true
},
"RequestNoParam": {
"type": "object",
"properties": {
@ -1763,11 +1851,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this resource.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this resource.",
@ -1841,11 +1932,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"mimeType": {
"type": [
@ -1869,11 +1963,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"blob": {
"type": "string"
@ -1925,11 +2022,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"name": {
"type": [
@ -2116,11 +2216,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"level": {
"description": "The desired logging level",
@ -2147,11 +2250,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"uri": {
"description": "The URI of the resource to subscribe to",
@ -2252,11 +2358,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"createdAt": {
"description": "ISO-8601 creation timestamp.",
@ -2347,11 +2456,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -2378,11 +2490,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"content": {
"type": "array",
@ -2412,11 +2527,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"id": {
"type": "string"
@ -2459,11 +2577,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"uri": {
"description": "The URI of the resource to unsubscribe from",

View file

@ -86,11 +86,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -128,11 +131,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"arguments": {
"description": "Arguments to pass to the tool (must match the tool's input schema)",
@ -187,11 +193,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"taskId": {
"type": "string"
@ -210,11 +219,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"reason": {
"type": [
@ -334,11 +346,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"argument": {
"$ref": "#/definitions/ArgumentInfo"
@ -474,11 +489,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"content": {
"description": "The actual content of the message (text, image, audio, tool use, or tool result)",
@ -550,11 +568,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this result.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"action": {
"description": "The user's decision on how to handle the elicitation request",
@ -638,11 +659,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -727,11 +751,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"arguments": {
"type": [
@ -773,11 +800,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"taskId": {
"type": "string"
@ -797,11 +827,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"taskId": {
"type": "string"
@ -873,11 +906,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -952,11 +988,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"capabilities": {
"description": "The capabilities this client supports (sampling, roots, etc.)",
@ -1169,11 +1208,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"roots": {
"type": "array",
@ -1212,6 +1254,11 @@
"emergency"
]
},
"MetaObject": {
"description": "See [specification/draft/basic/index#general-fields] for notes on _meta usage.",
"type": "object",
"additionalProperties": true
},
"Notification": {
"type": "object",
"properties": {
@ -1257,6 +1304,16 @@
"params"
]
},
"NotificationMetaObject": {
"description": "Metadata reserved by MCP on notifications. Extension keys are also allowed.",
"type": "object",
"properties": {
"io.modelcontextprotocol/subscriptionId": {
"$ref": "#/definitions/NumberOrString"
}
},
"additionalProperties": true
},
"NotificationNoParam": {
"type": "object",
"properties": {
@ -1294,11 +1351,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"cursor": {
"type": [
@ -1322,11 +1382,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"message": {
"description": "An optional message describing the current progress.",
@ -1397,11 +1460,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"inputResponses": {
"description": "Client responses to server-initiated input requests from a previous\n[`InputRequiredResult`].",
@ -1641,6 +1707,28 @@
"params"
]
},
"RequestMetaObject": {
"description": "Metadata reserved by MCP on requests. Extension keys are also allowed.",
"type": "object",
"properties": {
"io.modelcontextprotocol/clientCapabilities": {
"$ref": "#/definitions/ClientCapabilities"
},
"io.modelcontextprotocol/clientInfo": {
"$ref": "#/definitions/Implementation"
},
"io.modelcontextprotocol/logLevel": {
"$ref": "#/definitions/LoggingLevel"
},
"io.modelcontextprotocol/protocolVersion": {
"type": "string"
},
"progressToken": {
"$ref": "#/definitions/ProgressToken"
}
},
"additionalProperties": true
},
"RequestNoParam": {
"type": "object",
"properties": {
@ -1763,11 +1851,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this resource.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this resource.",
@ -1841,11 +1932,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"mimeType": {
"type": [
@ -1869,11 +1963,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"blob": {
"type": "string"
@ -1925,11 +2022,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"name": {
"type": [
@ -2116,11 +2216,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"level": {
"description": "The desired logging level",
@ -2147,11 +2250,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"uri": {
"description": "The URI of the resource to subscribe to",
@ -2252,11 +2358,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"createdAt": {
"description": "ISO-8601 creation timestamp.",
@ -2347,11 +2456,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -2378,11 +2490,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"content": {
"type": "array",
@ -2412,11 +2527,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"id": {
"type": "string"
@ -2459,11 +2577,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"uri": {
"description": "The URI of the resource to unsubscribe from",

View file

@ -76,11 +76,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -171,11 +174,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this result",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"content": {
"description": "The content returned by the tool (text, images, etc.)",
@ -211,11 +217,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"createdAt": {
"description": "ISO-8601 creation timestamp.",
@ -279,11 +288,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"reason": {
"type": [
@ -303,15 +315,89 @@
}
}
},
"CompleteResult": {
"ClientCapabilities": {
"title": "Builder",
"description": "```rust\n# use rmcp::model::ClientCapabilities;\nlet cap = ClientCapabilities::builder()\n .enable_experimental()\n .build();\n```",
"type": "object",
"properties": {
"_meta": {
"elicitation": {
"description": "Capability to handle elicitation requests from servers for interactive user input",
"anyOf": [
{
"$ref": "#/definitions/ElicitationCapability"
},
{
"type": "null"
}
]
},
"experimental": {
"type": [
"object",
"null"
],
"additionalProperties": true
"additionalProperties": {
"type": "object",
"additionalProperties": true
}
},
"extensions": {
"description": "Optional MCP extensions that the client supports (SEP-1724).\nKeys are extension identifiers (e.g., `\"io.modelcontextprotocol/ui\"`),\nvalues are per-extension settings objects. An empty object indicates\nsupport with no settings.",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "object",
"additionalProperties": true
}
},
"roots": {
"description": "Capability for filesystem roots (deprecated by SEP-2577).",
"anyOf": [
{
"$ref": "#/definitions/RootsCapabilities"
},
{
"type": "null"
}
]
},
"sampling": {
"description": "Capability for LLM sampling requests (SEP-1577, deprecated by SEP-2577).",
"anyOf": [
{
"$ref": "#/definitions/SamplingCapability"
},
{
"type": "null"
}
]
},
"tasks": {
"anyOf": [
{
"$ref": "#/definitions/TasksCapability"
},
{
"type": "null"
}
]
}
}
},
"CompleteResult": {
"type": "object",
"properties": {
"_meta": {
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"completion": {
"$ref": "#/definitions/CompletionInfo"
@ -495,11 +581,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"includeContext": {
"description": "How much context to include from MCP servers",
@ -608,11 +697,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"task": {
"$ref": "#/definitions/Task"
@ -658,11 +750,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"message": {
"type": "string"
@ -685,11 +780,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"elicitationId": {
"type": "string"
@ -716,11 +814,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"message": {
"type": "string"
@ -742,11 +843,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this result.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"action": {
"description": "The user's decision on how to handle the elicitation request",
@ -784,6 +888,34 @@
}
]
},
"ElicitationCapability": {
"description": "Elicitation allows servers to request interactive input from users during tool execution.\nThis capability indicates that a client can handle elicitation requests and present\nappropriate UI to users for collecting the requested information.",
"type": "object",
"properties": {
"form": {
"description": "Whether client supports form-based elicitation.",
"anyOf": [
{
"$ref": "#/definitions/FormElicitationCapability"
},
{
"type": "null"
}
]
},
"url": {
"description": "Whether client supports URL-based elicitation.",
"anyOf": [
{
"$ref": "#/definitions/UrlElicitationCapability"
},
{
"type": "null"
}
]
}
}
},
"ElicitationCreateRequestMethod": {
"type": "string",
"format": "const",
@ -856,11 +988,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -935,15 +1070,31 @@
"message"
]
},
"FormElicitationCapability": {
"description": "Capability for handling elicitation requests from servers.\nElicitation allows servers to request interactive input from users during tool execution.\nThis capability indicates that a client can handle elicitation requests and present\nappropriate UI to users for collecting the requested information.\n\nCapability for form mode elicitation.",
"type": "object",
"properties": {
"schemaValidation": {
"description": "Whether the client supports JSON Schema validation for elicitation responses.\nWhen true, the client will validate user input against the requested_schema\nbefore sending the response back to the server.",
"type": [
"boolean",
"null"
]
}
}
},
"GetPromptResult": {
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"description": {
"type": [
@ -979,11 +1130,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"createdAt": {
"description": "ISO-8601 creation timestamp.",
@ -1100,11 +1254,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -1178,11 +1335,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"capabilities": {
"description": "The capabilities this server provides (tools, resources, prompts, etc.)",
@ -1257,11 +1417,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"inputRequests": {
"description": "Server-initiated requests that the client must fulfill before retrying.",
@ -1524,11 +1687,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"cacheScope": {
"description": "Scope describing who may cache this result (SEP-2549).\nRequired by spec version 2026-07-28, but optional here to maintain compatibility\nwith older spec versions.",
@ -1580,11 +1746,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"cacheScope": {
"description": "Scope describing who may cache this result (SEP-2549).\nRequired by spec version 2026-07-28, but optional here to maintain compatibility\nwith older spec versions.",
@ -1636,11 +1805,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"cacheScope": {
"description": "Scope describing who may cache this result (SEP-2549).\nRequired by spec version 2026-07-28, but optional here to maintain compatibility\nwith older spec versions.",
@ -1697,11 +1869,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"nextCursor": {
"type": [
@ -1724,11 +1899,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"cacheScope": {
"description": "Scope describing who may cache this result (SEP-2549).\nRequired by spec version 2026-07-28, but optional here to maintain compatibility\nwith older spec versions.",
@ -1801,11 +1979,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"data": {
"description": "The actual log data"
@ -1832,6 +2013,11 @@
"data"
]
},
"MetaObject": {
"description": "See [specification/draft/basic/index#general-fields] for notes on _meta usage.",
"type": "object",
"additionalProperties": true
},
"ModelHint": {
"description": "A hint suggesting a preferred model name or family.\n\nModel hints are advisory suggestions that help clients choose appropriate\nmodels. They can be specific model names or general families like \"claude\" or \"gpt\".",
"type": "object",
@ -1973,6 +2159,16 @@
"params"
]
},
"NotificationMetaObject": {
"description": "Metadata reserved by MCP on notifications. Extension keys are also allowed.",
"type": "object",
"properties": {
"io.modelcontextprotocol/subscriptionId": {
"$ref": "#/definitions/NumberOrString"
}
},
"additionalProperties": true
},
"NotificationNoParam": {
"type": "object",
"properties": {
@ -2140,11 +2336,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"message": {
"description": "An optional message describing the current progress.",
@ -2188,11 +2387,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"arguments": {
"type": [
@ -2303,11 +2505,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"cacheScope": {
"description": "Scope describing who may cache this result (SEP-2549).\nRequired by spec version 2026-07-28, but optional here to maintain compatibility\nwith older spec versions.",
@ -2382,6 +2587,28 @@
"params"
]
},
"RequestMetaObject": {
"description": "Metadata reserved by MCP on requests. Extension keys are also allowed.",
"type": "object",
"properties": {
"io.modelcontextprotocol/clientCapabilities": {
"$ref": "#/definitions/ClientCapabilities"
},
"io.modelcontextprotocol/clientInfo": {
"$ref": "#/definitions/Implementation"
},
"io.modelcontextprotocol/logLevel": {
"$ref": "#/definitions/LoggingLevel"
},
"io.modelcontextprotocol/protocolVersion": {
"type": "string"
},
"progressToken": {
"$ref": "#/definitions/ProgressToken"
}
},
"additionalProperties": true
},
"RequestNoParam": {
"type": "object",
"properties": {
@ -2410,11 +2637,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this resource.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this resource.",
@ -2488,11 +2718,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"mimeType": {
"type": [
@ -2516,11 +2749,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"blob": {
"type": "string"
@ -2553,11 +2789,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this resource template.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this template.",
@ -2625,11 +2864,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"uri": {
"description": "The URI of the resource that was updated",
@ -2676,6 +2918,40 @@
}
]
},
"RootsCapabilities": {
"description": "Roots capability. Deprecated by SEP-2577; remains functional and will be\nremoved in a future release.\nSee <https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577>.",
"type": "object",
"properties": {
"listChanged": {
"type": [
"boolean",
"null"
]
}
}
},
"SamplingCapability": {
"description": "Sampling capability with optional sub-capabilities (SEP-1577).\n\nDeprecated by SEP-2577; remains functional and will be removed in a future\nrelease.\nSee <https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577>.",
"type": "object",
"properties": {
"context": {
"description": "Support for `includeContext` (soft-deprecated)",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"tools": {
"description": "Support for `tools` and `toolChoice` parameters",
"type": [
"object",
"null"
],
"additionalProperties": true
}
}
},
"SamplingContent": {
"description": "Single or array content wrapper (SEP-1577).",
"anyOf": [
@ -2695,11 +2971,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"content": {
"description": "The actual content of the message (text, image, audio, tool use, or tool result)",
@ -3226,11 +3505,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"createdAt": {
"description": "ISO-8601 creation timestamp.",
@ -3341,11 +3623,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -3478,11 +3763,14 @@
"properties": {
"_meta": {
"description": "Optional additional metadata for this tool",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional additional tool information.",
@ -3658,11 +3946,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"content": {
"type": "array",
@ -3692,11 +3983,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"id": {
"type": "string"
@ -3848,6 +4142,10 @@
"type",
"enum"
]
},
"UrlElicitationCapability": {
"description": "Capability for URL mode elicitation.",
"type": "object"
}
}
}

View file

@ -76,11 +76,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -171,11 +174,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this result",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"content": {
"description": "The content returned by the tool (text, images, etc.)",
@ -211,11 +217,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"createdAt": {
"description": "ISO-8601 creation timestamp.",
@ -279,11 +288,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"reason": {
"type": [
@ -303,15 +315,89 @@
}
}
},
"CompleteResult": {
"ClientCapabilities": {
"title": "Builder",
"description": "```rust\n# use rmcp::model::ClientCapabilities;\nlet cap = ClientCapabilities::builder()\n .enable_experimental()\n .build();\n```",
"type": "object",
"properties": {
"_meta": {
"elicitation": {
"description": "Capability to handle elicitation requests from servers for interactive user input",
"anyOf": [
{
"$ref": "#/definitions/ElicitationCapability"
},
{
"type": "null"
}
]
},
"experimental": {
"type": [
"object",
"null"
],
"additionalProperties": true
"additionalProperties": {
"type": "object",
"additionalProperties": true
}
},
"extensions": {
"description": "Optional MCP extensions that the client supports (SEP-1724).\nKeys are extension identifiers (e.g., `\"io.modelcontextprotocol/ui\"`),\nvalues are per-extension settings objects. An empty object indicates\nsupport with no settings.",
"type": [
"object",
"null"
],
"additionalProperties": {
"type": "object",
"additionalProperties": true
}
},
"roots": {
"description": "Capability for filesystem roots (deprecated by SEP-2577).",
"anyOf": [
{
"$ref": "#/definitions/RootsCapabilities"
},
{
"type": "null"
}
]
},
"sampling": {
"description": "Capability for LLM sampling requests (SEP-1577, deprecated by SEP-2577).",
"anyOf": [
{
"$ref": "#/definitions/SamplingCapability"
},
{
"type": "null"
}
]
},
"tasks": {
"anyOf": [
{
"$ref": "#/definitions/TasksCapability"
},
{
"type": "null"
}
]
}
}
},
"CompleteResult": {
"type": "object",
"properties": {
"_meta": {
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"completion": {
"$ref": "#/definitions/CompletionInfo"
@ -495,11 +581,14 @@
"properties": {
"_meta": {
"description": "Protocol-level metadata for this request (SEP-1319)",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"includeContext": {
"description": "How much context to include from MCP servers",
@ -608,11 +697,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"task": {
"$ref": "#/definitions/Task"
@ -658,11 +750,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"message": {
"type": "string"
@ -685,11 +780,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"elicitationId": {
"type": "string"
@ -716,11 +814,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/RequestMetaObject"
},
{
"type": "null"
}
]
},
"message": {
"type": "string"
@ -742,11 +843,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this result.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"action": {
"description": "The user's decision on how to handle the elicitation request",
@ -784,6 +888,34 @@
}
]
},
"ElicitationCapability": {
"description": "Elicitation allows servers to request interactive input from users during tool execution.\nThis capability indicates that a client can handle elicitation requests and present\nappropriate UI to users for collecting the requested information.",
"type": "object",
"properties": {
"form": {
"description": "Whether client supports form-based elicitation.",
"anyOf": [
{
"$ref": "#/definitions/FormElicitationCapability"
},
{
"type": "null"
}
]
},
"url": {
"description": "Whether client supports URL-based elicitation.",
"anyOf": [
{
"$ref": "#/definitions/UrlElicitationCapability"
},
{
"type": "null"
}
]
}
}
},
"ElicitationCreateRequestMethod": {
"type": "string",
"format": "const",
@ -856,11 +988,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -935,15 +1070,31 @@
"message"
]
},
"FormElicitationCapability": {
"description": "Capability for handling elicitation requests from servers.\nElicitation allows servers to request interactive input from users during tool execution.\nThis capability indicates that a client can handle elicitation requests and present\nappropriate UI to users for collecting the requested information.\n\nCapability for form mode elicitation.",
"type": "object",
"properties": {
"schemaValidation": {
"description": "Whether the client supports JSON Schema validation for elicitation responses.\nWhen true, the client will validate user input against the requested_schema\nbefore sending the response back to the server.",
"type": [
"boolean",
"null"
]
}
}
},
"GetPromptResult": {
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"description": {
"type": [
@ -979,11 +1130,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"createdAt": {
"description": "ISO-8601 creation timestamp.",
@ -1100,11 +1254,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -1178,11 +1335,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"capabilities": {
"description": "The capabilities this server provides (tools, resources, prompts, etc.)",
@ -1257,11 +1417,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"inputRequests": {
"description": "Server-initiated requests that the client must fulfill before retrying.",
@ -1524,11 +1687,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"cacheScope": {
"description": "Scope describing who may cache this result (SEP-2549).\nRequired by spec version 2026-07-28, but optional here to maintain compatibility\nwith older spec versions.",
@ -1580,11 +1746,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"cacheScope": {
"description": "Scope describing who may cache this result (SEP-2549).\nRequired by spec version 2026-07-28, but optional here to maintain compatibility\nwith older spec versions.",
@ -1636,11 +1805,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"cacheScope": {
"description": "Scope describing who may cache this result (SEP-2549).\nRequired by spec version 2026-07-28, but optional here to maintain compatibility\nwith older spec versions.",
@ -1697,11 +1869,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"nextCursor": {
"type": [
@ -1724,11 +1899,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"cacheScope": {
"description": "Scope describing who may cache this result (SEP-2549).\nRequired by spec version 2026-07-28, but optional here to maintain compatibility\nwith older spec versions.",
@ -1801,11 +1979,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"data": {
"description": "The actual log data"
@ -1832,6 +2013,11 @@
"data"
]
},
"MetaObject": {
"description": "See [specification/draft/basic/index#general-fields] for notes on _meta usage.",
"type": "object",
"additionalProperties": true
},
"ModelHint": {
"description": "A hint suggesting a preferred model name or family.\n\nModel hints are advisory suggestions that help clients choose appropriate\nmodels. They can be specific model names or general families like \"claude\" or \"gpt\".",
"type": "object",
@ -1973,6 +2159,16 @@
"params"
]
},
"NotificationMetaObject": {
"description": "Metadata reserved by MCP on notifications. Extension keys are also allowed.",
"type": "object",
"properties": {
"io.modelcontextprotocol/subscriptionId": {
"$ref": "#/definitions/NumberOrString"
}
},
"additionalProperties": true
},
"NotificationNoParam": {
"type": "object",
"properties": {
@ -2140,11 +2336,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"message": {
"description": "An optional message describing the current progress.",
@ -2188,11 +2387,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"arguments": {
"type": [
@ -2303,11 +2505,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"cacheScope": {
"description": "Scope describing who may cache this result (SEP-2549).\nRequired by spec version 2026-07-28, but optional here to maintain compatibility\nwith older spec versions.",
@ -2382,6 +2587,28 @@
"params"
]
},
"RequestMetaObject": {
"description": "Metadata reserved by MCP on requests. Extension keys are also allowed.",
"type": "object",
"properties": {
"io.modelcontextprotocol/clientCapabilities": {
"$ref": "#/definitions/ClientCapabilities"
},
"io.modelcontextprotocol/clientInfo": {
"$ref": "#/definitions/Implementation"
},
"io.modelcontextprotocol/logLevel": {
"$ref": "#/definitions/LoggingLevel"
},
"io.modelcontextprotocol/protocolVersion": {
"type": "string"
},
"progressToken": {
"$ref": "#/definitions/ProgressToken"
}
},
"additionalProperties": true
},
"RequestNoParam": {
"type": "object",
"properties": {
@ -2410,11 +2637,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this resource.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this resource.",
@ -2488,11 +2718,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"mimeType": {
"type": [
@ -2516,11 +2749,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"blob": {
"type": "string"
@ -2553,11 +2789,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this resource template.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this template.",
@ -2625,11 +2864,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"uri": {
"description": "The URI of the resource that was updated",
@ -2676,6 +2918,40 @@
}
]
},
"RootsCapabilities": {
"description": "Roots capability. Deprecated by SEP-2577; remains functional and will be\nremoved in a future release.\nSee <https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577>.",
"type": "object",
"properties": {
"listChanged": {
"type": [
"boolean",
"null"
]
}
}
},
"SamplingCapability": {
"description": "Sampling capability with optional sub-capabilities (SEP-1577).\n\nDeprecated by SEP-2577; remains functional and will be removed in a future\nrelease.\nSee <https://github.com/modelcontextprotocol/modelcontextprotocol/pull/2577>.",
"type": "object",
"properties": {
"context": {
"description": "Support for `includeContext` (soft-deprecated)",
"type": [
"object",
"null"
],
"additionalProperties": true
},
"tools": {
"description": "Support for `tools` and `toolChoice` parameters",
"type": [
"object",
"null"
],
"additionalProperties": true
}
}
},
"SamplingContent": {
"description": "Single or array content wrapper (SEP-1577).",
"anyOf": [
@ -2695,11 +2971,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"content": {
"description": "The actual content of the message (text, image, audio, tool use, or tool result)",
@ -3226,11 +3505,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/NotificationMetaObject"
},
{
"type": "null"
}
]
},
"createdAt": {
"description": "ISO-8601 creation timestamp.",
@ -3341,11 +3623,14 @@
"properties": {
"_meta": {
"description": "Optional protocol-level metadata for this content block.",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional annotations describing how the client should use this content.",
@ -3478,11 +3763,14 @@
"properties": {
"_meta": {
"description": "Optional additional metadata for this tool",
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"annotations": {
"description": "Optional additional tool information.",
@ -3658,11 +3946,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"content": {
"type": "array",
@ -3692,11 +3983,14 @@
"type": "object",
"properties": {
"_meta": {
"type": [
"object",
"null"
],
"additionalProperties": true
"anyOf": [
{
"$ref": "#/definitions/MetaObject"
},
{
"type": "null"
}
]
},
"id": {
"type": "string"
@ -3848,6 +4142,10 @@
"type",
"enum"
]
},
"UrlElicitationCapability": {
"description": "Capability for URL mode elicitation.",
"type": "object"
}
}
}

View file

@ -1,6 +1,8 @@
#![allow(deprecated)]
use rmcp::model::{ClientCapabilities, Implementation, LoggingLevel, Meta, ProtocolVersion};
use rmcp::model::{
ClientCapabilities, Implementation, LoggingLevel, ProtocolVersion, RequestMetaObject,
};
use serde_json::json;
const META_KEY_PROTOCOL_VERSION: &str = "io.modelcontextprotocol/protocolVersion";
@ -10,7 +12,7 @@ const META_KEY_LOG_LEVEL: &str = "io.modelcontextprotocol/logLevel";
#[test]
fn meta_setters_store_sep_2575_values() {
let mut meta = Meta::new();
let mut meta = RequestMetaObject::new();
meta.set_protocol_version(ProtocolVersion::V_2026_07_28);
meta.set_client_info(Implementation::new("test-client", "1.0.0"));
meta.set_client_capabilities(ClientCapabilities::default());
@ -30,7 +32,7 @@ fn meta_setters_store_sep_2575_values() {
#[test]
fn meta_accessors_decode_wire_values() {
let meta: Meta = serde_json::from_value(json!({
let meta: RequestMetaObject = serde_json::from_value(json!({
"progressToken": "progress-1",
"io.modelcontextprotocol/protocolVersion": "2026-07-28",
"io.modelcontextprotocol/clientInfo": {
@ -58,7 +60,7 @@ fn meta_accessors_decode_wire_values() {
#[test]
fn meta_accessors_ignore_missing_or_malformed_values() {
let meta: Meta = serde_json::from_value(json!({
let meta: RequestMetaObject = serde_json::from_value(json!({
"io.modelcontextprotocol/protocolVersion": 20260728,
"io.modelcontextprotocol/clientInfo": "not an implementation",
"io.modelcontextprotocol/clientCapabilities": "not capabilities",

View file

@ -3,7 +3,9 @@ use futures::StreamExt;
use rmcp::{
ClientHandler, Peer, RoleServer, ServerHandler, ServiceExt,
handler::{client::progress::ProgressDispatcher, server::tool::ToolRouter},
model::{CallToolRequestParams, ClientRequest, Meta, ProgressNotificationParam, Request},
model::{
CallToolRequestParams, ClientRequest, ProgressNotificationParam, Request, RequestMetaObject,
},
service::PeerRequestOptions,
tool, tool_handler, tool_router,
};
@ -61,7 +63,7 @@ impl Default for MyServer {
impl MyServer {
#[tool]
pub async fn some_progress(
meta: Meta,
meta: RequestMetaObject,
client: Peer<RoleServer>,
) -> Result<(), rmcp::ErrorData> {
let progress_token = meta

View file

@ -11,8 +11,8 @@ use std::{
use rmcp::{
ClientHandler, Peer, RoleServer, ServiceError, ServiceExt,
model::{
CallToolRequestParams, ClientRequest, Meta, NumberOrString, ProgressNotificationParam,
ProgressToken, Request,
CallToolRequestParams, ClientRequest, NumberOrString, ProgressNotificationParam,
ProgressToken, Request, RequestMetaObject,
},
service::PeerRequestOptions,
tool, tool_router,
@ -46,7 +46,7 @@ impl ProgressTimeoutServer {
#[tool]
async fn delayed_with_progress(
&self,
meta: Meta,
meta: RequestMetaObject,
client: Peer<RoleServer>,
) -> Result<(), rmcp::ErrorData> {
let progress_token = meta
@ -173,7 +173,7 @@ async fn generated_progress_token_overrides_option_meta_token() -> anyhow::Resul
let client = start_pair().await?;
let mut options =
PeerRequestOptions::with_timeout(Duration::from_millis(75)).reset_timeout_on_progress();
options.meta = Some(Meta::with_progress_token(ProgressToken(
options.meta = Some(RequestMetaObject::with_progress_token(ProgressToken(
NumberOrString::Number(999_999),
)));

View file

@ -1,10 +1,10 @@
use rmcp::model::{CallToolResult, ContentBlock, Meta};
use rmcp::model::{CallToolResult, ContentBlock, MetaObject};
use serde_json::{Value, json};
#[test]
fn serialize_tool_result_with_meta() {
let content = vec![ContentBlock::text("ok")];
let mut meta = Meta::new();
let mut meta = MetaObject::new();
meta.insert("foo".to_string(), json!("bar"));
let result = CallToolResult::success(content).with_meta(Some(meta));
let v = serde_json::to_value(&result).unwrap();

View file

@ -4,7 +4,7 @@ use std::sync::Arc;
use rmcp::{
RoleServer, ServerHandler, ServiceExt,
model::{ClientRequest, CustomRequest, CustomResult, Meta},
model::{ClientRequest, CustomRequest, CustomResult, RequestMetaObject},
service::{PeerRequestOptions, RequestContext},
};
use serde_json::json;
@ -17,7 +17,7 @@ const BAGGAGE: &str = "userId=alice,region=us-east-1";
/// Records the `_meta` it receives on the incoming request so the test can assert passthrough.
struct TraceCapturingServer {
receive_signal: Arc<Notify>,
seen: Arc<Mutex<Option<Meta>>>,
seen: Arc<Mutex<Option<RequestMetaObject>>>,
}
impl ServerHandler for TraceCapturingServer {
@ -56,7 +56,7 @@ async fn trace_context_meta_survives_round_trip() -> anyhow::Result<()> {
let client = ().serve(client_transport).await?;
// Client attaches trace context to the outgoing request's `_meta`.
let mut meta = Meta::new();
let mut meta = RequestMetaObject::new();
meta.set_traceparent(TRACEPARENT);
meta.set_tracestate(TRACESTATE);
meta.set_baggage(BAGGAGE);