feat: mcp sdk conformance (#687)

* adds conformance server and client
* adds results from initial run of https://github.com/modelcontextprotocol/conformance/tree/main/.claude/skills/mcp-sdk-tier-audit skill
* various small changes applied during the testing loop

Co-authored-by: Dale Seo <5466341+DaleSeo@users.noreply.github.com>
This commit is contained in:
Alex Hancock 2026-02-26 13:33:18 -05:00 • committed by GitHub
commit a7e4ae3203
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -154,14 +154,16 @@ impl StreamableHttpPostResponse {
}
}
pub fn expect_accepted<E>(self) -> Result<(), StreamableHttpError<E>>
pub fn expect_accepted_or_json<E>(self) -> Result<(), StreamableHttpError<E>>
where
E: std::error::Error + Send + Sync + 'static,
{
match self {
Self::Accepted => Ok(()),
// Tolerate servers that return 200 with JSON for notifications
Self::Json(..) => Ok(()),
got => Err(StreamableHttpError::UnexpectedServerResponse(
format!("expect accepted, got {got:?}").into(),
format!("expect accepted or json, got {got:?}").into(),
)),
}
}
@ -410,7 +412,7 @@ impl<C: StreamableHttpClient> Worker for StreamableHttpClientWorker<C> {
.map_err(WorkerQuitReason::fatal_context(
"send initialized notification",
))?
.expect_accepted::<C::Error>()
.expect_accepted_or_json::<C::Error>()
.map_err(WorkerQuitReason::fatal_context(
"process initialized notification response",
))?;