Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(mcp): handle unsupported server callbacks and auth headers

Steven Enamakele541ffa73e45
diff --git a/crates/openhuman-core/src/mcp/server/handler.rs b/crates/openhuman-core/src/mcp/server/handler.rs
index f76b58ec48..8c8484cbed 100644
--- a/crates/openhuman-core/src/mcp/server/handler.rs
+++ b/crates/openhuman-core/src/mcp/server/handler.rs
@@ -58,6 +58,9 @@ pub(super) async fn dispatch(call: ServerHostCall) -> ServerHostReply {
ServerHostCall::Unsupported => ServerHostReply::Internal {
message: "unsupported server callback".to_owned(),
},
+ _ => ServerHostReply::Internal {
+ message: "unsupported server callback".to_owned(),
+ },
}
}
diff --git a/crates/openhuman-core/src/mcp/server/http.rs b/crates/openhuman-core/src/mcp/server/http.rs
index b96eaa8e5c..0777af4431 100644
--- a/crates/openhuman-core/src/mcp/server/http.rs
+++ b/crates/openhuman-core/src/mcp/server/http.rs
@@ -215,7 +215,9 @@ async fn close_http_sessions(state: &HttpState) {
fn check_auth(state: &HttpState, headers: &HeaderMap) -> Option<Response> {
let expected = state.auth_token.as_deref()?;
- let provided = header_value(headers, AUTHORIZATION)
+ let provided = headers
+ .get(AUTHORIZATION)
+ .and_then(|value| value.to_str().ok())
.and_then(|value| value.strip_prefix("Bearer "))
.map(str::trim);
(provided != Some(expected)).then(|| {
diff --git a/crates/openhuman-core/src/mcp/server/module.rs b/crates/openhuman-core/src/mcp/server/module.rs
index cf3da62c42..1208b40f1b 100644
--- a/crates/openhuman-core/src/mcp/server/module.rs
+++ b/crates/openhuman-core/src/mcp/server/module.rs
@@ -343,6 +343,7 @@ impl ServerSession {
return Err(ServerError::Failed(message));
}
ServerOperationState::Unknown => return Err(ServerError::UnknownState),
+ _ => return Err(ServerError::UnknownState),
}
}
}