use rmcp::{
handler::server::ServerHandler,
model::{ServerCapabilities, ServerInfo},
};
use rmcp_server_kit::transport::{McpServerConfig, serve};
#[derive(Clone)]
struct MinimalHandler;
impl ServerHandler for MinimalHandler {
fn get_info(&self) -> ServerInfo {
ServerInfo::new(ServerCapabilities::builder().enable_tools().build())
}
}
#[tokio::main(flavor = "multi_thread", worker_threads = 2)]
async fn main() -> rmcp_server_kit::Result<()> {
let _ = rmcp_server_kit::observability::init_tracing("info,rmcp_server_kit=debug");
let config = McpServerConfig::new(
"127.0.0.1:8080",
"rmcp-server-kit-minimal-example",
env!("CARGO_PKG_VERSION"),
)
.with_request_timeout(std::time::Duration::from_secs(30))
.enable_request_header_logging();
serve(config.validate()?, || MinimalHandler).await
}