# This file was auto-generated by Fern from our API Definition.

import typing

import pydantic
from ..core.pydantic_utilities import IS_PYDANTIC_V2, UniversalBaseModel


class McpTool(UniversalBaseModel):
    """
    Request-scoped MCP server configuration.
    """

    server_label: str = pydantic.Field()
    """
    Unique label for this MCP server within the request
    """

    configuration_id: typing.Optional[str] = pydantic.Field(default=None)
    """
    Reference to a pre-saved MCP configuration
    """

    server_url: typing.Optional[str] = pydantic.Field(default=None)
    """
    Direct URL to MCP server (http(s):// or stdio://)
    """

    authorization: typing.Optional[str] = pydantic.Field(default=None)
    """
    Authorization token for MCP server (e.g. Bearer token)
    """

    headers: typing.Optional[typing.Dict[str, typing.Optional[str]]] = pydantic.Field(default=None)
    """
    Additional HTTP headers to send to the MCP server
    """

    allowed_tools: typing.Optional[typing.List[str]] = pydantic.Field(default=None)
    """
    Optional allow-list of MCP tool names for this server
    """

    if IS_PYDANTIC_V2:
        model_config: typing.ClassVar[pydantic.ConfigDict] = pydantic.ConfigDict(extra="allow", frozen=True)  # type: ignore # Pydantic v2
    else:

        class Config:
            frozen = True
            smart_union = True
            extra = pydantic.Extra.allow
