# Copyright (c) 2025 Dedalus Labs, Inc. and its contributors
# SPDX-License-Identifier: MIT
from dedalus_mcp import MCPServer
from dedalus_mcp.server import TransportSecuritySettings
from .gmail import get_gmail_connection, gmail_tools
from .smoke import smoke_tools
async def main() -> None:
# Ensure we have a valid Google access token before starting the server.
# Non-interactive by default: if tokens are missing, run:
# uv run python -m src.gmail_auth
gmail_api = get_gmail_connection(interactive_auth=False)
server = MCPServer(
name="gmail-mcp",
connections=[gmail_api],
http_security=TransportSecuritySettings(enable_dns_rebinding_protection=False),
authorization_server="https://preview.as.dedaluslabs.ai",
)
server.collect(*smoke_tools, *gmail_tools)
await server.serve(port=8080)