Update banner (#1567)

This commit is contained in:
Jeremiah Lowin 2025-08-21 08:24:23 -04:00 committed by GitHub
commit 0d01b74abf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -3,6 +3,7 @@ from __future__ import annotations
from importlib.metadata import version
from typing import TYPE_CHECKING, Any, Literal
from rich.align import Align
from rich.console import Console, Group
from rich.panel import Panel
from rich.table import Table
@ -14,11 +15,11 @@ if TYPE_CHECKING:
from fastmcp import FastMCP
LOGO_ASCII = r"""
_ __ ___ ______ __ __ _____________ ____ ____
_ __ ___ / ____/___ ______/ /_/ |/ / ____/ __ \ |___ \ / __ \
_ __ ___ _____ __ __ _____________ ____ ____
_ __ ___ .'____/___ ______/ /_/ |/ / ____/ __ \ |___ \ / __ \
_ __ ___ / /_ / __ `/ ___/ __/ /|_/ / / / /_/ / ___/ / / / / /
_ __ ___ / __/ / /_/ (__ ) /_/ / / / /___/ ____/ / __/_/ /_/ /
_ __ ___ /_/ \__,_/____/\__/_/ /_/\____/_/ /_____(_)____/
_ __ ___ /_/ \____/____/\__/_/ /_/\____/_/ /_____(*)____/
""".lstrip("\n")
@ -44,11 +45,14 @@ def log_server_banner(
# Create the logo text
logo_text = Text(LOGO_ASCII, style="bold green")
# Create the main title
title_text = Text("FastMCP 2.0", style="bold blue")
# Create the information table
info_table = Table.grid(padding=(0, 1))
info_table.add_column(style="bold", justify="center") # Emoji column
info_table.add_column(style="bold cyan", justify="left") # Label column
info_table.add_column(style="white", justify="left") # Value column
info_table.add_column(style="cyan", justify="left") # Label column
info_table.add_column(style="dim", justify="left") # Value column
match transport:
case "http" | "streamable-http":
@ -69,11 +73,6 @@ def log_server_banner(
server_url += f"/{path.lstrip('/')}"
info_table.add_row("🔗", "Server URL:", server_url)
# Add documentation link
info_table.add_row("", "", "")
info_table.add_row("📚", "Docs:", "https://gofastmcp.com")
info_table.add_row("🚀", "Deploy:", "https://fastmcp.cloud")
# Add version information with explicit style overrides
info_table.add_row("", "", "")
info_table.add_row(
@ -83,16 +82,26 @@ def log_server_banner(
)
info_table.add_row(
"🤝",
"MCP version:",
"MCP SDK version:",
Text(version("mcp"), style="dim white", no_wrap=True),
)
# Create panel with logo and information using Group
panel_content = Group(logo_text, "", info_table)
# Add documentation link
info_table.add_row("", "", "")
info_table.add_row("📚", "Docs:", "https://gofastmcp.com")
info_table.add_row("🚀", "Deploy:", "https://fastmcp.cloud")
# Create panel with logo, title, and information using Group
panel_content = Group(
Align.center(logo_text),
Align.center(title_text),
"",
"",
Align.center(info_table),
)
panel = Panel(
panel_content,
title="FastMCP 2.0",
title_align="left",
border_style="dim",
padding=(1, 4),
expand=False,