"""{{ display_name }} MCP server — generated by mcpify. Do not hand-edit."""

from __future__ import annotations

from ..auth_strategy import AuthConfig, AuthStrategy, Credentials
from ..errors import MissingCredentialsError


class ApiKeyStrategy(AuthStrategy):
    async def authenticate(self, config: AuthConfig) -> Credentials:
        api_key = config.get("api_key")
        if not api_key:
            raise MissingCredentialsError("api_key")
        return {"api_key": api_key}

    def validate_credentials(self, credentials: Credentials) -> bool:
        return bool(credentials.get("api_key"))
