Skip to content

mcp_servers

MCP server configuration definitions.

This module defines configuration objects used to describe individual MCP servers. It currently provides MCPServerConfig, a dataclass for specifying transport type, connection details, launch command information, descriptive metadata, and the Python executable used for stdio-based server startup.

MCPServerConfig dataclass

Configuration for an individual MCP server.

Attributes:

Name Type Description
transport str

Transport method ('streamable-http' or 'stdio')

url Optional[str]

URL for streamable-http transport

command Optional[str]

Command to launch server for stdio transport

description Optional[str]

Human-readable description of the server

python_executable str

Path to Python executable (used for stdio transport).

verify bool | str

TLS verification setting for streamable-http servers. Use True to resolve from environment/system trust, False to disable verification, or a CA bundle path string.

Source code in src/mada/core/config/mcp_servers.py
@dataclass
class MCPServerConfig:
    """
    Configuration for an individual MCP server.

    Attributes:
        transport (str): Transport method ('streamable-http' or 'stdio')
        url (Optional[str]): URL for streamable-http transport
        command (Optional[str]): Command to launch server for stdio transport
        description (Optional[str]): Human-readable description of the server
        python_executable (str): Path to Python executable (used for stdio transport).
        verify (bool | str): TLS verification setting for streamable-http
            servers. Use `True` to resolve from environment/system trust,
            `False` to disable verification, or a CA bundle path string.
    """

    transport: str
    url: Optional[str] = None
    command: Optional[str] = None
    description: Optional[str] = ""
    python_executable: str = sys.executable
    verify: bool | str = True

    def __post_init__(self):
        """Expand environment variables in string-based verification settings."""
        if isinstance(self.verify, str):
            self.verify = expand_env_vars(self.verify)

__post_init__()

Expand environment variables in string-based verification settings.

Source code in src/mada/core/config/mcp_servers.py
def __post_init__(self):
    """Expand environment variables in string-based verification settings."""
    if isinstance(self.verify, str):
        self.verify = expand_env_vars(self.verify)