feat(model): add ServerConfig and ClientConfig (#1266)

This commit is contained in:
Dale Seo 2026-09-14 15:30:41 -04:00 • committed by GitHub
commit 165ff92df1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -5,8 +5,8 @@ use std::{collections::BTreeSet, process::Stdio, time::Duration};
use rmcp::{
ErrorData as McpError, ServerHandler, ServiceExt,
model::{
CallToolRequestParams, CallToolResponse, CallToolResult, ContentBlock, InitializeResult,
ServerCapabilities,
CallToolRequestParams, CallToolResponse, CallToolResult, ContentBlock, ServerCapabilities,
ServerConfig,
},
};
use serde_json::{Value, json};
@ -82,8 +82,8 @@ struct LargeResponseServer;
impl ServerHandler for LargeResponseServer {
#[allow(deprecated)]
fn get_info(&self) -> InitializeResult {
InitializeResult::new(ServerCapabilities::builder().enable_tools().build())
fn get_info(&self) -> ServerConfig {
ServerConfig::new(ServerCapabilities::builder().enable_tools().build())
}
async fn call_tool(