nat.plugins.mcp.auth.auth_provider_config#

Classes#

MCPOAuth2ProviderConfig

MCP OAuth2 provider with endpoints discovery, optional DCR, and authentication flow via the OAuth2AuthCodeFlow

Module Contents#

class MCPOAuth2ProviderConfig(/, **data: Any)#

Bases: nat.authentication.interfaces.AuthProviderBaseConfig

MCP OAuth2 provider with endpoints discovery, optional DCR, and authentication flow via the OAuth2AuthCodeFlow provider.

Supported modes:
  • Endpoints discovery + Dynamic Client Registration (DCR) (enable_dynamic_registration=True, no client_id)

  • Endpoints discovery + Manual Client Registration (client_id + client_secret provided)

Create a new model by parsing and validating input data from keyword arguments.

Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.

self is explicitly positional-only to allow self as a field name.

server_url: pydantic.HttpUrl = None#
client_id: str | None = None#
client_secret: str | None = None#
enable_dynamic_registration: bool = None#
client_name: str = None#
redirect_uri: pydantic.HttpUrl = None#
token_endpoint_auth_method: str = None#
scopes: list[str] = None#
use_pkce: bool = None#
default_user_id: str | None = None#
allow_default_user_id_for_tool_calls: bool = None#
token_storage_object_store: str | None = None#
validate_auth_config()#

Validate authentication configuration for MCP-specific options.