feat(model): add ServerConfig and ClientConfig (#1266)
This commit is contained in:
parent
fbfc5cc96e
commit
165ff92df1
1 changed files with 331 additions and 303 deletions
|
|
@ -8,7 +8,7 @@ use std::borrow::Cow;
|
|||
|
||||
use rmcp::{
|
||||
ServerHandler,
|
||||
model::{Implementation, InitializeResult, ProtocolVersion, ServerCapabilities},
|
||||
model::{Implementation, ProtocolVersion, ServerCapabilities, ServerConfig},
|
||||
transport::streamable_http_server::{
|
||||
StreamableHttpServerConfig, StreamableHttpService, session::local::LocalSessionManager,
|
||||
},
|
||||
|
|
@ -20,8 +20,8 @@ use tokio_util::sync::CancellationToken;
|
|||
struct DiscoveryServer;
|
||||
|
||||
impl ServerHandler for DiscoveryServer {
|
||||
fn get_info(&self) -> InitializeResult {
|
||||
InitializeResult::new(ServerCapabilities::builder().enable_tools().build())
|
||||
fn get_info(&self) -> ServerConfig {
|
||||
ServerConfig::new(ServerCapabilities::builder().enable_tools().build())
|
||||
.with_server_info(Implementation::new("discovery-server", "1.0.0"))
|
||||
.with_instructions("Use the tools carefully")
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue