rust-mcp-extra 0.3.3

A companion crate to rust-mcp-sdk offering extra implementations of core traits like SessionStore and EventStore, enabling integration with various database backends and third-party platforms such as AWS Lambda for serverless and cloud-native MCP applications.
Documentation
use rust_mcp_sdk::{
    auth::AuthInfo,
    macros::{mcp_tool, JsonSchema},
    schema::{schema_utils::CallToolError, CallToolResult, TextContent},
};

//*******************************//
//  Show Authentication Info  //
//*******************************//
#[mcp_tool(
    name = "show_auth_info",
    description = "Shows current user authentication info in json format"
)]
#[derive(Debug, ::serde::Deserialize, ::serde::Serialize, JsonSchema, Default)]
pub struct ShowAuthInfo {}
impl ShowAuthInfo {
    pub fn call_tool(&self, auth_info: Option<AuthInfo>) -> Result<CallToolResult, CallToolError> {
        let auth_info_json = serde_json::to_string_pretty(&auth_info).map_err(|err| {
            CallToolError::from_message(format!("Undable to display auth info as string :{err}"))
        })?;
        Ok(CallToolResult::text_content(vec![TextContent::from(
            auth_info_json,
        )]))
    }
}