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
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
pub mod keycloak;
pub mod scalekit;
pub mod work_os;

use rust_mcp_sdk::auth::Audience;

/// Resolves the audience used to validate a token's `aud` claim.
///
/// Audience validation is enabled by default: when no explicit audience is
/// provided, the resource identifier (`mcp_server_url`) is used. It is disabled
/// only when `disable` is set, which is strongly discouraged.
fn resolve_audience(disable: bool, explicit: Option<Audience>, resource: &str) -> Option<Audience> {
    if disable {
        None
    } else {
        Some(explicit.unwrap_or_else(|| Audience::Single(resource.to_string())))
    }
}