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:
parent
b967c132ae
commit
a7e4ae3203
1 changed files with 2392 additions and 10 deletions
|
|
@ -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",
|
||||
))?;
|
||||
|
|
|
|||
Loading…
Reference in a new issue