Skip to main content
Glama
smatiolids
by smatiolids
auth.py1.2 kB
import time from typing import Any from fastmcp.server.auth.providers.jwt import AccessToken, TokenVerifier from .logger import get_logger import os logger = get_logger("auth") class AstraAuth(TokenVerifier): """ Astra auth for testing and development. """ def __init__( self, token: str ): """ Initialize the Astra auth. Args: token: Dict mapping token strings to token metadata Each token should have: client_id, scopes, expires_at (optional) """ super().__init__() self.token = token async def verify_token(self, token: str) -> AccessToken | None: """Verify token against Astra token dictionary.""" logger.info(f"Token: {token}") token_env = os.getenv("AGENTIC_ASTRA_TOKEN") or os.getenv("ASTRA_MCP_SERVER_TOKEN") if token != token_env: return None logger.info(f"Token successfully verified: {token}") return AccessToken( token=token, client_id="agentic-astra", scopes=["read:data"], expires_at=time.time() + 3600, claims={}, )

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/smatiolids/astra-mcp-server'

If you have feedback or need assistance with the MCP directory API, please join our Discord server