Skip to content

Commit c1a8eea

Browse files
chore(conformance): run against 0.2.0-alpha.12 (#1336)
* chore(conformance): run against 0.2.0-alpha.12 0.2.0-alpha.11 added the json-schema-2020-12-preservation client scenario. The conformance client does not handle it and exits with "Unsupported conformance scenario", so both client suites fail on it once CI moves past alpha.10. Handle the scenario as it asks: list tools, then send the inputSchema of json_schema_2020_12_tool back through json_schema_echo. rmcp keeps every keyword the scenario checks. Bump CONFORMANCE_VERSION to alpha.12. * chore(conformance): fail the schema preservation run on a tool error The json_schema_echo result was dropped, so a tool-level error still let the client exit 0. Check is_error so local runs fail loudly.
1 parent 4048ac4 commit c1a8eea

2 files changed

Lines changed: 35 additions & 1 deletion

File tree

‎.github/workflows/conformance.yml‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ concurrency:
1212
cancel-in-progress: true
1313

1414
env:
15-
CONFORMANCE_VERSION: "0.2.0-alpha.10"
15+
CONFORMANCE_VERSION: "0.2.0-alpha.12"
1616

1717
permissions:
1818
contents: read

‎conformance/src/bin/client.rs‎

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -993,6 +993,37 @@ async fn run_elicitation_defaults_client(server_url: &str) -> anyhow::Result<()>
993993
Ok(())
994994
}
995995

996+
/// SEP-1613/SEP-2106: send the focal tool's `inputSchema` back through the
997+
/// echo tool, so the scenario can diff it against what the server listed.
998+
async fn run_json_schema_preservation_client(server_url: &str) -> anyhow::Result<()> {
999+
let transport = StreamableHttpClientTransport::from_uri(server_url);
1000+
let client = FullClientHandler
1001+
.serve_with_lifecycle(transport, conformance_lifecycle())
1002+
.await?;
1003+
let tools = client.list_tools(Default::default()).await?;
1004+
let tool = tools
1005+
.tools
1006+
.iter()
1007+
.find(|t| t.name.as_ref() == "json_schema_2020_12_tool")
1008+
.ok_or_else(|| anyhow::anyhow!("json_schema_2020_12_tool was not listed"))?;
1009+
let mut args = serde_json::Map::new();
1010+
args.insert(
1011+
"schema".to_string(),
1012+
Value::Object(tool.input_schema.as_ref().clone()),
1013+
);
1014+
let result = client
1015+
.call_tool(call_tool_params("json_schema_echo".into(), Some(args)))
1016+
.await?;
1017+
if result.is_error == Some(true) {
1018+
anyhow::bail!(
1019+
"json_schema_echo returned a tool error: {:?}",
1020+
result.content
1021+
);
1022+
}
1023+
client.cancel().await?;
1024+
Ok(())
1025+
}
1026+
9961027
fn conformance_protocol_version() -> ProtocolVersion {
9971028
std::env::var("MCP_CONFORMANCE_PROTOCOL_VERSION")
9981029
.ok()
@@ -1115,6 +1146,9 @@ async fn run_scenario(
11151146
// close is sufficient; the scenario's mock server does not implement
11161147
// the discover lifecycle, so `run_discover_client` hangs against it.
11171148
"json-schema-ref-no-deref" => run_basic_client(server_url).await?,
1149+
"json-schema-2020-12-preservation" => {
1150+
run_json_schema_preservation_client(server_url).await?
1151+
}
11181152
"tools_call" => run_tools_call_client(server_url, ctx).await?,
11191153
"elicitation-sep1034-client-defaults" => {
11201154
run_elicitation_defaults_client(server_url).await?

0 commit comments

Comments
 (0)