rs-fast-mcp 0.2.0

High-performance, async-first Rust implementation of the Model Context Protocol (MCP)
Documentation
use crate::client::auth::AuthHandler;
use crate::error::FastMCPError;
use async_trait::async_trait;

pub struct BearerAuth {
    token: String,
}

impl BearerAuth {
    pub fn new(token: String) -> Self {
        Self { token }
    }
}

#[async_trait]
impl AuthHandler for BearerAuth {
    async fn get_auth_header(&self) -> Result<Option<String>, FastMCPError> {
        Ok(Some(format!("Bearer {}", self.token)))
    }
}