feat: better http server support (#199)

* feat: better http server support

1. allow user get extensions in tool call.
2. allow user serve sse service without initialization.

* fix: fix document test
This commit is contained in:
4t145 2025-05-19 18:49:18 +08:00 • committed by GitHub
commit 076dc2c2cd
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,7 +3,7 @@
use std::sync::Arc;
use rmcp::{
ClientHandler, Peer, RoleClient, ServerHandler, ServiceExt,
ClientHandler, ServerHandler, ServiceExt,
handler::server::tool::ToolCallContext,
model::{CallToolRequestParam, ClientInfo},
tool,
@ -242,22 +242,12 @@ fn test_optional_field_schema_generation_via_macro() {
// Define a dummy client handler
#[derive(Debug, Clone, Default)]
struct DummyClientHandler {
peer: Option<Peer<RoleClient>>,
}
struct DummyClientHandler {}
impl ClientHandler for DummyClientHandler {
fn get_info(&self) -> ClientInfo {
ClientInfo::default()
}
fn set_peer(&mut self, peer: Peer<RoleClient>) {
self.peer = Some(peer);
}
fn get_peer(&self) -> Option<Peer<RoleClient>> {
self.peer.clone()
}
}
#[tokio::test]