Skip to main content

Documentation Index

Fetch the complete documentation index at: https://mintlify.com/dvlpjrs/guMCP/llms.txt

Use this file to discover all available pages before exploring further.

Overview

BaseAuthClient is an abstract base class that defines the interface for authentication clients in guMCP. It uses Python generics to work with any type of credentials object. Source: src/auth/clients/BaseAuthClient.py:8

Class Definition

from typing import Dict, Any, Optional, TypeVar, Generic

CredentialsT = TypeVar("CredentialsT")

class BaseAuthClient(Generic[CredentialsT], abc.ABC):
    """Abstract base class for authentication clients."""

Methods

get_user_credentials

Retrieves user credentials for a specific service. Credentials returned are ready-to-use (e.g., access tokens are already refreshed). Source: src/auth/clients/BaseAuthClient.py:15
@abc.abstractmethod
def get_user_credentials(
    self, service_name: str, user_id: str
) -> Optional[CredentialsT]:
service_name
str
required
Name of the service (e.g., “gdrive”, “github”, “slack”)
user_id
str
required
Identifier for the user
return
Optional[CredentialsT]
Credentials object if found, None otherwise

get_oauth_config

Retrieves OAuth configuration for a specific service. Source: src/auth/clients/BaseAuthClient.py:30
def get_oauth_config(self, service_name: str) -> Dict[str, Any]:
service_name
str
required
Name of the service (e.g., “gdrive”, “github”, “slack”)
return
Dict[str, Any]
Dictionary containing OAuth configuration (client_id, client_secret, etc.)
This method is optional and raises NotImplementedError by default.

save_user_credentials

Saves user credentials after authentication or refresh. Source: src/auth/clients/BaseAuthClient.py:44
def save_user_credentials(
    self, service_name: str, user_id: str, credentials: CredentialsT
) -> None:
service_name
str
required
Name of the service (e.g., “gdrive”, “github”, “slack”)
user_id
str
required
Identifier for the user
credentials
CredentialsT
required
Credentials object to save
This method is optional and raises NotImplementedError by default.

Type Variables

CredentialsT
TypeVar
Generic type variable representing any type of credentials object

Implementation Notes

  • All implementations must override get_user_credentials() as it’s marked with @abc.abstractmethod
  • get_oauth_config() and save_user_credentials() are optional methods that should be implemented based on the client’s needs
  • The generic type CredentialsT allows flexibility in credential storage formats across different implementations

See Also

Build docs developers (and LLMs) love