Quellcodebibliothek Statistik Leitseite products/Sources/formale Sprachen/Python/SDK/examples/snippets/servers/     Datei vom 5.10.2026 mit Größe 391 B image not shown  

SSL basic_tool.py   Interaktion und
PortierbarkeitPython

 

from mcp.server.mcpserver import MCPServer

mcp = MCPServer(name="Tool Example")


@mcp.tool()
def sum(a: int, b: int) -> int:
    """Add two numbers together."""
    return a + b


@mcp.tool()
def get_weather(city: str, unit: str = "celsius") -> str:
    """Get weather for a city."""
    # This would normally call a weather API
    return f"Weather in {city}: 22degrees{unit[0].upper()}"

Messung
CHZG
979910098

¤ Diese beiden folgenden Angebotsgruppen bietet das Unternehmen0.12Angebot  ¤

*Eine klare Vorstellung vom Zielzustand