mcp_smart_auth_middleware

Function mcp_smart_auth_middleware 

Source
pub async fn mcp_smart_auth_middleware(
    __arg0: State<AppState>,
    req: Request<Body>,
    next: Next,
) -> Result<impl IntoResponse, ServerError>
Expand description

Smart authentication middleware for MCP requests that handles protocol vs tool methods differently Protocol methods (initialize, tools/list, prompts/list, prompts/get) don’t require namespace validation Tool methods (tools/call) require namespace validation