yera.config.schema.mcp

MCP server configuration schemas.

Symbols

class MCPConfig — Configured MCP server connections available for profile selection.
class MCPNoAuth — Declare that an MCP server requires no authentication.
class MCPOAuthAuth — Reference a stored OAuth authorization for an MCP server.
class MCPSecretHeadersAuth — Send HTTP headers whose values the connection keeps in the secret store.
class MCPServerConfig — Configuration required to connect to one MCP server.
class MCPStaticHeadersAuth — Reference credentials supplied as static HTTP headers.
def require_http_url — Require a complete HTTP endpoint for streamable MCP transport.

MCPConfig

Inherits: BaseModel

Configured MCP server connections available for profile selection.

Fields

servers
type: dict[str, yera.config.schema.mcp.MCPServerConfig] = <factory>

MCP server configurations keyed by their unique names.

MCPNoAuth

Inherits: BaseModel

Declare that an MCP server requires no authentication.

Fields

type
type: Literal['none'] = 'none'

Discriminator identifying an unauthenticated MCP connection.

MCPOAuthAuth

Inherits: BaseModel

Reference a stored OAuth authorization for an MCP server.

Fields

type
type: Literal['oauth'] = 'oauth'

Discriminator identifying OAuth authentication.

authorization_id
type: str (required)

Stable identity of the stored authorization.

client_profile
type: str | None = None

Optional predefined OAuth client configuration.

requested_scopes
type: tuple[str, ...] | None = None

Exact scopes deliberately requested during setup, or None when a legacy configuration uses profile defaults.

MCPSecretHeadersAuth

Inherits: BaseModel

Send HTTP headers whose values the connection keeps in the secret store.

Fields

type
type: Literal['secret_headers'] = 'secret_headers'

Discriminator identifying connection-owned header authentication.

secret_id
type: str (required)

Owner of the header values in Yera's secret store.

headers
type: list[str] (required)

Names of the headers sent with every request.

MCPServerConfig

Inherits: BaseModel

Configuration required to connect to one MCP server.

Fields

url
type: str (required)

Streamable HTTP endpoint exposed by the MCP server.

enabled
type: bool = True

Whether this server is available to Yera.

auth
type: yera.config.schema.mcp.MCPNoAuth | yera.config.schema.mcp.MCPStaticHeadersAuth | yera.config.schema.mcp.MCPSecretHeadersAuth | yera.config.schema.mcp.MCPOAuthAuth = <factory>

Authentication policy used for this server.

Methods

validate_http_url — Require a complete HTTP endpoint for streamable MCP transport.

MCPServerConfig.validate_http_url

validate_http_url(
    value: str,
) → str

Require a complete HTTP endpoint for streamable MCP transport.

Parameters

value
type: str

Candidate MCP server URL.

Returns

type: str

The validated HTTP URL.

MCPStaticHeadersAuth

Inherits: BaseModel

Reference credentials supplied as static HTTP headers.

Fields

type
type: Literal['headers'] = 'headers'

Discriminator identifying static-header authentication.

headers
type: dict[str, str] = <factory>

Mapping of HTTP header names to credential keys.

require_http_url

require_http_url(
    value: str,
) → str

Require a complete HTTP endpoint for streamable MCP transport.

Parameters

value
type: str

The endpoint to check.

Returns

type: str

The endpoint, unchanged.

Raises

ValueError

If the endpoint is not an absolute HTTP or HTTPS URL.