Update rmcp to 1.7.0 (#24763)

WIll make it easier to uprev when the new draft spec is supported.

Also updates reqwest where needed for compatibility but doesn't update
it everywhere since this is already a large diff.

The new version of rmcp handles certain kinds of authentication failures
differently, this patch includes support for identifying the failing scope
in a WWW-Authenticate header.
This commit is contained in:
Adam Perry @ OpenAI
2026-05-27 14:52:06 -07:00
committed by GitHub
parent c57dee98b7
commit 910578792f
50 changed files with 982 additions and 649 deletions

View File

@@ -6,17 +6,11 @@ use pretty_assertions::assert_eq;
use std::collections::BTreeMap;
fn mcp_tool(name: &str, description: &str, input_schema: serde_json::Value) -> rmcp::model::Tool {
rmcp::model::Tool {
name: name.to_string().into(),
title: None,
description: Some(description.to_string().into()),
input_schema: std::sync::Arc::new(rmcp::model::object(input_schema)),
output_schema: None,
annotations: None,
execution: None,
icons: None,
meta: None,
}
rmcp::model::Tool::new(
name.to_string(),
description.to_string(),
std::sync::Arc::new(rmcp::model::object(input_schema)),
)
}
#[test]

View File

@@ -87,11 +87,10 @@ fn dynamic_tool_to_responses_api_tool_preserves_defer_loading() {
#[test]
fn mcp_tool_to_deferred_responses_api_tool_sets_defer_loading() {
let tool = rmcp::model::Tool {
name: "lookup_order".to_string().into(),
title: None,
description: Some("Look up an order".to_string().into()),
input_schema: std::sync::Arc::new(rmcp::model::object(json!({
let tool = rmcp::model::Tool::new(
"lookup_order",
"Look up an order",
std::sync::Arc::new(rmcp::model::object(json!({
"type": "object",
"properties": {
"order_id": {"type": "string"}
@@ -99,12 +98,7 @@ fn mcp_tool_to_deferred_responses_api_tool_sets_defer_loading() {
"required": ["order_id"],
"additionalProperties": false,
}))),
output_schema: None,
annotations: None,
execution: None,
icons: None,
meta: None,
};
);
assert_eq!(
mcp_tool_to_deferred_responses_api_tool(

View File

@@ -201,17 +201,11 @@ fn convert_fixture_tool(
.as_object()
.unwrap_or_else(|| panic!("{name} input_schema should be an object"))
.clone();
let tool = rmcp::model::Tool {
name: name.to_string().into(),
title: None,
description: Some(fixture_tool.description.clone().into()),
input_schema: Arc::new(input_schema),
output_schema: None,
annotations: None,
execution: None,
icons: None,
meta: None,
};
let tool = rmcp::model::Tool::new(
name.to_string(),
fixture_tool.description.clone(),
Arc::new(input_schema),
);
mcp_tool_to_responses_api_tool(&ToolName::namespaced(&fixture.source, name), &tool)
.unwrap_or_else(|err| panic!("convert {name} from {}: {err}", fixture.source))